![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
forkd
Fork of LG2 by
host/Source/CMSIS/CM3/DeviceSupport/NXP/LPC17xx/startup/gcc/startup_LPC17xx.s@23:12e6183f04d4, 2016-02-03 (annotated)
- Committer:
- Kovalev_D
- Date:
- Wed Feb 03 10:44:42 2016 +0300
- Revision:
- 23:12e6183f04d4
[thyz
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Kovalev_D |
23:12e6183f04d4 | 1 | /*****************************************************************************/ |
Kovalev_D |
23:12e6183f04d4 | 2 | /* startup_LPC17xx.s: Startup file for LPC17xx device series */ |
Kovalev_D |
23:12e6183f04d4 | 3 | /*****************************************************************************/ |
Kovalev_D |
23:12e6183f04d4 | 4 | /* Version: CodeSourcery Sourcery G++ Lite (with CS3) */ |
Kovalev_D |
23:12e6183f04d4 | 5 | /*****************************************************************************/ |
Kovalev_D |
23:12e6183f04d4 | 6 | |
Kovalev_D |
23:12e6183f04d4 | 7 | |
Kovalev_D |
23:12e6183f04d4 | 8 | /* |
Kovalev_D |
23:12e6183f04d4 | 9 | //*** <<< Use Configuration Wizard in Context Menu >>> *** |
Kovalev_D |
23:12e6183f04d4 | 10 | */ |
Kovalev_D |
23:12e6183f04d4 | 11 | |
Kovalev_D |
23:12e6183f04d4 | 12 | |
Kovalev_D |
23:12e6183f04d4 | 13 | /* |
Kovalev_D |
23:12e6183f04d4 | 14 | // <h> Stack Configuration |
Kovalev_D |
23:12e6183f04d4 | 15 | // <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> |
Kovalev_D |
23:12e6183f04d4 | 16 | // </h> |
Kovalev_D |
23:12e6183f04d4 | 17 | */ |
Kovalev_D |
23:12e6183f04d4 | 18 | |
Kovalev_D |
23:12e6183f04d4 | 19 | .equ Stack_Size, 0x00000100 |
Kovalev_D |
23:12e6183f04d4 | 20 | .section ".stack", "w" |
Kovalev_D |
23:12e6183f04d4 | 21 | .align 3 |
Kovalev_D |
23:12e6183f04d4 | 22 | .globl __cs3_stack_mem |
Kovalev_D |
23:12e6183f04d4 | 23 | .globl __cs3_stack_size |
Kovalev_D |
23:12e6183f04d4 | 24 | __cs3_stack_mem: |
Kovalev_D |
23:12e6183f04d4 | 25 | .if Stack_Size |
Kovalev_D |
23:12e6183f04d4 | 26 | .space Stack_Size |
Kovalev_D |
23:12e6183f04d4 | 27 | .endif |
Kovalev_D |
23:12e6183f04d4 | 28 | .size __cs3_stack_mem, . - __cs3_stack_mem |
Kovalev_D |
23:12e6183f04d4 | 29 | .set __cs3_stack_size, . - __cs3_stack_mem |
Kovalev_D |
23:12e6183f04d4 | 30 | |
Kovalev_D |
23:12e6183f04d4 | 31 | |
Kovalev_D |
23:12e6183f04d4 | 32 | /* |
Kovalev_D |
23:12e6183f04d4 | 33 | // <h> Heap Configuration |
Kovalev_D |
23:12e6183f04d4 | 34 | // <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> |
Kovalev_D |
23:12e6183f04d4 | 35 | // </h> |
Kovalev_D |
23:12e6183f04d4 | 36 | */ |
Kovalev_D |
23:12e6183f04d4 | 37 | |
Kovalev_D |
23:12e6183f04d4 | 38 | .equ Heap_Size, 0x00001000 |
Kovalev_D |
23:12e6183f04d4 | 39 | |
Kovalev_D |
23:12e6183f04d4 | 40 | .section ".heap", "w" |
Kovalev_D |
23:12e6183f04d4 | 41 | .align 3 |
Kovalev_D |
23:12e6183f04d4 | 42 | .globl __cs3_heap_start |
Kovalev_D |
23:12e6183f04d4 | 43 | .globl __cs3_heap_end |
Kovalev_D |
23:12e6183f04d4 | 44 | __cs3_heap_start: |
Kovalev_D |
23:12e6183f04d4 | 45 | .if Heap_Size |
Kovalev_D |
23:12e6183f04d4 | 46 | .space Heap_Size |
Kovalev_D |
23:12e6183f04d4 | 47 | .endif |
Kovalev_D |
23:12e6183f04d4 | 48 | __cs3_heap_end: |
Kovalev_D |
23:12e6183f04d4 | 49 | |
Kovalev_D |
23:12e6183f04d4 | 50 | |
Kovalev_D |
23:12e6183f04d4 | 51 | /* Vector Table */ |
Kovalev_D |
23:12e6183f04d4 | 52 | |
Kovalev_D |
23:12e6183f04d4 | 53 | .section ".cs3.interrupt_vector" |
Kovalev_D |
23:12e6183f04d4 | 54 | .globl __cs3_interrupt_vector_cortex_m |
Kovalev_D |
23:12e6183f04d4 | 55 | .type __cs3_interrupt_vector_cortex_m, %object |
Kovalev_D |
23:12e6183f04d4 | 56 | |
Kovalev_D |
23:12e6183f04d4 | 57 | __cs3_interrupt_vector_cortex_m: |
Kovalev_D |
23:12e6183f04d4 | 58 | .long __cs3_stack /* Top of Stack */ |
Kovalev_D |
23:12e6183f04d4 | 59 | .long __cs3_reset /* Reset Handler */ |
Kovalev_D |
23:12e6183f04d4 | 60 | .long NMI_Handler /* NMI Handler */ |
Kovalev_D |
23:12e6183f04d4 | 61 | .long HardFault_Handler /* Hard Fault Handler */ |
Kovalev_D |
23:12e6183f04d4 | 62 | .long MemManage_Handler /* MPU Fault Handler */ |
Kovalev_D |
23:12e6183f04d4 | 63 | .long BusFault_Handler /* Bus Fault Handler */ |
Kovalev_D |
23:12e6183f04d4 | 64 | .long UsageFault_Handler /* Usage Fault Handler */ |
Kovalev_D |
23:12e6183f04d4 | 65 | .long 0 /* Reserved */ |
Kovalev_D |
23:12e6183f04d4 | 66 | .long 0 /* Reserved */ |
Kovalev_D |
23:12e6183f04d4 | 67 | .long 0 /* Reserved */ |
Kovalev_D |
23:12e6183f04d4 | 68 | .long 0 /* Reserved */ |
Kovalev_D |
23:12e6183f04d4 | 69 | .long SVC_Handler /* SVCall Handler */ |
Kovalev_D |
23:12e6183f04d4 | 70 | .long DebugMon_Handler /* Debug Monitor Handler */ |
Kovalev_D |
23:12e6183f04d4 | 71 | .long 0 /* Reserved */ |
Kovalev_D |
23:12e6183f04d4 | 72 | .long PendSV_Handler /* PendSV Handler */ |
Kovalev_D |
23:12e6183f04d4 | 73 | .long SysTick_Handler /* SysTick Handler */ |
Kovalev_D |
23:12e6183f04d4 | 74 | |
Kovalev_D |
23:12e6183f04d4 | 75 | /* External Interrupts */ |
Kovalev_D |
23:12e6183f04d4 | 76 | .long WDT_IRQHandler /* 16: Watchdog Timer */ |
Kovalev_D |
23:12e6183f04d4 | 77 | .long TIMER0_IRQHandler /* 17: Timer0 */ |
Kovalev_D |
23:12e6183f04d4 | 78 | .long TIMER1_IRQHandler /* 18: Timer1 */ |
Kovalev_D |
23:12e6183f04d4 | 79 | .long TIMER2_IRQHandler /* 19: Timer2 */ |
Kovalev_D |
23:12e6183f04d4 | 80 | .long TIMER3_IRQHandler /* 20: Timer3 */ |
Kovalev_D |
23:12e6183f04d4 | 81 | .long UART0_IRQHandler /* 21: UART0 */ |
Kovalev_D |
23:12e6183f04d4 | 82 | .long UART1_IRQHandler /* 22: UART1 */ |
Kovalev_D |
23:12e6183f04d4 | 83 | .long UART2_IRQHandler /* 23: UART2 */ |
Kovalev_D |
23:12e6183f04d4 | 84 | .long UART3_IRQHandler /* 24: UART3 */ |
Kovalev_D |
23:12e6183f04d4 | 85 | .long PWM1_IRQHandler /* 25: PWM1 */ |
Kovalev_D |
23:12e6183f04d4 | 86 | .long I2C0_IRQHandler /* 26: I2C0 */ |
Kovalev_D |
23:12e6183f04d4 | 87 | .long I2C1_IRQHandler /* 27: I2C1 */ |
Kovalev_D |
23:12e6183f04d4 | 88 | .long I2C2_IRQHandler /* 28: I2C2 */ |
Kovalev_D |
23:12e6183f04d4 | 89 | .long SPI_IRQHandler /* 29: SPI */ |
Kovalev_D |
23:12e6183f04d4 | 90 | .long SSP0_IRQHandler /* 30: SSP0 */ |
Kovalev_D |
23:12e6183f04d4 | 91 | .long SSP1_IRQHandler /* 31: SSP1 */ |
Kovalev_D |
23:12e6183f04d4 | 92 | .long PLL0_IRQHandler /* 32: PLL0 Lock (Main PLL) */ |
Kovalev_D |
23:12e6183f04d4 | 93 | .long RTC_IRQHandler /* 33: Real Time Clock */ |
Kovalev_D |
23:12e6183f04d4 | 94 | .long EINT0_IRQHandler /* 34: External Interrupt 0 */ |
Kovalev_D |
23:12e6183f04d4 | 95 | .long EINT1_IRQHandler /* 35: External Interrupt 1 */ |
Kovalev_D |
23:12e6183f04d4 | 96 | .long EINT2_IRQHandler /* 36: External Interrupt 2 */ |
Kovalev_D |
23:12e6183f04d4 | 97 | .long EINT3_IRQHandler /* 37: External Interrupt 3 */ |
Kovalev_D |
23:12e6183f04d4 | 98 | .long ADC_IRQHandler /* 38: A/D Converter */ |
Kovalev_D |
23:12e6183f04d4 | 99 | .long BOD_IRQHandler /* 39: Brown-Out Detect */ |
Kovalev_D |
23:12e6183f04d4 | 100 | .long USB_IRQHandler /* 40: USB */ |
Kovalev_D |
23:12e6183f04d4 | 101 | .long CAN_IRQHandler /* 41: CAN */ |
Kovalev_D |
23:12e6183f04d4 | 102 | .long DMA_IRQHandler /* 42: General Purpose DMA */ |
Kovalev_D |
23:12e6183f04d4 | 103 | .long I2S_IRQHandler /* 43: I2S */ |
Kovalev_D |
23:12e6183f04d4 | 104 | .long ENET_IRQHandler /* 44: Ethernet */ |
Kovalev_D |
23:12e6183f04d4 | 105 | .long RIT_IRQHandler /* 45: Repetitive Interrupt Timer */ |
Kovalev_D |
23:12e6183f04d4 | 106 | .long MCPWM_IRQHandler /* 46: Motor Control PWM */ |
Kovalev_D |
23:12e6183f04d4 | 107 | .long QEI_IRQHandler /* 47: Quadrature Encoder Interface */ |
Kovalev_D |
23:12e6183f04d4 | 108 | .long PLL1_IRQHandler /* 48: PLL1 Lock (USB PLL) */ |
Kovalev_D |
23:12e6183f04d4 | 109 | |
Kovalev_D |
23:12e6183f04d4 | 110 | .size __cs3_interrupt_vector_cortex_m, . - __cs3_interrupt_vector_cortex_m |
Kovalev_D |
23:12e6183f04d4 | 111 | |
Kovalev_D |
23:12e6183f04d4 | 112 | |
Kovalev_D |
23:12e6183f04d4 | 113 | .thumb |
Kovalev_D |
23:12e6183f04d4 | 114 | |
Kovalev_D |
23:12e6183f04d4 | 115 | |
Kovalev_D |
23:12e6183f04d4 | 116 | /* Reset Handler */ |
Kovalev_D |
23:12e6183f04d4 | 117 | |
Kovalev_D |
23:12e6183f04d4 | 118 | .section .cs3.reset,"x",%progbits |
Kovalev_D |
23:12e6183f04d4 | 119 | .thumb_func |
Kovalev_D |
23:12e6183f04d4 | 120 | .globl __cs3_reset_cortex_m |
Kovalev_D |
23:12e6183f04d4 | 121 | .type __cs3_reset_cortex_m, %function |
Kovalev_D |
23:12e6183f04d4 | 122 | __cs3_reset_cortex_m: |
Kovalev_D |
23:12e6183f04d4 | 123 | .fnstart |
Kovalev_D |
23:12e6183f04d4 | 124 | LDR R0, =SystemInit |
Kovalev_D |
23:12e6183f04d4 | 125 | BLX R0 |
Kovalev_D |
23:12e6183f04d4 | 126 | LDR R0,=_start |
Kovalev_D |
23:12e6183f04d4 | 127 | BX R0 |
Kovalev_D |
23:12e6183f04d4 | 128 | .pool |
Kovalev_D |
23:12e6183f04d4 | 129 | .cantunwind |
Kovalev_D |
23:12e6183f04d4 | 130 | .fnend |
Kovalev_D |
23:12e6183f04d4 | 131 | .size __cs3_reset_cortex_m,.-__cs3_reset_cortex_m |
Kovalev_D |
23:12e6183f04d4 | 132 | |
Kovalev_D |
23:12e6183f04d4 | 133 | .section ".text" |
Kovalev_D |
23:12e6183f04d4 | 134 | |
Kovalev_D |
23:12e6183f04d4 | 135 | /* Exception Handlers */ |
Kovalev_D |
23:12e6183f04d4 | 136 | |
Kovalev_D |
23:12e6183f04d4 | 137 | .weak NMI_Handler |
Kovalev_D |
23:12e6183f04d4 | 138 | .type NMI_Handler, %function |
Kovalev_D |
23:12e6183f04d4 | 139 | NMI_Handler: |
Kovalev_D |
23:12e6183f04d4 | 140 | B . |
Kovalev_D |
23:12e6183f04d4 | 141 | .size NMI_Handler, . - NMI_Handler |
Kovalev_D |
23:12e6183f04d4 | 142 | |
Kovalev_D |
23:12e6183f04d4 | 143 | .weak HardFault_Handler |
Kovalev_D |
23:12e6183f04d4 | 144 | .type HardFault_Handler, %function |
Kovalev_D |
23:12e6183f04d4 | 145 | HardFault_Handler: |
Kovalev_D |
23:12e6183f04d4 | 146 | B . |
Kovalev_D |
23:12e6183f04d4 | 147 | .size HardFault_Handler, . - HardFault_Handler |
Kovalev_D |
23:12e6183f04d4 | 148 | |
Kovalev_D |
23:12e6183f04d4 | 149 | .weak MemManage_Handler |
Kovalev_D |
23:12e6183f04d4 | 150 | .type MemManage_Handler, %function |
Kovalev_D |
23:12e6183f04d4 | 151 | MemManage_Handler: |
Kovalev_D |
23:12e6183f04d4 | 152 | B . |
Kovalev_D |
23:12e6183f04d4 | 153 | .size MemManage_Handler, . - MemManage_Handler |
Kovalev_D |
23:12e6183f04d4 | 154 | |
Kovalev_D |
23:12e6183f04d4 | 155 | .weak BusFault_Handler |
Kovalev_D |
23:12e6183f04d4 | 156 | .type BusFault_Handler, %function |
Kovalev_D |
23:12e6183f04d4 | 157 | BusFault_Handler: |
Kovalev_D |
23:12e6183f04d4 | 158 | B . |
Kovalev_D |
23:12e6183f04d4 | 159 | .size BusFault_Handler, . - BusFault_Handler |
Kovalev_D |
23:12e6183f04d4 | 160 | |
Kovalev_D |
23:12e6183f04d4 | 161 | .weak UsageFault_Handler |
Kovalev_D |
23:12e6183f04d4 | 162 | .type UsageFault_Handler, %function |
Kovalev_D |
23:12e6183f04d4 | 163 | UsageFault_Handler: |
Kovalev_D |
23:12e6183f04d4 | 164 | B . |
Kovalev_D |
23:12e6183f04d4 | 165 | .size UsageFault_Handler, . - UsageFault_Handler |
Kovalev_D |
23:12e6183f04d4 | 166 | |
Kovalev_D |
23:12e6183f04d4 | 167 | .weak SVC_Handler |
Kovalev_D |
23:12e6183f04d4 | 168 | .type SVC_Handler, %function |
Kovalev_D |
23:12e6183f04d4 | 169 | SVC_Handler: |
Kovalev_D |
23:12e6183f04d4 | 170 | B . |
Kovalev_D |
23:12e6183f04d4 | 171 | .size SVC_Handler, . - SVC_Handler |
Kovalev_D |
23:12e6183f04d4 | 172 | |
Kovalev_D |
23:12e6183f04d4 | 173 | .weak DebugMon_Handler |
Kovalev_D |
23:12e6183f04d4 | 174 | .type DebugMon_Handler, %function |
Kovalev_D |
23:12e6183f04d4 | 175 | DebugMon_Handler: |
Kovalev_D |
23:12e6183f04d4 | 176 | B . |
Kovalev_D |
23:12e6183f04d4 | 177 | .size DebugMon_Handler, . - DebugMon_Handler |
Kovalev_D |
23:12e6183f04d4 | 178 | |
Kovalev_D |
23:12e6183f04d4 | 179 | .weak PendSV_Handler |
Kovalev_D |
23:12e6183f04d4 | 180 | .type PendSV_Handler, %function |
Kovalev_D |
23:12e6183f04d4 | 181 | PendSV_Handler: |
Kovalev_D |
23:12e6183f04d4 | 182 | B . |
Kovalev_D |
23:12e6183f04d4 | 183 | .size PendSV_Handler, . - PendSV_Handler |
Kovalev_D |
23:12e6183f04d4 | 184 | |
Kovalev_D |
23:12e6183f04d4 | 185 | .weak SysTick_Handler |
Kovalev_D |
23:12e6183f04d4 | 186 | .type SysTick_Handler, %function |
Kovalev_D |
23:12e6183f04d4 | 187 | SysTick_Handler: |
Kovalev_D |
23:12e6183f04d4 | 188 | B . |
Kovalev_D |
23:12e6183f04d4 | 189 | .size SysTick_Handler, . - SysTick_Handler |
Kovalev_D |
23:12e6183f04d4 | 190 | |
Kovalev_D |
23:12e6183f04d4 | 191 | |
Kovalev_D |
23:12e6183f04d4 | 192 | /* IRQ Handlers */ |
Kovalev_D |
23:12e6183f04d4 | 193 | |
Kovalev_D |
23:12e6183f04d4 | 194 | .globl Default_Handler |
Kovalev_D |
23:12e6183f04d4 | 195 | .type Default_Handler, %function |
Kovalev_D |
23:12e6183f04d4 | 196 | Default_Handler: |
Kovalev_D |
23:12e6183f04d4 | 197 | B . |
Kovalev_D |
23:12e6183f04d4 | 198 | .size Default_Handler, . - Default_Handler |
Kovalev_D |
23:12e6183f04d4 | 199 | |
Kovalev_D |
23:12e6183f04d4 | 200 | .macro IRQ handler |
Kovalev_D |
23:12e6183f04d4 | 201 | .weak \handler |
Kovalev_D |
23:12e6183f04d4 | 202 | .set \handler, Default_Handler |
Kovalev_D |
23:12e6183f04d4 | 203 | .endm |
Kovalev_D |
23:12e6183f04d4 | 204 | |
Kovalev_D |
23:12e6183f04d4 | 205 | IRQ WDT_IRQHandler |
Kovalev_D |
23:12e6183f04d4 | 206 | IRQ TIMER0_IRQHandler |
Kovalev_D |
23:12e6183f04d4 | 207 | IRQ TIMER1_IRQHandler |
Kovalev_D |
23:12e6183f04d4 | 208 | IRQ TIMER2_IRQHandler |
Kovalev_D |
23:12e6183f04d4 | 209 | IRQ TIMER3_IRQHandler |
Kovalev_D |
23:12e6183f04d4 | 210 | IRQ UART0_IRQHandler |
Kovalev_D |
23:12e6183f04d4 | 211 | IRQ UART1_IRQHandler |
Kovalev_D |
23:12e6183f04d4 | 212 | IRQ UART2_IRQHandler |
Kovalev_D |
23:12e6183f04d4 | 213 | IRQ UART3_IRQHandler |
Kovalev_D |
23:12e6183f04d4 | 214 | IRQ PWM1_IRQHandler |
Kovalev_D |
23:12e6183f04d4 | 215 | IRQ I2C0_IRQHandler |
Kovalev_D |
23:12e6183f04d4 | 216 | IRQ I2C1_IRQHandler |
Kovalev_D |
23:12e6183f04d4 | 217 | IRQ I2C2_IRQHandler |
Kovalev_D |
23:12e6183f04d4 | 218 | IRQ SPI_IRQHandler |
Kovalev_D |
23:12e6183f04d4 | 219 | IRQ SSP0_IRQHandler |
Kovalev_D |
23:12e6183f04d4 | 220 | IRQ SSP1_IRQHandler |
Kovalev_D |
23:12e6183f04d4 | 221 | IRQ PLL0_IRQHandler |
Kovalev_D |
23:12e6183f04d4 | 222 | IRQ RTC_IRQHandler |
Kovalev_D |
23:12e6183f04d4 | 223 | IRQ EINT0_IRQHandler |
Kovalev_D |
23:12e6183f04d4 | 224 | IRQ EINT1_IRQHandler |
Kovalev_D |
23:12e6183f04d4 | 225 | IRQ EINT2_IRQHandler |
Kovalev_D |
23:12e6183f04d4 | 226 | IRQ EINT3_IRQHandler |
Kovalev_D |
23:12e6183f04d4 | 227 | IRQ ADC_IRQHandler |
Kovalev_D |
23:12e6183f04d4 | 228 | IRQ BOD_IRQHandler |
Kovalev_D |
23:12e6183f04d4 | 229 | IRQ USB_IRQHandler |
Kovalev_D |
23:12e6183f04d4 | 230 | IRQ CAN_IRQHandler |
Kovalev_D |
23:12e6183f04d4 | 231 | IRQ DMA_IRQHandler |
Kovalev_D |
23:12e6183f04d4 | 232 | IRQ I2S_IRQHandler |
Kovalev_D |
23:12e6183f04d4 | 233 | IRQ ENET_IRQHandler |
Kovalev_D |
23:12e6183f04d4 | 234 | IRQ RIT_IRQHandler |
Kovalev_D |
23:12e6183f04d4 | 235 | IRQ MCPWM_IRQHandler |
Kovalev_D |
23:12e6183f04d4 | 236 | IRQ QEI_IRQHandler |
Kovalev_D |
23:12e6183f04d4 | 237 | IRQ PLL1_IRQHandler |
Kovalev_D |
23:12e6183f04d4 | 238 | |
Kovalev_D |
23:12e6183f04d4 | 239 | .end |