mbed library sources

Dependents:   Freedman_v2 Nucleo_i2c_OLED_BME280_copy

Fork of mbed-src by mbed official

Committer:
mbed_official
Date:
Wed Jul 01 08:15:11 2015 +0100
Revision:
577:15494b56c2f3
Parent:
targets/cmsis/TARGET_NXP/TARGET_LPC15XX/TOOLCHAIN_GCC_ARM/startup_LPC15xx.s@280:a62e2e63cfbd
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 280:a62e2e63cfbd 1 /* File: startup_ARMCM3.s
mbed_official 280:a62e2e63cfbd 2 * Purpose: startup file for Cortex-M3/M4 devices. Should use with
mbed_official 280:a62e2e63cfbd 3 * GNU Tools for ARM Embedded Processors
mbed_official 280:a62e2e63cfbd 4 * Version: V1.1
mbed_official 280:a62e2e63cfbd 5 * Date: 17 June 2011
mbed_official 280:a62e2e63cfbd 6 *
mbed_official 280:a62e2e63cfbd 7 * Copyright (C) 2011 ARM Limited. All rights reserved.
mbed_official 280:a62e2e63cfbd 8 * ARM Limited (ARM) is supplying this software for use with Cortex-M3/M4
mbed_official 280:a62e2e63cfbd 9 * processor based microcontrollers. This file can be freely distributed
mbed_official 280:a62e2e63cfbd 10 * within development tools that are supporting such ARM based processors.
mbed_official 280:a62e2e63cfbd 11 *
mbed_official 280:a62e2e63cfbd 12 * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
mbed_official 280:a62e2e63cfbd 13 * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
mbed_official 280:a62e2e63cfbd 14 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
mbed_official 280:a62e2e63cfbd 15 * ARM SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
mbed_official 280:a62e2e63cfbd 16 * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
mbed_official 280:a62e2e63cfbd 17 */
mbed_official 280:a62e2e63cfbd 18 .syntax unified
mbed_official 280:a62e2e63cfbd 19 .arch armv7-m
mbed_official 280:a62e2e63cfbd 20
mbed_official 280:a62e2e63cfbd 21 /* Memory Model
mbed_official 280:a62e2e63cfbd 22 The HEAP starts at the end of the DATA section and grows upward.
mbed_official 280:a62e2e63cfbd 23
mbed_official 280:a62e2e63cfbd 24 The STACK starts at the end of the RAM and grows downward.
mbed_official 280:a62e2e63cfbd 25
mbed_official 280:a62e2e63cfbd 26 The HEAP and stack STACK are only checked at compile time:
mbed_official 280:a62e2e63cfbd 27 (DATA_SIZE + HEAP_SIZE + STACK_SIZE) < RAM_SIZE
mbed_official 280:a62e2e63cfbd 28
mbed_official 280:a62e2e63cfbd 29 This is just a check for the bare minimum for the Heap+Stack area before
mbed_official 280:a62e2e63cfbd 30 aborting compilation, it is not the run time limit:
mbed_official 280:a62e2e63cfbd 31 Heap_Size + Stack_Size = 0x80 + 0x80 = 0x100
mbed_official 280:a62e2e63cfbd 32 */
mbed_official 280:a62e2e63cfbd 33 .section .stack
mbed_official 280:a62e2e63cfbd 34 .align 3
mbed_official 280:a62e2e63cfbd 35 #ifdef __STACK_SIZE
mbed_official 280:a62e2e63cfbd 36 .equ Stack_Size, __STACK_SIZE
mbed_official 280:a62e2e63cfbd 37 #else
mbed_official 280:a62e2e63cfbd 38 .equ Stack_Size, 0xc00
mbed_official 280:a62e2e63cfbd 39 #endif
mbed_official 280:a62e2e63cfbd 40 .globl __StackTop
mbed_official 280:a62e2e63cfbd 41 .globl __StackLimit
mbed_official 280:a62e2e63cfbd 42 __StackLimit:
mbed_official 280:a62e2e63cfbd 43 .space Stack_Size
mbed_official 280:a62e2e63cfbd 44 .size __StackLimit, . - __StackLimit
mbed_official 280:a62e2e63cfbd 45 __StackTop:
mbed_official 280:a62e2e63cfbd 46 .size __StackTop, . - __StackTop
mbed_official 280:a62e2e63cfbd 47
mbed_official 280:a62e2e63cfbd 48 .section .heap
mbed_official 280:a62e2e63cfbd 49 .align 3
mbed_official 280:a62e2e63cfbd 50 #ifdef __HEAP_SIZE
mbed_official 280:a62e2e63cfbd 51 .equ Heap_Size, __HEAP_SIZE
mbed_official 280:a62e2e63cfbd 52 #else
mbed_official 280:a62e2e63cfbd 53 .equ Heap_Size, 0x800
mbed_official 280:a62e2e63cfbd 54 #endif
mbed_official 280:a62e2e63cfbd 55 .globl __HeapBase
mbed_official 280:a62e2e63cfbd 56 .globl __HeapLimit
mbed_official 280:a62e2e63cfbd 57 __HeapBase:
mbed_official 280:a62e2e63cfbd 58 .space Heap_Size
mbed_official 280:a62e2e63cfbd 59 .size __HeapBase, . - __HeapBase
mbed_official 280:a62e2e63cfbd 60 __HeapLimit:
mbed_official 280:a62e2e63cfbd 61 .size __HeapLimit, . - __HeapLimit
mbed_official 280:a62e2e63cfbd 62
mbed_official 280:a62e2e63cfbd 63 .section .isr_vector
mbed_official 280:a62e2e63cfbd 64 .align 2
mbed_official 280:a62e2e63cfbd 65 .globl __isr_vector
mbed_official 280:a62e2e63cfbd 66 __isr_vector:
mbed_official 280:a62e2e63cfbd 67 .long __StackTop /* Top of Stack */
mbed_official 280:a62e2e63cfbd 68 .long Reset_Handler /* Reset Handler */
mbed_official 280:a62e2e63cfbd 69 .long NMI_Handler /* NMI Handler */
mbed_official 280:a62e2e63cfbd 70 .long HardFault_Handler /* Hard Fault Handler */
mbed_official 280:a62e2e63cfbd 71 .long MemManage_Handler /* MPU Fault Handler */
mbed_official 280:a62e2e63cfbd 72 .long BusFault_Handler /* Bus Fault Handler */
mbed_official 280:a62e2e63cfbd 73 .long UsageFault_Handler /* Usage Fault Handler */
mbed_official 280:a62e2e63cfbd 74 .long 0 /* Reserved */
mbed_official 280:a62e2e63cfbd 75 .long 0 /* Reserved */
mbed_official 280:a62e2e63cfbd 76 .long 0 /* Reserved */
mbed_official 280:a62e2e63cfbd 77 .long 0 /* Reserved */
mbed_official 280:a62e2e63cfbd 78 .long SVC_Handler /* SVCall Handler */
mbed_official 280:a62e2e63cfbd 79 .long DebugMon_Handler /* Debug Monitor Handler */
mbed_official 280:a62e2e63cfbd 80 .long 0 /* Reserved */
mbed_official 280:a62e2e63cfbd 81 .long PendSV_Handler /* PendSV Handler */
mbed_official 280:a62e2e63cfbd 82 .long SysTick_Handler /* SysTick Handler */
mbed_official 280:a62e2e63cfbd 83
mbed_official 280:a62e2e63cfbd 84 /* External interrupts */
mbed_official 280:a62e2e63cfbd 85 .long WDT_IRQHandler /* 0: Windowed watchdog timer */
mbed_official 280:a62e2e63cfbd 86 .long BOD_IRQHandler /* 1: Brown-Out Detect */
mbed_official 280:a62e2e63cfbd 87 .long FMC_IRQHandler /* 2: Flash controller */
mbed_official 280:a62e2e63cfbd 88 .long EEPROM_IRQHandler /* 3: EEPROM controller */
mbed_official 280:a62e2e63cfbd 89 .long DMA_IRQHandler /* 4: DMA */
mbed_official 280:a62e2e63cfbd 90 .long GINT0_IRQHandler /* 5: GPIO group 0 */
mbed_official 280:a62e2e63cfbd 91 .long GINT1_IRQHandler /* 6: GPIO group 1 */
mbed_official 280:a62e2e63cfbd 92 .long PIN_INT0_IRQHandler /* 7: PIO INT0 */
mbed_official 280:a62e2e63cfbd 93 .long PIN_INT1_IRQHandler /* 8: PIO INT1 */
mbed_official 280:a62e2e63cfbd 94 .long PIN_INT2_IRQHandler /* 9: PIO INT2 */
mbed_official 280:a62e2e63cfbd 95 .long PIN_INT3_IRQHandler /* 10: PIO INT3 */
mbed_official 280:a62e2e63cfbd 96 .long PIN_INT4_IRQHandler /* 11: PIO INT4 */
mbed_official 280:a62e2e63cfbd 97 .long PIN_INT5_IRQHandler /* 12: PIO INT5 */
mbed_official 280:a62e2e63cfbd 98 .long PIN_INT6_IRQHandler /* 13: PIO INT6 */
mbed_official 280:a62e2e63cfbd 99 .long PIN_INT7_IRQHandler /* 14: PIO INT7 */
mbed_official 280:a62e2e63cfbd 100 .long RIT_IRQHandler /* 15: Repetitive Interrupt Timer */
mbed_official 280:a62e2e63cfbd 101 .long SCT0_IRQHandler /* 16: State configurable timer */
mbed_official 280:a62e2e63cfbd 102 .long SCT1_IRQHandler /* 17: State configurable timer */
mbed_official 280:a62e2e63cfbd 103 .long SCT2_IRQHandler /* 18: State configurable timer */
mbed_official 280:a62e2e63cfbd 104 .long SCT3_IRQHandler /* 19: State configurable timer */
mbed_official 280:a62e2e63cfbd 105 .long MRT_IRQHandler /* 20: Multi-Rate Timer */
mbed_official 280:a62e2e63cfbd 106 .long UART0_IRQHandler /* 21: UART0 */
mbed_official 280:a62e2e63cfbd 107 .long UART1_IRQHandler /* 22: UART1 */
mbed_official 280:a62e2e63cfbd 108 .long UART2_IRQHandler /* 23: UART2 */
mbed_official 280:a62e2e63cfbd 109 .long I2C0_IRQHandler /* 24: I2C0 controller */
mbed_official 280:a62e2e63cfbd 110 .long SPI0_IRQHandler /* 25: SPI0 controller */
mbed_official 280:a62e2e63cfbd 111 .long SPI1_IRQHandler /* 26: SPI1 controller */
mbed_official 280:a62e2e63cfbd 112 .long CAN_IRQHandler /* 27: C_CAN0 */
mbed_official 280:a62e2e63cfbd 113 .long USB_IRQHandler /* 28: USB IRQ */
mbed_official 280:a62e2e63cfbd 114 .long USB_FIQHandler /* 29: USB FIQ */
mbed_official 280:a62e2e63cfbd 115 .long USBWakeup_IRQHandler /* 30: USB wake-up */
mbed_official 280:a62e2e63cfbd 116 .long ADC0A_IRQHandler /* 31: ADC0 sequence A completion */
mbed_official 280:a62e2e63cfbd 117 .long ADC0B_IRQHandler /* 32: ADC0 sequence B completion */
mbed_official 280:a62e2e63cfbd 118 .long ADC0_THCMP_IRQHandler /* 33: ADC0 threshold compare */
mbed_official 280:a62e2e63cfbd 119 .long ADC0_OVR_IRQHandler /* 34: ADC0 overrun */
mbed_official 280:a62e2e63cfbd 120 .long ADC1A_IRQHandler /* 35: ADC1 sequence A completion */
mbed_official 280:a62e2e63cfbd 121 .long ADC1B_IRQHandler /* 36: ADC1 sequence B completion */
mbed_official 280:a62e2e63cfbd 122 .long ADC1_THCMP_IRQHandler /* 37: ADC1 threshold compare */
mbed_official 280:a62e2e63cfbd 123 .long ADC1_OVR_IRQHandler /* 38: ADC1 overrun */
mbed_official 280:a62e2e63cfbd 124 .long DAC_IRQHandler /* 39: DAC */
mbed_official 280:a62e2e63cfbd 125 .long ACMP0_IRQHandler /* 40: Analog Comparator 0 */
mbed_official 280:a62e2e63cfbd 126 .long ACMP1_IRQHandler /* 41: Analog Comparator 1 */
mbed_official 280:a62e2e63cfbd 127 .long ACMP2_IRQHandler /* 42: Analog Comparator 2 */
mbed_official 280:a62e2e63cfbd 128 .long ACMP3_IRQHandler /* 43: Analog Comparator 3 */
mbed_official 280:a62e2e63cfbd 129 .long QEI_IRQHandler /* 44: Quadrature Encoder Interface */
mbed_official 280:a62e2e63cfbd 130 .long RTC_ALARM_IRQHandler /* 45: RTC alarm */
mbed_official 280:a62e2e63cfbd 131 .long RTC_WAKE_IRQHandler /* 46: RTC wake-up */
mbed_official 280:a62e2e63cfbd 132
mbed_official 280:a62e2e63cfbd 133 .size __isr_vector, . - __isr_vector
mbed_official 280:a62e2e63cfbd 134
mbed_official 280:a62e2e63cfbd 135 .text
mbed_official 280:a62e2e63cfbd 136 .thumb
mbed_official 280:a62e2e63cfbd 137 .thumb_func
mbed_official 280:a62e2e63cfbd 138 .align 2
mbed_official 280:a62e2e63cfbd 139 .globl Reset_Handler
mbed_official 280:a62e2e63cfbd 140 .type Reset_Handler, %function
mbed_official 280:a62e2e63cfbd 141 Reset_Handler:
mbed_official 280:a62e2e63cfbd 142 /* Loop to copy data from read only memory to RAM. The ranges
mbed_official 280:a62e2e63cfbd 143 * of copy from/to are specified by following symbols evaluated in
mbed_official 280:a62e2e63cfbd 144 * linker script.
mbed_official 280:a62e2e63cfbd 145 * _etext: End of code section, i.e., begin of data sections to copy from.
mbed_official 280:a62e2e63cfbd 146 * __data_start__/__data_end__: RAM address range that data should be
mbed_official 280:a62e2e63cfbd 147 * copied to. Both must be aligned to 4 bytes boundary. */
mbed_official 280:a62e2e63cfbd 148
mbed_official 280:a62e2e63cfbd 149 ldr r1, =__etext
mbed_official 280:a62e2e63cfbd 150 ldr r2, =__data_start__
mbed_official 280:a62e2e63cfbd 151 ldr r3, =__data_end__
mbed_official 280:a62e2e63cfbd 152
mbed_official 280:a62e2e63cfbd 153 .Lflash_to_ram_loop:
mbed_official 280:a62e2e63cfbd 154 cmp r2, r3
mbed_official 280:a62e2e63cfbd 155 ittt lt
mbed_official 280:a62e2e63cfbd 156 ldrlt r0, [r1], #4
mbed_official 280:a62e2e63cfbd 157 strlt r0, [r2], #4
mbed_official 280:a62e2e63cfbd 158 blt .Lflash_to_ram_loop
mbed_official 280:a62e2e63cfbd 159
mbed_official 280:a62e2e63cfbd 160 ldr r0, =SystemInit
mbed_official 280:a62e2e63cfbd 161 blx r0
mbed_official 280:a62e2e63cfbd 162 ldr r0, =_start
mbed_official 280:a62e2e63cfbd 163 bx r0
mbed_official 280:a62e2e63cfbd 164 .pool
mbed_official 280:a62e2e63cfbd 165 .size Reset_Handler, . - Reset_Handler
mbed_official 280:a62e2e63cfbd 166
mbed_official 280:a62e2e63cfbd 167 .text
mbed_official 280:a62e2e63cfbd 168 /* Macro to define default handlers. Default handler
mbed_official 280:a62e2e63cfbd 169 * will be weak symbol and just dead loops. They can be
mbed_official 280:a62e2e63cfbd 170 * overwritten by other handlers */
mbed_official 280:a62e2e63cfbd 171 .macro def_default_handler handler_name
mbed_official 280:a62e2e63cfbd 172 .align 1
mbed_official 280:a62e2e63cfbd 173 .thumb_func
mbed_official 280:a62e2e63cfbd 174 .weak \handler_name
mbed_official 280:a62e2e63cfbd 175 .type \handler_name, %function
mbed_official 280:a62e2e63cfbd 176 \handler_name :
mbed_official 280:a62e2e63cfbd 177 b .
mbed_official 280:a62e2e63cfbd 178 .size \handler_name, . - \handler_name
mbed_official 280:a62e2e63cfbd 179 .endm
mbed_official 280:a62e2e63cfbd 180
mbed_official 280:a62e2e63cfbd 181 def_default_handler NMI_Handler
mbed_official 280:a62e2e63cfbd 182 def_default_handler HardFault_Handler
mbed_official 280:a62e2e63cfbd 183 def_default_handler MemManage_Handler
mbed_official 280:a62e2e63cfbd 184 def_default_handler BusFault_Handler
mbed_official 280:a62e2e63cfbd 185 def_default_handler UsageFault_Handler
mbed_official 280:a62e2e63cfbd 186 def_default_handler SVC_Handler
mbed_official 280:a62e2e63cfbd 187 def_default_handler DebugMon_Handler
mbed_official 280:a62e2e63cfbd 188 def_default_handler PendSV_Handler
mbed_official 280:a62e2e63cfbd 189 def_default_handler SysTick_Handler
mbed_official 280:a62e2e63cfbd 190 def_default_handler Default_Handler
mbed_official 280:a62e2e63cfbd 191
mbed_official 280:a62e2e63cfbd 192 .macro def_irq_default_handler handler_name
mbed_official 280:a62e2e63cfbd 193 .weak \handler_name
mbed_official 280:a62e2e63cfbd 194 .set \handler_name, Default_Handler
mbed_official 280:a62e2e63cfbd 195 .endm
mbed_official 280:a62e2e63cfbd 196
mbed_official 280:a62e2e63cfbd 197 def_irq_default_handler WDT_IRQHandler
mbed_official 280:a62e2e63cfbd 198 def_irq_default_handler BOD_IRQHandler
mbed_official 280:a62e2e63cfbd 199 def_irq_default_handler FMC_IRQHandler
mbed_official 280:a62e2e63cfbd 200 def_irq_default_handler EEPROM_IRQHandler
mbed_official 280:a62e2e63cfbd 201 def_irq_default_handler DMA_IRQHandler
mbed_official 280:a62e2e63cfbd 202 def_irq_default_handler GINT0_IRQHandler
mbed_official 280:a62e2e63cfbd 203 def_irq_default_handler GINT1_IRQHandler
mbed_official 280:a62e2e63cfbd 204 def_irq_default_handler PIN_INT0_IRQHandler
mbed_official 280:a62e2e63cfbd 205 def_irq_default_handler PIN_INT1_IRQHandler
mbed_official 280:a62e2e63cfbd 206 def_irq_default_handler PIN_INT2_IRQHandler
mbed_official 280:a62e2e63cfbd 207 def_irq_default_handler PIN_INT3_IRQHandler
mbed_official 280:a62e2e63cfbd 208 def_irq_default_handler PIN_INT4_IRQHandler
mbed_official 280:a62e2e63cfbd 209 def_irq_default_handler PIN_INT5_IRQHandler
mbed_official 280:a62e2e63cfbd 210 def_irq_default_handler PIN_INT6_IRQHandler
mbed_official 280:a62e2e63cfbd 211 def_irq_default_handler PIN_INT7_IRQHandler
mbed_official 280:a62e2e63cfbd 212 def_irq_default_handler RIT_IRQHandler
mbed_official 280:a62e2e63cfbd 213 def_irq_default_handler SCT0_IRQHandler
mbed_official 280:a62e2e63cfbd 214 def_irq_default_handler SCT1_IRQHandler
mbed_official 280:a62e2e63cfbd 215 def_irq_default_handler SCT2_IRQHandler
mbed_official 280:a62e2e63cfbd 216 def_irq_default_handler SCT3_IRQHandler
mbed_official 280:a62e2e63cfbd 217 def_irq_default_handler MRT_IRQHandler
mbed_official 280:a62e2e63cfbd 218 def_irq_default_handler UART0_IRQHandler
mbed_official 280:a62e2e63cfbd 219 def_irq_default_handler UART1_IRQHandler
mbed_official 280:a62e2e63cfbd 220 def_irq_default_handler UART2_IRQHandler
mbed_official 280:a62e2e63cfbd 221 def_irq_default_handler I2C0_IRQHandler
mbed_official 280:a62e2e63cfbd 222 def_irq_default_handler SPI0_IRQHandler
mbed_official 280:a62e2e63cfbd 223 def_irq_default_handler SPI1_IRQHandler
mbed_official 280:a62e2e63cfbd 224 def_irq_default_handler CAN_IRQHandler
mbed_official 280:a62e2e63cfbd 225 def_irq_default_handler USB_IRQHandler
mbed_official 280:a62e2e63cfbd 226 def_irq_default_handler USB_FIQHandler
mbed_official 280:a62e2e63cfbd 227 def_irq_default_handler USBWakeup_IRQHandler
mbed_official 280:a62e2e63cfbd 228 def_irq_default_handler ADC0A_IRQHandler
mbed_official 280:a62e2e63cfbd 229 def_irq_default_handler ADC0B_IRQHandler
mbed_official 280:a62e2e63cfbd 230 def_irq_default_handler ADC0_THCMP_IRQHandler
mbed_official 280:a62e2e63cfbd 231 def_irq_default_handler ADC0_OVR_IRQHandler
mbed_official 280:a62e2e63cfbd 232 def_irq_default_handler ADC1A_IRQHandler
mbed_official 280:a62e2e63cfbd 233 def_irq_default_handler ADC1B_IRQHandler
mbed_official 280:a62e2e63cfbd 234 def_irq_default_handler ADC1_THCMP_IRQHandler
mbed_official 280:a62e2e63cfbd 235 def_irq_default_handler ADC1_OVR_IRQHandler
mbed_official 280:a62e2e63cfbd 236 def_irq_default_handler DAC_IRQHandler
mbed_official 280:a62e2e63cfbd 237 def_irq_default_handler ACMP0_IRQHandler
mbed_official 280:a62e2e63cfbd 238 def_irq_default_handler ACMP1_IRQHandler
mbed_official 280:a62e2e63cfbd 239 def_irq_default_handler ACMP2_IRQHandler
mbed_official 280:a62e2e63cfbd 240 def_irq_default_handler ACMP3_IRQHandler
mbed_official 280:a62e2e63cfbd 241 def_irq_default_handler QEI_IRQHandler
mbed_official 280:a62e2e63cfbd 242 def_irq_default_handler RTC_ALARM_IRQHandler
mbed_official 280:a62e2e63cfbd 243 def_irq_default_handler RTC_WAKE_IRQHandler
mbed_official 280:a62e2e63cfbd 244 def_irq_default_handler DEF_IRQHandler
mbed_official 280:a62e2e63cfbd 245
mbed_official 280:a62e2e63cfbd 246 .end
mbed_official 280:a62e2e63cfbd 247