]> git.donarmstrong.com Git - qmk_firmware.git/blob - tool/mbed/mbed-sdk/libraries/mbed/targets/cmsis/TARGET_NXP/TARGET_LPC43XX/TOOLCHAIN_IAR/startup_LPC43xx.s
Squashed 'tmk_core/' changes from 7967731..b9e0ea0
[qmk_firmware.git] / tool / mbed / mbed-sdk / libraries / mbed / targets / cmsis / TARGET_NXP / TARGET_LPC43XX / TOOLCHAIN_IAR / startup_LPC43xx.s
1 /**************************************************
2  *
3  * Part one of the system initialization code, contains low-level
4  * initialization, plain thumb variant.
5  *
6  * Copyright 2011 IAR Systems. All rights reserved.
7  *
8  * $Revision: 47876 $
9  *
10  **************************************************/
11
12 ;
13 ; The modules in this file are included in the libraries, and may be replaced
14 ; by any user-defined modules that define the PUBLIC symbol _program_start or
15 ; a user defined start symbol.
16 ; To override the cstartup defined in the library, simply add your modified
17 ; version to the workbench project.
18 ;
19 ; The vector table is normally located at address 0.
20 ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6.
21 ; The name "__vector_table" has special meaning for C-SPY:
22 ; it is where the SP start value is found, and the NVIC vector
23 ; table register (VTOR) is initialized to this address if != 0.
24 ;
25 ; Cortex-M version
26 ;
27
28
29         MODULE  ?cstartup
30
31         ;; Forward declaration of sections.
32         SECTION CSTACK:DATA:NOROOT(3)
33
34         SECTION .intvec:CODE:NOROOT(2)
35
36         EXTERN  __iar_program_start 
37         EXTERN  SystemInit        
38         PUBLIC  __vector_table
39         PUBLIC  __vector_table_0x1c
40         PUBLIC  __Vectors
41         PUBLIC  __Vectors_End
42         PUBLIC  __Vectors_Size
43
44         DATA
45
46 __vector_table
47         DCD     sfe(CSTACK)
48         DCD     Reset_Handler
49         DCD     NMI_Handler
50         DCD     HardFault_Handler
51         DCD     MemManage_Handler
52         DCD     BusFault_Handler
53         DCD     UsageFault_Handler
54 __vector_table_0x1c
55         DCD     0
56         DCD     0
57         DCD     0
58         DCD     0
59         DCD     SVC_Handler
60         DCD     DebugMon_Handler
61         DCD     0
62         DCD     PendSV_Handler
63         DCD     SysTick_Handler
64
65         ; External Interrupts
66         DCD             DAC_IRQHandler                          ; 16 D/A Converter
67         DCD             MX_CORE_IRQHandler          ; 17 CortexM0 (LPC43XX ONLY) 
68         DCD             DMA_IRQHandler                          ; 18 General Purpose DMA
69         DCD             0                                           ; 19 Reserved
70         DCD             FLASHEEPROM_IRQHandler          ; 20 ORed flash bank A, flash bank B, EEPROM interrupts
71         DCD             ETH_IRQHandler                          ; 21 Ethernet
72         DCD             SDIO_IRQHandler                         ; 22 SD/MMC
73         DCD             LCD_IRQHandler                          ; 23 LCD
74         DCD             USB0_IRQHandler                         ; 24 USB0
75         DCD             USB1_IRQHandler                         ; 25 USB1
76         DCD             SCT_IRQHandler                          ; 26 State Configurable Timer
77         DCD             RIT_IRQHandler                          ; 27 Repetitive Interrupt Timer
78         DCD             TIMER0_IRQHandler                       ; 28 Timer0
79         DCD             TIMER1_IRQHandler                       ; 29 Timer1
80         DCD             TIMER2_IRQHandler                       ; 30 Timer2
81         DCD             TIMER3_IRQHandler                       ; 31 Timer3
82         DCD             MCPWM_IRQHandler                        ; 32 Motor Control PWM
83         DCD             ADC0_IRQHandler                         ; 33 A/D Converter 0
84         DCD             I2C0_IRQHandler                         ; 34 I2C0
85         DCD             I2C1_IRQHandler                         ; 35 I2C1
86         DCD             SPI_IRQHandler                          ; 36 SPI (LPC43XX ONLY)
87         DCD             ADC1_IRQHandler                         ; 37 A/D Converter 1
88         DCD             SSP0_IRQHandler                         ; 38 SSP0
89         DCD             SSP1_IRQHandler                         ; 39 SSP1
90         DCD             UART0_IRQHandler                        ; 40 UART0
91         DCD             UART1_IRQHandler                        ; 41 UART1
92         DCD             UART2_IRQHandler                        ; 42 UART2
93         DCD             UART3_IRQHandler                        ; 43 UART3
94         DCD             I2S0_IRQHandler                         ; 44 I2S0
95         DCD             I2S1_IRQHandler                         ; 45 I2S1
96         DCD             SPIFI_IRQHandler                        ; 46 SPI Flash Interface
97         DCD             SGPIO_IRQHandler                        ; 47 SGPIO (LPC43XX ONLY)
98         DCD             GPIO0_IRQHandler                        ; 48 GPIO0
99         DCD             GPIO1_IRQHandler                        ; 49 GPIO1
100         DCD             GPIO2_IRQHandler                        ; 50 GPIO2
101         DCD             GPIO3_IRQHandler                        ; 51 GPIO3
102         DCD             GPIO4_IRQHandler                        ; 52 GPIO4
103         DCD             GPIO5_IRQHandler                        ; 53 GPIO5
104         DCD             GPIO6_IRQHandler                        ; 54 GPIO6
105         DCD             GPIO7_IRQHandler                        ; 55 GPIO7
106         DCD             GINT0_IRQHandler                        ; 56 GINT0
107         DCD             GINT1_IRQHandler                        ; 57 GINT1
108         DCD             EVRT_IRQHandler             ; 58 Event Router
109         DCD             CAN1_IRQHandler             ; 59 C_CAN1
110         DCD             0
111         DCD             0
112         DCD     ATIMER_IRQHandler           ; 62 ATIMER
113         DCD     RTC_IRQHandler              ; 63 RTC
114         DCD     0
115         DCD     WDT_IRQHandler              ; 65 WDT
116         DCD     0
117         DCD     CAN0_IRQHandler             ; 67 C_CAN0
118         DCD     QEI_IRQHandler              ; 68 QEI
119 __Vectors_End
120
121 __Vectors       EQU   __vector_table
122 __Vectors_Size  EQU   __Vectors_End - __Vectors
123
124 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
125 ;;
126 ;; Default interrupt handlers.
127 ;;
128 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
129
130         THUMB
131
132         PUBWEAK Reset_Handler
133         SECTION .text:CODE:REORDER(2)
134 Reset_Handler
135         LDR     R0, =SystemInit
136         BLX     R0
137         LDR     R0, =__iar_program_start
138         BX      R0
139   
140         PUBWEAK NMI_Handler
141         PUBWEAK HardFault_Handler
142         PUBWEAK MemManage_Handler
143         PUBWEAK BusFault_Handler
144         PUBWEAK UsageFault_Handler
145         PUBWEAK SVC_Handler
146         PUBWEAK DebugMon_Handler
147         PUBWEAK PendSV_Handler
148         PUBWEAK SysTick_Handler
149         PUBWEAK DAC_IRQHandler
150         PUBWEAK MX_CORE_IRQHandler
151         PUBWEAK DMA_IRQHandler
152         PUBWEAK FLASHEEPROM_IRQHandler
153         PUBWEAK ETH_IRQHandler
154         PUBWEAK SDIO_IRQHandler
155         PUBWEAK LCD_IRQHandler
156         PUBWEAK USB0_IRQHandler
157         PUBWEAK USB1_IRQHandler
158         PUBWEAK SCT_IRQHandler
159         PUBWEAK RIT_IRQHandler
160         PUBWEAK TIMER0_IRQHandler
161         PUBWEAK TIMER1_IRQHandler
162         PUBWEAK TIMER2_IRQHandler
163         PUBWEAK TIMER3_IRQHandler
164         PUBWEAK MCPWM_IRQHandler
165         PUBWEAK ADC0_IRQHandler
166         PUBWEAK I2C0_IRQHandler
167         PUBWEAK I2C1_IRQHandler
168         PUBWEAK SPI_IRQHandler
169         PUBWEAK ADC1_IRQHandler
170         PUBWEAK SSP0_IRQHandler
171         PUBWEAK SSP1_IRQHandler
172         PUBWEAK UART0_IRQHandler
173         PUBWEAK UART1_IRQHandler
174         PUBWEAK UART2_IRQHandler
175         PUBWEAK UART3_IRQHandler
176         PUBWEAK I2S0_IRQHandler
177         PUBWEAK I2S1_IRQHandler
178         PUBWEAK SPIFI_IRQHandler
179         PUBWEAK SGPIO_IRQHandler
180         PUBWEAK GPIO0_IRQHandler
181         PUBWEAK GPIO1_IRQHandler
182         PUBWEAK GPIO2_IRQHandler
183         PUBWEAK GPIO3_IRQHandler
184         PUBWEAK GPIO4_IRQHandler
185         PUBWEAK GPIO5_IRQHandler
186         PUBWEAK GPIO6_IRQHandler
187         PUBWEAK GPIO7_IRQHandler
188         PUBWEAK GINT0_IRQHandler
189         PUBWEAK GINT1_IRQHandler
190         PUBWEAK EVRT_IRQHandler
191         PUBWEAK CAN1_IRQHandler
192         PUBWEAK ATIMER_IRQHandler
193         PUBWEAK RTC_IRQHandler
194         PUBWEAK WDT_IRQHandler
195         PUBWEAK CAN0_IRQHandler
196         PUBWEAK QEI_IRQHandler
197         SECTION .text:CODE:REORDER(1)
198 NMI_Handler
199         B NMI_Handler
200 SVC_Handler
201         B SVC_Handler
202 DebugMon_Handler
203         B DebugMon_Handler
204 PendSV_Handler
205         B PendSV_Handler
206 SysTick_Handler
207         B SysTick_Handler
208 HardFault_Handler
209         B HardFault_Handler
210 MemManage_Handler
211         B MemManage_Handler
212 BusFault_Handler
213         B BusFault_Handler
214 UsageFault_Handler
215 DAC_IRQHandler
216 MX_CORE_IRQHandler
217 DMA_IRQHandler 
218 FLASHEEPROM_IRQHandler
219 ETH_IRQHandler
220 SDIO_IRQHandler
221 LCD_IRQHandler
222 USB0_IRQHandler
223 USB1_IRQHandler
224 SCT_IRQHandler
225 RIT_IRQHandler
226 TIMER0_IRQHandler
227 TIMER1_IRQHandler
228 TIMER2_IRQHandler
229 TIMER3_IRQHandler
230 MCPWM_IRQHandler
231 ADC0_IRQHandler
232 I2C0_IRQHandler
233 I2C1_IRQHandler
234 SPI_IRQHandler
235 ADC1_IRQHandler
236 SSP0_IRQHandler
237 SSP1_IRQHandler
238 UART0_IRQHandler
239 UART1_IRQHandler
240 UART2_IRQHandler
241 UART3_IRQHandler
242 I2S0_IRQHandler
243 I2S1_IRQHandler
244 SPIFI_IRQHandler
245 SGPIO_IRQHandler
246 GPIO0_IRQHandler
247 GPIO1_IRQHandler
248 GPIO2_IRQHandler
249 GPIO3_IRQHandler
250 GPIO4_IRQHandler
251 GPIO5_IRQHandler
252 GPIO6_IRQHandler
253 GPIO7_IRQHandler
254 GINT0_IRQHandler
255 GINT1_IRQHandler
256 EVRT_IRQHandler
257 CAN1_IRQHandler
258 ATIMER_IRQHandler
259 RTC_IRQHandler
260 WDT_IRQHandler
261 CAN0_IRQHandler
262 QEI_IRQHandler
263 Default_IRQHandler
264         B Default_IRQHandler
265
266 /* CRP Section - not needed for flashless devices */
267
268 ;;;        SECTION .crp:CODE:ROOT(2)
269 ;;;        DATA
270 /* Code Read Protection
271 NO_ISP  0x4E697370 -  Prevents sampling of pin PIO0_1 for entering ISP mode
272 CRP1    0x12345678 - Write to RAM command cannot access RAM below 0x10000300.
273                    - Copy RAM to flash command can not write to Sector 0.
274                    - Erase command can erase Sector 0 only when all sectors
275                      are selected for erase.
276                    - Compare command is disabled.
277                    - Read Memory command is disabled.
278 CRP2    0x87654321 - Read Memory is disabled.
279                    - Write to RAM is disabled.
280                    - "Go" command is disabled.
281                    - Copy RAM to flash is disabled.
282                    - Compare is disabled.
283 CRP3    0x43218765 - Access to chip via the SWD pins is disabled. ISP entry
284                      by pulling PIO0_1 LOW is disabled if a valid user code is
285                      present in flash sector 0.
286 Caution: If CRP3 is selected, no future factory testing can be
287 performed on the device.
288 */
289 ;;;         DCD 0xFFFFFFFF
290 ;;;
291
292         END