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_LPC408X/TOOLCHAIN_GCC_ARM/startup_LPC408x.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 43:c8a187835cf1 1 /* File: startup_ARMCM3.s
mbed_official 43:c8a187835cf1 2 * Purpose: startup file for Cortex-M3/M4 devices. Should use with
mbed_official 43:c8a187835cf1 3 * GNU Tools for ARM Embedded Processors
mbed_official 43:c8a187835cf1 4 * Version: V1.1
mbed_official 43:c8a187835cf1 5 * Date: 17 June 2011
mbed_official 43:c8a187835cf1 6 *
mbed_official 43:c8a187835cf1 7 * Copyright (C) 2011 ARM Limited. All rights reserved.
mbed_official 43:c8a187835cf1 8 * ARM Limited (ARM) is supplying this software for use with Cortex-M3/M4
mbed_official 43:c8a187835cf1 9 * processor based microcontrollers. This file can be freely distributed
mbed_official 43:c8a187835cf1 10 * within development tools that are supporting such ARM based processors.
mbed_official 43:c8a187835cf1 11 *
mbed_official 43:c8a187835cf1 12 * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
mbed_official 43:c8a187835cf1 13 * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
mbed_official 43:c8a187835cf1 14 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
mbed_official 43:c8a187835cf1 15 * ARM SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
mbed_official 43:c8a187835cf1 16 * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
mbed_official 43:c8a187835cf1 17 */
mbed_official 43:c8a187835cf1 18 .syntax unified
mbed_official 43:c8a187835cf1 19 .arch armv7-m
mbed_official 43:c8a187835cf1 20
mbed_official 43:c8a187835cf1 21 /* Memory Model
mbed_official 43:c8a187835cf1 22 The HEAP starts at the end of the DATA section and grows upward.
mbed_official 43:c8a187835cf1 23
mbed_official 43:c8a187835cf1 24 The STACK starts at the end of the RAM and grows downward.
mbed_official 43:c8a187835cf1 25
mbed_official 43:c8a187835cf1 26 The HEAP and stack STACK are only checked at compile time:
mbed_official 43:c8a187835cf1 27 (DATA_SIZE + HEAP_SIZE + STACK_SIZE) < RAM_SIZE
mbed_official 43:c8a187835cf1 28
mbed_official 43:c8a187835cf1 29 This is just a check for the bare minimum for the Heap+Stack area before
mbed_official 43:c8a187835cf1 30 aborting compilation, it is not the run time limit:
mbed_official 43:c8a187835cf1 31 Heap_Size + Stack_Size = 0x80 + 0x80 = 0x100
mbed_official 43:c8a187835cf1 32 */
mbed_official 43:c8a187835cf1 33 .section .stack
mbed_official 43:c8a187835cf1 34 .align 3
mbed_official 43:c8a187835cf1 35 #ifdef __STACK_SIZE
mbed_official 43:c8a187835cf1 36 .equ Stack_Size, __STACK_SIZE
mbed_official 43:c8a187835cf1 37 #else
mbed_official 43:c8a187835cf1 38 .equ Stack_Size, 0xc00
mbed_official 43:c8a187835cf1 39 #endif
mbed_official 43:c8a187835cf1 40 .globl __StackTop
mbed_official 43:c8a187835cf1 41 .globl __StackLimit
mbed_official 43:c8a187835cf1 42 __StackLimit:
mbed_official 43:c8a187835cf1 43 .space Stack_Size
mbed_official 43:c8a187835cf1 44 .size __StackLimit, . - __StackLimit
mbed_official 43:c8a187835cf1 45 __StackTop:
mbed_official 43:c8a187835cf1 46 .size __StackTop, . - __StackTop
mbed_official 43:c8a187835cf1 47
mbed_official 43:c8a187835cf1 48 .section .heap
mbed_official 43:c8a187835cf1 49 .align 3
mbed_official 43:c8a187835cf1 50 #ifdef __HEAP_SIZE
mbed_official 43:c8a187835cf1 51 .equ Heap_Size, __HEAP_SIZE
mbed_official 43:c8a187835cf1 52 #else
mbed_official 43:c8a187835cf1 53 .equ Heap_Size, 0x800
mbed_official 43:c8a187835cf1 54 #endif
mbed_official 43:c8a187835cf1 55 .globl __HeapBase
mbed_official 43:c8a187835cf1 56 .globl __HeapLimit
mbed_official 43:c8a187835cf1 57 __HeapBase:
mbed_official 43:c8a187835cf1 58 .space Heap_Size
mbed_official 43:c8a187835cf1 59 .size __HeapBase, . - __HeapBase
mbed_official 43:c8a187835cf1 60 __HeapLimit:
mbed_official 43:c8a187835cf1 61 .size __HeapLimit, . - __HeapLimit
mbed_official 43:c8a187835cf1 62
mbed_official 43:c8a187835cf1 63 .section .isr_vector
mbed_official 43:c8a187835cf1 64 .align 2
mbed_official 43:c8a187835cf1 65 .globl __isr_vector
mbed_official 43:c8a187835cf1 66 __isr_vector:
mbed_official 43:c8a187835cf1 67 .long __StackTop /* Top of Stack */
mbed_official 43:c8a187835cf1 68 .long Reset_Handler /* Reset Handler */
mbed_official 43:c8a187835cf1 69 .long NMI_Handler /* NMI Handler */
mbed_official 43:c8a187835cf1 70 .long HardFault_Handler /* Hard Fault Handler */
mbed_official 43:c8a187835cf1 71 .long MemManage_Handler /* MPU Fault Handler */
mbed_official 43:c8a187835cf1 72 .long BusFault_Handler /* Bus Fault Handler */
mbed_official 43:c8a187835cf1 73 .long UsageFault_Handler /* Usage Fault Handler */
mbed_official 43:c8a187835cf1 74 .long 0 /* Reserved */
mbed_official 43:c8a187835cf1 75 .long 0 /* Reserved */
mbed_official 43:c8a187835cf1 76 .long 0 /* Reserved */
mbed_official 43:c8a187835cf1 77 .long 0 /* Reserved */
mbed_official 43:c8a187835cf1 78 .long SVC_Handler /* SVCall Handler */
mbed_official 43:c8a187835cf1 79 .long DebugMon_Handler /* Debug Monitor Handler */
mbed_official 43:c8a187835cf1 80 .long 0 /* Reserved */
mbed_official 43:c8a187835cf1 81 .long PendSV_Handler /* PendSV Handler */
mbed_official 43:c8a187835cf1 82 .long SysTick_Handler /* SysTick Handler */
mbed_official 43:c8a187835cf1 83
mbed_official 43:c8a187835cf1 84 /* External interrupts */
mbed_official 43:c8a187835cf1 85 .long WDT_IRQHandler /* 16: Watchdog Timer */
mbed_official 43:c8a187835cf1 86 .long TIMER0_IRQHandler /* 17: Timer0 */
mbed_official 43:c8a187835cf1 87 .long TIMER1_IRQHandler /* 18: Timer1 */
mbed_official 43:c8a187835cf1 88 .long TIMER2_IRQHandler /* 19: Timer2 */
mbed_official 43:c8a187835cf1 89 .long TIMER3_IRQHandler /* 20: Timer3 */
mbed_official 43:c8a187835cf1 90 .long UART0_IRQHandler /* 21: UART0 */
mbed_official 43:c8a187835cf1 91 .long UART1_IRQHandler /* 22: UART1 */
mbed_official 43:c8a187835cf1 92 .long UART2_IRQHandler /* 23: UART2 */
mbed_official 43:c8a187835cf1 93 .long UART3_IRQHandler /* 24: UART3 */
mbed_official 43:c8a187835cf1 94 .long PWM1_IRQHandler /* 25: PWM1 */
mbed_official 43:c8a187835cf1 95 .long I2C0_IRQHandler /* 26: I2C0 */
mbed_official 43:c8a187835cf1 96 .long I2C1_IRQHandler /* 27: I2C1 */
mbed_official 43:c8a187835cf1 97 .long I2C2_IRQHandler /* 28: I2C2 */
mbed_official 43:c8a187835cf1 98 .long 0 /* 29: Reserved */
mbed_official 43:c8a187835cf1 99 .long SSP0_IRQHandler /* 30: SSP0 */
mbed_official 43:c8a187835cf1 100 .long SSP1_IRQHandler /* 31: SSP1 */
mbed_official 43:c8a187835cf1 101 .long PLL0_IRQHandler /* 32: PLL0 Lock (Main PLL) */
mbed_official 43:c8a187835cf1 102 .long RTC_IRQHandler /* 33: Real Time Clock */
mbed_official 43:c8a187835cf1 103 .long EINT0_IRQHandler /* 34: External Interrupt 0 */
mbed_official 43:c8a187835cf1 104 .long EINT1_IRQHandler /* 35: External Interrupt 1 */
mbed_official 43:c8a187835cf1 105 .long EINT2_IRQHandler /* 36: External Interrupt 2 */
mbed_official 43:c8a187835cf1 106 .long EINT3_IRQHandler /* 37: External Interrupt 3 */
mbed_official 43:c8a187835cf1 107 .long ADC_IRQHandler /* 38: A/D Converter */
mbed_official 43:c8a187835cf1 108 .long BOD_IRQHandler /* 39: Brown-Out Detect */
mbed_official 43:c8a187835cf1 109 .long USB_IRQHandler /* 40: USB */
mbed_official 43:c8a187835cf1 110 .long CAN_IRQHandler /* 41: CAN */
mbed_official 43:c8a187835cf1 111 .long DMA_IRQHandler /* 42: General Purpose DMA */
mbed_official 43:c8a187835cf1 112 .long I2S_IRQHandler /* 43: I2S */
mbed_official 43:c8a187835cf1 113 .long ENET_IRQHandler /* 44: Ethernet */
mbed_official 43:c8a187835cf1 114 .long MCI_IRQHandler /* 45: SD/MMC carf I/F */
mbed_official 43:c8a187835cf1 115 .long MCPWM_IRQHandler /* 46: Motor Control PWM */
mbed_official 43:c8a187835cf1 116 .long QEI_IRQHandler /* 47: Quadrature Encoder Interface */
mbed_official 43:c8a187835cf1 117 .long PLL1_IRQHandler /* 48: PLL1 Lock (USB PLL) */
mbed_official 43:c8a187835cf1 118 .long USBActivity_IRQHandler /* 49: USB Activity */
mbed_official 43:c8a187835cf1 119 .long CANActivity_IRQHandler /* 50: CAN Activity */
mbed_official 43:c8a187835cf1 120 .long UART4_IRQHandler /* 51: UART4 */
mbed_official 43:c8a187835cf1 121 .long SSP2_IRQHandler /* 52: SSP2 */
mbed_official 43:c8a187835cf1 122 .long LCD_IRQHandler /* 53: LCD */
mbed_official 43:c8a187835cf1 123 .long GPIO_IRQHandler /* 54: GPIO */
mbed_official 43:c8a187835cf1 124 .long PWM0_IRQHandler /* 55: PWM0 */
mbed_official 43:c8a187835cf1 125 .long EEPROM_IRQHandler /* 56: EEPROM */
mbed_official 43:c8a187835cf1 126
mbed_official 43:c8a187835cf1 127 .size __isr_vector, . - __isr_vector
mbed_official 43:c8a187835cf1 128
mbed_official 43:c8a187835cf1 129 .text
mbed_official 43:c8a187835cf1 130 .thumb
mbed_official 43:c8a187835cf1 131 .thumb_func
mbed_official 43:c8a187835cf1 132 .align 2
mbed_official 43:c8a187835cf1 133 .globl Reset_Handler
mbed_official 43:c8a187835cf1 134 .type Reset_Handler, %function
mbed_official 43:c8a187835cf1 135 Reset_Handler:
mbed_official 43:c8a187835cf1 136 /* Loop to copy data from read only memory to RAM. The ranges
mbed_official 43:c8a187835cf1 137 * of copy from/to are specified by following symbols evaluated in
mbed_official 43:c8a187835cf1 138 * linker script.
mbed_official 43:c8a187835cf1 139 * _etext: End of code section, i.e., begin of data sections to copy from.
mbed_official 43:c8a187835cf1 140 * __data_start__/__data_end__: RAM address range that data should be
mbed_official 43:c8a187835cf1 141 * copied to. Both must be aligned to 4 bytes boundary. */
mbed_official 43:c8a187835cf1 142
mbed_official 43:c8a187835cf1 143 ldr r1, =__etext
mbed_official 43:c8a187835cf1 144 ldr r2, =__data_start__
mbed_official 43:c8a187835cf1 145 ldr r3, =__data_end__
mbed_official 43:c8a187835cf1 146
mbed_official 66:64ad953ee6c3 147 .Lflash_to_ram_loop:
mbed_official 43:c8a187835cf1 148 cmp r2, r3
mbed_official 43:c8a187835cf1 149 ittt lt
mbed_official 43:c8a187835cf1 150 ldrlt r0, [r1], #4
mbed_official 43:c8a187835cf1 151 strlt r0, [r2], #4
mbed_official 66:64ad953ee6c3 152 blt .Lflash_to_ram_loop
mbed_official 43:c8a187835cf1 153
mbed_official 43:c8a187835cf1 154 ldr r0, =SystemInit
mbed_official 43:c8a187835cf1 155 blx r0
mbed_official 43:c8a187835cf1 156 ldr r0, =_start
mbed_official 43:c8a187835cf1 157 bx r0
mbed_official 43:c8a187835cf1 158 .pool
mbed_official 43:c8a187835cf1 159 .size Reset_Handler, . - Reset_Handler
mbed_official 43:c8a187835cf1 160
mbed_official 66:64ad953ee6c3 161 .text
mbed_official 43:c8a187835cf1 162 /* Macro to define default handlers. Default handler
mbed_official 43:c8a187835cf1 163 * will be weak symbol and just dead loops. They can be
mbed_official 43:c8a187835cf1 164 * overwritten by other handlers */
mbed_official 43:c8a187835cf1 165 .macro def_default_handler handler_name
mbed_official 43:c8a187835cf1 166 .align 1
mbed_official 43:c8a187835cf1 167 .thumb_func
mbed_official 43:c8a187835cf1 168 .weak \handler_name
mbed_official 43:c8a187835cf1 169 .type \handler_name, %function
mbed_official 43:c8a187835cf1 170 \handler_name :
mbed_official 43:c8a187835cf1 171 b .
mbed_official 43:c8a187835cf1 172 .size \handler_name, . - \handler_name
mbed_official 43:c8a187835cf1 173 .endm
mbed_official 66:64ad953ee6c3 174
mbed_official 43:c8a187835cf1 175 def_default_handler NMI_Handler
mbed_official 43:c8a187835cf1 176 def_default_handler HardFault_Handler
mbed_official 43:c8a187835cf1 177 def_default_handler MemManage_Handler
mbed_official 43:c8a187835cf1 178 def_default_handler BusFault_Handler
mbed_official 43:c8a187835cf1 179 def_default_handler UsageFault_Handler
mbed_official 43:c8a187835cf1 180 def_default_handler SVC_Handler
mbed_official 43:c8a187835cf1 181 def_default_handler DebugMon_Handler
mbed_official 43:c8a187835cf1 182 def_default_handler PendSV_Handler
mbed_official 43:c8a187835cf1 183 def_default_handler SysTick_Handler
mbed_official 43:c8a187835cf1 184 def_default_handler Default_Handler
mbed_official 66:64ad953ee6c3 185
mbed_official 66:64ad953ee6c3 186 .macro def_irq_default_handler handler_name
mbed_official 66:64ad953ee6c3 187 .weak \handler_name
mbed_official 66:64ad953ee6c3 188 .set \handler_name, Default_Handler
mbed_official 66:64ad953ee6c3 189 .endm
mbed_official 43:c8a187835cf1 190
mbed_official 66:64ad953ee6c3 191 def_irq_default_handler WDT_IRQHandler
mbed_official 66:64ad953ee6c3 192 def_irq_default_handler TIMER0_IRQHandler
mbed_official 66:64ad953ee6c3 193 def_irq_default_handler TIMER1_IRQHandler
mbed_official 66:64ad953ee6c3 194 def_irq_default_handler TIMER2_IRQHandler
mbed_official 66:64ad953ee6c3 195 def_irq_default_handler TIMER3_IRQHandler
mbed_official 66:64ad953ee6c3 196 def_irq_default_handler UART0_IRQHandler
mbed_official 66:64ad953ee6c3 197 def_irq_default_handler UART1_IRQHandler
mbed_official 66:64ad953ee6c3 198 def_irq_default_handler UART2_IRQHandler
mbed_official 66:64ad953ee6c3 199 def_irq_default_handler UART3_IRQHandler
mbed_official 66:64ad953ee6c3 200 def_irq_default_handler PWM1_IRQHandler
mbed_official 66:64ad953ee6c3 201 def_irq_default_handler I2C0_IRQHandler
mbed_official 66:64ad953ee6c3 202 def_irq_default_handler I2C1_IRQHandler
mbed_official 66:64ad953ee6c3 203 def_irq_default_handler I2C2_IRQHandler
mbed_official 66:64ad953ee6c3 204 /* def_irq_default_handler SPI_IRQHandler */
mbed_official 66:64ad953ee6c3 205 def_irq_default_handler SSP0_IRQHandler
mbed_official 66:64ad953ee6c3 206 def_irq_default_handler SSP1_IRQHandler
mbed_official 66:64ad953ee6c3 207 def_irq_default_handler PLL0_IRQHandler
mbed_official 66:64ad953ee6c3 208 def_irq_default_handler RTC_IRQHandler
mbed_official 66:64ad953ee6c3 209 def_irq_default_handler EINT0_IRQHandler
mbed_official 66:64ad953ee6c3 210 def_irq_default_handler EINT1_IRQHandler
mbed_official 66:64ad953ee6c3 211 def_irq_default_handler EINT2_IRQHandler
mbed_official 66:64ad953ee6c3 212 def_irq_default_handler EINT3_IRQHandler
mbed_official 66:64ad953ee6c3 213 def_irq_default_handler ADC_IRQHandler
mbed_official 66:64ad953ee6c3 214 def_irq_default_handler BOD_IRQHandler
mbed_official 66:64ad953ee6c3 215 def_irq_default_handler USB_IRQHandler
mbed_official 66:64ad953ee6c3 216 def_irq_default_handler CAN_IRQHandler
mbed_official 66:64ad953ee6c3 217 def_irq_default_handler DMA_IRQHandler
mbed_official 66:64ad953ee6c3 218 def_irq_default_handler I2S_IRQHandler
mbed_official 66:64ad953ee6c3 219 def_irq_default_handler ENET_IRQHandler
mbed_official 66:64ad953ee6c3 220 def_irq_default_handler MCI_IRQHandler
mbed_official 66:64ad953ee6c3 221 def_irq_default_handler MCPWM_IRQHandler
mbed_official 66:64ad953ee6c3 222 def_irq_default_handler QEI_IRQHandler
mbed_official 66:64ad953ee6c3 223 def_irq_default_handler PLL1_IRQHandler
mbed_official 66:64ad953ee6c3 224 def_irq_default_handler USBActivity_IRQHandler
mbed_official 66:64ad953ee6c3 225 def_irq_default_handler CANActivity_IRQHandler
mbed_official 66:64ad953ee6c3 226 def_irq_default_handler UART4_IRQHandler
mbed_official 66:64ad953ee6c3 227 def_irq_default_handler SSP2_IRQHandler
mbed_official 66:64ad953ee6c3 228 def_irq_default_handler LCD_IRQHandler
mbed_official 66:64ad953ee6c3 229 def_irq_default_handler GPIO_IRQHandler
mbed_official 66:64ad953ee6c3 230 def_irq_default_handler PWM0_IRQHandler
mbed_official 66:64ad953ee6c3 231 def_irq_default_handler EEPROM_IRQHandler
mbed_official 66:64ad953ee6c3 232 def_irq_default_handler DEF_IRQHandler
mbed_official 43:c8a187835cf1 233
mbed_official 43:c8a187835cf1 234 .end
mbed_official 43:c8a187835cf1 235