mbed library sources

Dependents:   Encrypted my_mbed lklk CyaSSL_DTLS_Cellular ... more

Superseded

This library was superseded by mbed-dev - https://os.mbed.com/users/mbed_official/code/mbed-dev/.

Development branch of the mbed library sources. This library is kept in synch with the latest changes from the mbed SDK and it is not guaranteed to work.

If you are looking for a stable and tested release, please import one of the official mbed library releases:

Import librarymbed

The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Committer:
mbed_official
Date:
Wed Jul 01 08:15:11 2015 +0100
Revision:
577:15494b56c2f3
Parent:
targets/cmsis/TARGET_NXP/TARGET_LPC43XX/TOOLCHAIN_GCC_ARM/startup_LPC43xx.s@66:64ad953ee6c3
Synchronized with git revision 7766e75dd858812cd79aedb3080349715f55dd56

Full URL: https://github.com/mbedmicro/mbed/commit/7766e75dd858812cd79aedb3080349715f55dd56/

GCC asm updates

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 47:02833c62d054 1 /* File: startup_ARMCM4.S
mbed_official 47:02833c62d054 2 * Purpose: startup file for Cortex-M4 devices. Should use with
mbed_official 47:02833c62d054 3 * GCC for ARM Embedded Processors
mbed_official 47:02833c62d054 4 * Version: V1.4
mbed_official 47:02833c62d054 5 * Date: 20 Dezember 2012
mbed_official 47:02833c62d054 6 *
mbed_official 47:02833c62d054 7 */
mbed_official 47:02833c62d054 8 /* Copyright (c) 2011 - 2012 ARM LIMITED
mbed_official 47:02833c62d054 9
mbed_official 47:02833c62d054 10 All rights reserved.
mbed_official 47:02833c62d054 11 Redistribution and use in source and binary forms, with or without
mbed_official 47:02833c62d054 12 modification, are permitted provided that the following conditions are met:
mbed_official 47:02833c62d054 13 - Redistributions of source code must retain the above copyright
mbed_official 47:02833c62d054 14 notice, this list of conditions and the following disclaimer.
mbed_official 47:02833c62d054 15 - Redistributions in binary form must reproduce the above copyright
mbed_official 47:02833c62d054 16 notice, this list of conditions and the following disclaimer in the
mbed_official 47:02833c62d054 17 documentation and/or other materials provided with the distribution.
mbed_official 47:02833c62d054 18 - Neither the name of ARM nor the names of its contributors may be used
mbed_official 47:02833c62d054 19 to endorse or promote products derived from this software without
mbed_official 47:02833c62d054 20 specific prior written permission.
mbed_official 47:02833c62d054 21 *
mbed_official 47:02833c62d054 22 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
mbed_official 47:02833c62d054 23 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
mbed_official 47:02833c62d054 24 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
mbed_official 47:02833c62d054 25 ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
mbed_official 47:02833c62d054 26 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
mbed_official 47:02833c62d054 27 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
mbed_official 47:02833c62d054 28 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
mbed_official 47:02833c62d054 29 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
mbed_official 47:02833c62d054 30 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
mbed_official 47:02833c62d054 31 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
mbed_official 47:02833c62d054 32 POSSIBILITY OF SUCH DAMAGE.
mbed_official 47:02833c62d054 33 ---------------------------------------------------------------------------*/
mbed_official 47:02833c62d054 34
mbed_official 47:02833c62d054 35
mbed_official 47:02833c62d054 36 .syntax unified
mbed_official 47:02833c62d054 37 .arch armv7-m
mbed_official 47:02833c62d054 38
mbed_official 47:02833c62d054 39 .section .stack
mbed_official 47:02833c62d054 40 .align 3
mbed_official 47:02833c62d054 41 .ifdef __STACK_SIZE
mbed_official 47:02833c62d054 42 .equ Stack_Size, __STACK_SIZE
mbed_official 47:02833c62d054 43 .else
mbed_official 47:02833c62d054 44 .equ Stack_Size, 0x00000400
mbed_official 47:02833c62d054 45 .endif
mbed_official 47:02833c62d054 46 .globl __StackTop
mbed_official 47:02833c62d054 47 .globl __StackLimit
mbed_official 47:02833c62d054 48 __StackLimit:
mbed_official 47:02833c62d054 49 .space Stack_Size
mbed_official 47:02833c62d054 50 .size __StackLimit, . - __StackLimit
mbed_official 47:02833c62d054 51 __StackTop:
mbed_official 47:02833c62d054 52 .size __StackTop, . - __StackTop
mbed_official 47:02833c62d054 53
mbed_official 47:02833c62d054 54 .section .heap
mbed_official 47:02833c62d054 55 .align 3
mbed_official 47:02833c62d054 56 .ifdef __HEAP_SIZE
mbed_official 47:02833c62d054 57 .equ Heap_Size, __HEAP_SIZE
mbed_official 47:02833c62d054 58 .else
mbed_official 47:02833c62d054 59 .equ Heap_Size, 0x00000C00
mbed_official 47:02833c62d054 60 .endif
mbed_official 47:02833c62d054 61 .globl __HeapBase
mbed_official 47:02833c62d054 62 .globl __HeapLimit
mbed_official 47:02833c62d054 63 __HeapBase:
mbed_official 47:02833c62d054 64 .if Heap_Size
mbed_official 47:02833c62d054 65 .space Heap_Size
mbed_official 47:02833c62d054 66 .endif
mbed_official 47:02833c62d054 67 .size __HeapBase, . - __HeapBase
mbed_official 47:02833c62d054 68 __HeapLimit:
mbed_official 47:02833c62d054 69 .size __HeapLimit, . - __HeapLimit
mbed_official 47:02833c62d054 70
mbed_official 47:02833c62d054 71 .section .isr_vector
mbed_official 47:02833c62d054 72 .align 2
mbed_official 47:02833c62d054 73 .globl __isr_vector
mbed_official 47:02833c62d054 74 __isr_vector:
mbed_official 47:02833c62d054 75 .long __StackTop /* Top of Stack */
mbed_official 47:02833c62d054 76 .long Reset_Handler /* Reset Handler */
mbed_official 47:02833c62d054 77 .long NMI_Handler /* NMI Handler */
mbed_official 47:02833c62d054 78 .long HardFault_Handler /* Hard Fault Handler */
mbed_official 47:02833c62d054 79 .long MemManage_Handler /* MPU Fault Handler */
mbed_official 47:02833c62d054 80 .long BusFault_Handler /* Bus Fault Handler */
mbed_official 47:02833c62d054 81 .long UsageFault_Handler /* Usage Fault Handler */
mbed_official 47:02833c62d054 82 .long 0 /* Reserved */
mbed_official 47:02833c62d054 83 .long 0 /* Reserved */
mbed_official 47:02833c62d054 84 .long 0 /* Reserved */
mbed_official 47:02833c62d054 85 .long 0 /* Reserved */
mbed_official 47:02833c62d054 86 .long SVC_Handler /* SVCall Handler */
mbed_official 47:02833c62d054 87 .long DebugMon_Handler /* Debug Monitor Handler */
mbed_official 47:02833c62d054 88 .long 0 /* Reserved */
mbed_official 47:02833c62d054 89 .long PendSV_Handler /* PendSV Handler */
mbed_official 47:02833c62d054 90 .long SysTick_Handler /* SysTick Handler */
mbed_official 47:02833c62d054 91
mbed_official 47:02833c62d054 92 /* External interrupts */
mbed_official 47:02833c62d054 93 .long DAC_IRQHandler /* 0: DAC */
mbed_official 47:02833c62d054 94 .long M0CORE_IRQHandler /* 1: M4-M0 communication */
mbed_official 47:02833c62d054 95 .long DMA_IRQHandler /* 2: - */
mbed_official 47:02833c62d054 96 .long 0 /* 3: Reserved */
mbed_official 47:02833c62d054 97 .long FLASHEEPROM_IRQHandler/* 4: ORed flash bank A/B, EEPROM int */
mbed_official 47:02833c62d054 98 .long ETHERNET_IRQHandler /* 5: Ethernet interrupt */
mbed_official 47:02833c62d054 99 .long SDIO_IRQHandler /* 6: SD/MMC interrupt */
mbed_official 47:02833c62d054 100 .long LCD_IRQHandler /* 7: - */
mbed_official 47:02833c62d054 101 .long USB0_IRQHandler /* 8: OTG interrupt */
mbed_official 47:02833c62d054 102 .long USB1_IRQHandler /* 9: - */
mbed_official 47:02833c62d054 103 .long SCT_IRQHandler /* 10: SCT combined interrupt */
mbed_official 47:02833c62d054 104 .long RITIMER_IRQHandler /* 11: - */
mbed_official 47:02833c62d054 105 .long TIMER0_IRQHandler /* 12: - */
mbed_official 47:02833c62d054 106 .long TIMER1_IRQHandler /* 13: - */
mbed_official 47:02833c62d054 107 .long TIMER2_IRQHandler /* 14: - */
mbed_official 47:02833c62d054 108 .long TIMER3_IRQHandler /* 15: - */
mbed_official 47:02833c62d054 109 .long MCPWM_IRQHandler /* 16: Motor control PWM */
mbed_official 47:02833c62d054 110 .long ADC0_IRQHandler /* 17: - */
mbed_official 47:02833c62d054 111 .long I2C0_IRQHandler /* 18: - */
mbed_official 47:02833c62d054 112 .long I2C1_IRQHandler /* 19: - */
mbed_official 47:02833c62d054 113 .long SPI_IRQHandler /* 20: - */
mbed_official 47:02833c62d054 114 .long ADC1_IRQHandler /* 21: - */
mbed_official 47:02833c62d054 115 .long SSP0_IRQHandler /* 22: - */
mbed_official 47:02833c62d054 116 .long SSP1_IRQHandler /* 23: - */
mbed_official 47:02833c62d054 117 .long USART0_IRQHandler /* 24: - */
mbed_official 47:02833c62d054 118 .long UART1_IRQHandler /* 25: Combined UART int w Modem int */
mbed_official 47:02833c62d054 119 .long USART2_IRQHandler /* 26: - */
mbed_official 47:02833c62d054 120 .long USART3_IRQHandler /* 27: combined USART int w IrDA int */
mbed_official 47:02833c62d054 121 .long I2S0_IRQHandler /* 28: - */
mbed_official 47:02833c62d054 122 .long I2S1_IRQHandler /* 29: - */
mbed_official 47:02833c62d054 123 .long SPIFI_IRQHandler /* 30: - */
mbed_official 47:02833c62d054 124 .long SGPIO_IRQHandler /* 31: - */
mbed_official 47:02833c62d054 125 .long PIN_INT0_IRQHandler /* 32: GPIO pin interrupt 0 */
mbed_official 47:02833c62d054 126 .long PIN_INT1_IRQHandler /* 33: GPIO pin interrupt 1 */
mbed_official 47:02833c62d054 127 .long PIN_INT2_IRQHandler /* 34: GPIO pin interrupt 2 */
mbed_official 47:02833c62d054 128 .long PIN_INT3_IRQHandler /* 35: GPIO pin interrupt 3 */
mbed_official 47:02833c62d054 129 .long PIN_INT4_IRQHandler /* 36: GPIO pin interrupt 4 */
mbed_official 47:02833c62d054 130 .long PIN_INT5_IRQHandler /* 37: GPIO pin interrupt 5 */
mbed_official 47:02833c62d054 131 .long PIN_INT6_IRQHandler /* 38: GPIO pin interrupt 6 */
mbed_official 47:02833c62d054 132 .long PIN_INT7_IRQHandler /* 39: GPIO pin interrupt 7 */
mbed_official 47:02833c62d054 133 .long GINT0_IRQHandler /* 40: GPIO global interrupt 0 */
mbed_official 47:02833c62d054 134 .long GINT1_IRQHandler /* 41: GPIO global interrupt 1 */
mbed_official 47:02833c62d054 135 .long EVENTROUTER_IRQHandler/* 42: Event router interrupt */
mbed_official 47:02833c62d054 136 .long C_CAN1_IRQHandler /* 43: - */
mbed_official 47:02833c62d054 137 .long 0 /* 44: Reserved */
mbed_official 47:02833c62d054 138 .long 0 /* 45: Reserved */
mbed_official 47:02833c62d054 139 .long ATIMER_IRQHandler /* 46: Alarm timer interuupt */
mbed_official 47:02833c62d054 140 .long RTC_IRQHandler /* 47: - */
mbed_official 47:02833c62d054 141 .long 0 /* 48: Reserved */
mbed_official 47:02833c62d054 142 .long WWDT_IRQHandler /* 49: - */
mbed_official 47:02833c62d054 143 .long 0 /* 50: Reserved */
mbed_official 47:02833c62d054 144 .long C_CAN0_IRQHandler /* 51: - */
mbed_official 47:02833c62d054 145 .long QEI_IRQHandler /* 52: - */
mbed_official 47:02833c62d054 146
mbed_official 47:02833c62d054 147 .size __isr_vector, . - __isr_vector
mbed_official 47:02833c62d054 148
mbed_official 47:02833c62d054 149 .text
mbed_official 47:02833c62d054 150 .thumb
mbed_official 47:02833c62d054 151 .thumb_func
mbed_official 47:02833c62d054 152 .align 2
mbed_official 47:02833c62d054 153 .globl Reset_Handler
mbed_official 47:02833c62d054 154 .type Reset_Handler, %function
mbed_official 47:02833c62d054 155 Reset_Handler:
mbed_official 47:02833c62d054 156 /* Loop to copy data from read only memory to RAM. The ranges
mbed_official 47:02833c62d054 157 * of copy from/to are specified by following symbols evaluated in
mbed_official 47:02833c62d054 158 * linker script.
mbed_official 47:02833c62d054 159 * __etext: End of code section, i.e., begin of data sections to copy from.
mbed_official 47:02833c62d054 160 * __data_start__/__data_end__: RAM address range that data should be
mbed_official 47:02833c62d054 161 * copied to. Both must be aligned to 4 bytes boundary. */
mbed_official 47:02833c62d054 162
mbed_official 47:02833c62d054 163 ldr r1, =__etext
mbed_official 47:02833c62d054 164 ldr r2, =__data_start__
mbed_official 47:02833c62d054 165 ldr r3, =__data_end__
mbed_official 47:02833c62d054 166
mbed_official 47:02833c62d054 167 .LC0:
mbed_official 47:02833c62d054 168 cmp r2, r3
mbed_official 47:02833c62d054 169 ittt lt
mbed_official 47:02833c62d054 170 ldrlt r0, [r1], #4
mbed_official 47:02833c62d054 171 strlt r0, [r2], #4
mbed_official 47:02833c62d054 172 blt .LC0
mbed_official 47:02833c62d054 173
mbed_official 66:64ad953ee6c3 174 ldr r0, =SystemInit
mbed_official 66:64ad953ee6c3 175 blx r0
mbed_official 66:64ad953ee6c3 176 ldr r0, =_start
mbed_official 66:64ad953ee6c3 177 bx r0
mbed_official 47:02833c62d054 178 .pool
mbed_official 47:02833c62d054 179 .size Reset_Handler, . - Reset_Handler
mbed_official 47:02833c62d054 180
mbed_official 66:64ad953ee6c3 181 .text
mbed_official 47:02833c62d054 182 /* Macro to define default handlers. Default handler
mbed_official 47:02833c62d054 183 * will be weak symbol and just dead loops. They can be
mbed_official 47:02833c62d054 184 * overwritten by other handlers */
mbed_official 66:64ad953ee6c3 185 .macro def_default_handler handler_name
mbed_official 47:02833c62d054 186 .align 1
mbed_official 47:02833c62d054 187 .thumb_func
mbed_official 47:02833c62d054 188 .weak \handler_name
mbed_official 47:02833c62d054 189 .type \handler_name, %function
mbed_official 47:02833c62d054 190 \handler_name :
mbed_official 47:02833c62d054 191 b .
mbed_official 47:02833c62d054 192 .size \handler_name, . - \handler_name
mbed_official 47:02833c62d054 193 .endm
mbed_official 47:02833c62d054 194
mbed_official 66:64ad953ee6c3 195 def_default_handler NMI_Handler
mbed_official 66:64ad953ee6c3 196 def_default_handler HardFault_Handler
mbed_official 66:64ad953ee6c3 197 def_default_handler MemManage_Handler
mbed_official 66:64ad953ee6c3 198 def_default_handler BusFault_Handler
mbed_official 66:64ad953ee6c3 199 def_default_handler UsageFault_Handler
mbed_official 66:64ad953ee6c3 200 def_default_handler SVC_Handler
mbed_official 66:64ad953ee6c3 201 def_default_handler DebugMon_Handler
mbed_official 66:64ad953ee6c3 202 def_default_handler PendSV_Handler
mbed_official 66:64ad953ee6c3 203 def_default_handler SysTick_Handler
mbed_official 66:64ad953ee6c3 204 def_default_handler Default_Handler
mbed_official 66:64ad953ee6c3 205
mbed_official 66:64ad953ee6c3 206 .macro def_irq_default_handler handler_name
mbed_official 66:64ad953ee6c3 207 .weak \handler_name
mbed_official 66:64ad953ee6c3 208 .set \handler_name, Default_Handler
mbed_official 66:64ad953ee6c3 209 .endm
mbed_official 47:02833c62d054 210
mbed_official 66:64ad953ee6c3 211 def_irq_default_handler DAC_IRQHandler
mbed_official 66:64ad953ee6c3 212 def_irq_default_handler M0CORE_IRQHandler
mbed_official 66:64ad953ee6c3 213 def_irq_default_handler DMA_IRQHandler
mbed_official 66:64ad953ee6c3 214 def_irq_default_handler FLASHEEPROM_IRQHandler
mbed_official 66:64ad953ee6c3 215 def_irq_default_handler ETHERNET_IRQHandler
mbed_official 66:64ad953ee6c3 216 def_irq_default_handler SDIO_IRQHandler
mbed_official 66:64ad953ee6c3 217 def_irq_default_handler LCD_IRQHandler
mbed_official 66:64ad953ee6c3 218 def_irq_default_handler USB0_IRQHandler
mbed_official 66:64ad953ee6c3 219 def_irq_default_handler USB1_IRQHandler
mbed_official 66:64ad953ee6c3 220 def_irq_default_handler SCT_IRQHandler
mbed_official 66:64ad953ee6c3 221 def_irq_default_handler RITIMER_IRQHandler
mbed_official 66:64ad953ee6c3 222 def_irq_default_handler TIMER0_IRQHandler
mbed_official 66:64ad953ee6c3 223 def_irq_default_handler TIMER1_IRQHandler
mbed_official 66:64ad953ee6c3 224 def_irq_default_handler TIMER2_IRQHandler
mbed_official 66:64ad953ee6c3 225 def_irq_default_handler TIMER3_IRQHandler
mbed_official 66:64ad953ee6c3 226 def_irq_default_handler MCPWM_IRQHandler
mbed_official 66:64ad953ee6c3 227 def_irq_default_handler ADC0_IRQHandler
mbed_official 66:64ad953ee6c3 228 def_irq_default_handler I2C0_IRQHandler
mbed_official 66:64ad953ee6c3 229 def_irq_default_handler I2C1_IRQHandler
mbed_official 66:64ad953ee6c3 230 def_irq_default_handler SPI_IRQHandler
mbed_official 66:64ad953ee6c3 231 def_irq_default_handler ADC1_IRQHandler
mbed_official 66:64ad953ee6c3 232 def_irq_default_handler SSP0_IRQHandler
mbed_official 66:64ad953ee6c3 233 def_irq_default_handler SSP1_IRQHandler
mbed_official 66:64ad953ee6c3 234 def_irq_default_handler USART0_IRQHandler
mbed_official 66:64ad953ee6c3 235 def_irq_default_handler UART1_IRQHandler
mbed_official 66:64ad953ee6c3 236 def_irq_default_handler USART2_IRQHandler
mbed_official 66:64ad953ee6c3 237 def_irq_default_handler USART3_IRQHandler
mbed_official 66:64ad953ee6c3 238 def_irq_default_handler I2S0_IRQHandler
mbed_official 66:64ad953ee6c3 239 def_irq_default_handler I2S1_IRQHandler
mbed_official 66:64ad953ee6c3 240 def_irq_default_handler SPIFI_IRQHandler
mbed_official 66:64ad953ee6c3 241 def_irq_default_handler SGPIO_IRQHandler
mbed_official 66:64ad953ee6c3 242 def_irq_default_handler PIN_INT0_IRQHandler
mbed_official 66:64ad953ee6c3 243 def_irq_default_handler PIN_INT1_IRQHandler
mbed_official 66:64ad953ee6c3 244 def_irq_default_handler PIN_INT2_IRQHandler
mbed_official 66:64ad953ee6c3 245 def_irq_default_handler PIN_INT3_IRQHandler
mbed_official 66:64ad953ee6c3 246 def_irq_default_handler PIN_INT4_IRQHandler
mbed_official 66:64ad953ee6c3 247 def_irq_default_handler PIN_INT5_IRQHandler
mbed_official 66:64ad953ee6c3 248 def_irq_default_handler PIN_INT6_IRQHandler
mbed_official 66:64ad953ee6c3 249 def_irq_default_handler PIN_INT7_IRQHandler
mbed_official 66:64ad953ee6c3 250 def_irq_default_handler GINT0_IRQHandler
mbed_official 66:64ad953ee6c3 251 def_irq_default_handler GINT1_IRQHandler
mbed_official 66:64ad953ee6c3 252 def_irq_default_handler EVENTROUTER_IRQHandler
mbed_official 66:64ad953ee6c3 253 def_irq_default_handler C_CAN1_IRQHandler
mbed_official 66:64ad953ee6c3 254 def_irq_default_handler ATIMER_IRQHandler
mbed_official 66:64ad953ee6c3 255 def_irq_default_handler RTC_IRQHandler
mbed_official 66:64ad953ee6c3 256 def_irq_default_handler WWDT_IRQHandler
mbed_official 66:64ad953ee6c3 257 def_irq_default_handler C_CAN0_IRQHandler
mbed_official 66:64ad953ee6c3 258 def_irq_default_handler QEI_IRQHandler
mbed_official 47:02833c62d054 259
mbed_official 47:02833c62d054 260 .end