1 ;*************************************************
\r
3 ;* Part one of the system initialization code, contains low-level
\r
4 ;* initialization, plain thumb variant.
\r
6 ;* Copyright 2008 IAR Systems. All rights reserved.
\r
8 ;* $Revision: 50748 $
\r
10 ;*************************************************
\r
13 ; The modules in this file are included in the libraries, and may be replaced
\r
14 ; by any user-defined modules that define the PUBLIC symbol _program_start or
\r
15 ; a user defined start symbol.
\r
16 ; To override the cstartup defined in the library, simply add your modified
\r
17 ; version to the workbench project.
\r
19 ; The vector table is normally located at address 0.
\r
20 ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6.
\r
21 ; The name "__vector_table" has special meaning for C-SPY:
\r
22 ; it is where the SP start value is found, and the NVIC vector
\r
23 ; table register (VTOR) is initialized to this address if != 0.
\r
25 ; Cortex-M version with interrupt handler for XMC4500 from Infineon
\r
28 MODULE ?vector_table
\r
30 AAPCS INTERWORK, VFP_COMPATIBLE, RWPI_COMPATIBLE
\r
34 ;; Forward declaration of sections.
\r
35 SECTION CSTACK:DATA:NOROOT(3)
\r
37 SECTION .intvec:CODE:NOROOT(2)
\r
39 EXTERN __iar_program_start
\r
40 PUBLIC __vector_table
\r
44 __iar_init$$done: ; The vector table is not needed
\r
45 ; until after copy initialization is done
\r
52 DCD HardFault_Handler
\r
53 DCD MemManage_Handler
\r
54 DCD BusFault_Handler
\r
55 DCD UsageFault_Handler
\r
61 DCD DebugMon_Handler
\r
66 ; Interrupt Handlers for Service Requests (SR) from XMC4500 Peripherals
\r
67 DCD SCU_0_IRQHandler ; Handler name for SR SCU_0
\r
68 DCD ERU0_0_IRQHandler ; Handler name for SR ERU0_0
\r
69 DCD ERU0_1_IRQHandler ; Handler name for SR ERU0_1
\r
70 DCD ERU0_2_IRQHandler ; Handler name for SR ERU0_2
\r
71 DCD ERU0_3_IRQHandler ; Handler name for SR ERU0_3
\r
72 DCD ERU1_0_IRQHandler ; Handler name for SR ERU1_0
\r
73 DCD ERU1_1_IRQHandler ; Handler name for SR ERU1_1
\r
74 DCD ERU1_2_IRQHandler ; Handler name for SR ERU1_2
\r
75 DCD ERU1_3_IRQHandler ; Handler name for SR ERU1_3
\r
76 DCD 0 ; Not Available
\r
77 DCD 0 ; Not Available
\r
78 DCD 0 ; Not Available
\r
79 DCD PMU0_0_IRQHandler ; Handler name for SR PMU0_0
\r
80 DCD 0 ; Not Available
\r
81 DCD VADC0_C0_0_IRQHandler ; Handler name for SR VADC0_C0_0
\r
82 DCD VADC0_C0_1_IRQHandler ; Handler name for SR VADC0_C0_1
\r
83 DCD VADC0_C0_2_IRQHandler ; Handler name for SR VADC0_C0_1
\r
84 DCD VADC0_C0_3_IRQHandler ; Handler name for SR VADC0_C0_3
\r
85 DCD VADC0_G0_0_IRQHandler ; Handler name for SR VADC0_G0_0
\r
86 DCD VADC0_G0_1_IRQHandler ; Handler name for SR VADC0_G0_1
\r
87 DCD VADC0_G0_2_IRQHandler ; Handler name for SR VADC0_G0_2
\r
88 DCD VADC0_G0_3_IRQHandler ; Handler name for SR VADC0_G0_3
\r
89 DCD VADC0_G1_0_IRQHandler ; Handler name for SR VADC0_G1_0
\r
90 DCD VADC0_G1_1_IRQHandler ; Handler name for SR VADC0_G1_1
\r
91 DCD VADC0_G1_2_IRQHandler ; Handler name for SR VADC0_G1_2
\r
92 DCD VADC0_G1_3_IRQHandler ; Handler name for SR VADC0_G1_3
\r
93 DCD VADC0_G2_0_IRQHandler ; Handler name for SR VADC0_G2_0
\r
94 DCD VADC0_G2_1_IRQHandler ; Handler name for SR VADC0_G2_1
\r
95 DCD VADC0_G2_2_IRQHandler ; Handler name for SR VADC0_G2_2
\r
96 DCD VADC0_G2_3_IRQHandler ; Handler name for SR VADC0_G2_3
\r
97 DCD VADC0_G3_0_IRQHandler ; Handler name for SR VADC0_G3_0
\r
98 DCD VADC0_G3_1_IRQHandler ; Handler name for SR VADC0_G3_1
\r
99 DCD VADC0_G3_2_IRQHandler ; Handler name for SR VADC0_G3_2
\r
100 DCD VADC0_G3_3_IRQHandler ; Handler name for SR VADC0_G3_3
\r
101 DCD DSD0_0_IRQHandler ; Handler name for SR DSD0_0
\r
102 DCD DSD0_1_IRQHandler ; Handler name for SR DSD0_1
\r
103 DCD DSD0_2_IRQHandler ; Handler name for SR DSD0_2
\r
104 DCD DSD0_3_IRQHandler ; Handler name for SR DSD0_3
\r
105 DCD DSD0_4_IRQHandler ; Handler name for SR DSD0_4
\r
106 DCD DSD0_5_IRQHandler ; Handler name for SR DSD0_5
\r
107 DCD DSD0_6_IRQHandler ; Handler name for SR DSD0_6
\r
108 DCD DSD0_7_IRQHandler ; Handler name for SR DSD0_7
\r
109 DCD DAC0_0_IRQHandler ; Handler name for SR DAC0_0
\r
110 DCD DAC0_1_IRQHandler ; Handler name for SR DAC0_0
\r
111 DCD CCU40_0_IRQHandler ; Handler name for SR CCU40_0
\r
112 DCD CCU40_1_IRQHandler ; Handler name for SR CCU40_1
\r
113 DCD CCU40_2_IRQHandler ; Handler name for SR CCU40_2
\r
114 DCD CCU40_3_IRQHandler ; Handler name for SR CCU40_3
\r
115 DCD CCU41_0_IRQHandler ; Handler name for SR CCU41_0
\r
116 DCD CCU41_1_IRQHandler ; Handler name for SR CCU41_1
\r
117 DCD CCU41_2_IRQHandler ; Handler name for SR CCU41_2
\r
118 DCD CCU41_3_IRQHandler ; Handler name for SR CCU41_3
\r
119 DCD CCU42_0_IRQHandler ; Handler name for SR CCU42_0
\r
120 DCD CCU42_1_IRQHandler ; Handler name for SR CCU42_1
\r
121 DCD CCU42_2_IRQHandler ; Handler name for SR CCU42_2
\r
122 DCD CCU42_3_IRQHandler ; Handler name for SR CCU42_3
\r
123 DCD CCU43_0_IRQHandler ; Handler name for SR CCU43_0
\r
124 DCD CCU43_1_IRQHandler ; Handler name for SR CCU43_1
\r
125 DCD CCU43_2_IRQHandler ; Handler name for SR CCU43_2
\r
126 DCD CCU43_3_IRQHandler ; Handler name for SR CCU43_3
\r
127 DCD CCU80_0_IRQHandler ; Handler name for SR CCU80_0
\r
128 DCD CCU80_1_IRQHandler ; Handler name for SR CCU80_1
\r
129 DCD CCU80_2_IRQHandler ; Handler name for SR CCU80_2
\r
130 DCD CCU80_3_IRQHandler ; Handler name for SR CCU80_3
\r
131 DCD CCU81_0_IRQHandler ; Handler name for SR CCU81_0
\r
132 DCD CCU81_1_IRQHandler ; Handler name for SR CCU81_1
\r
133 DCD CCU81_2_IRQHandler ; Handler name for SR CCU81_2
\r
134 DCD CCU81_3_IRQHandler ; Handler name for SR CCU81_3
\r
135 DCD POSIF0_0_IRQHandler ; Handler name for SR POSIF0_0
\r
136 DCD POSIF0_1_IRQHandler ; Handler name for SR POSIF0_1
\r
137 DCD POSIF1_0_IRQHandler ; Handler name for SR POSIF1_0
\r
138 DCD POSIF1_1_IRQHandler ; Handler name for SR POSIF1_1
\r
139 DCD 0 ; Not Available
\r
140 DCD 0 ; Not Available
\r
141 DCD 0 ; Not Available
\r
142 DCD 0 ; Not Available
\r
143 DCD CAN0_0_IRQHandler ; Handler name for SR CAN0_0
\r
144 DCD CAN0_1_IRQHandler ; Handler name for SR CAN0_1
\r
145 DCD CAN0_2_IRQHandler ; Handler name for SR CAN0_2
\r
146 DCD CAN0_3_IRQHandler ; Handler name for SR CAN0_3
\r
147 DCD CAN0_4_IRQHandler ; Handler name for SR CAN0_4
\r
148 DCD CAN0_5_IRQHandler ; Handler name for SR CAN0_5
\r
149 DCD CAN0_6_IRQHandler ; Handler name for SR CAN0_6
\r
150 DCD CAN0_7_IRQHandler ; Handler name for SR CAN0_7
\r
151 DCD USIC0_0_IRQHandler ; Handler name for SR USIC0_0
\r
152 DCD USIC0_1_IRQHandler ; Handler name for SR USIC0_1
\r
153 DCD USIC0_2_IRQHandler ; Handler name for SR USIC0_2
\r
154 DCD USIC0_3_IRQHandler ; Handler name for SR USIC0_3
\r
155 DCD USIC0_4_IRQHandler ; Handler name for SR USIC0_4
\r
156 DCD USIC0_5_IRQHandler ; Handler name for SR USIC0_5
\r
157 DCD USIC1_0_IRQHandler ; Handler name for SR USIC1_0
\r
158 DCD USIC1_1_IRQHandler ; Handler name for SR USIC1_1
\r
159 DCD USIC1_2_IRQHandler ; Handler name for SR USIC1_2
\r
160 DCD USIC1_3_IRQHandler ; Handler name for SR USIC1_3
\r
161 DCD USIC1_4_IRQHandler ; Handler name for SR USIC1_4
\r
162 DCD USIC1_5_IRQHandler ; Handler name for SR USIC1_5
\r
163 DCD USIC2_0_IRQHandler ; Handler name for SR USIC2_0
\r
164 DCD USIC2_1_IRQHandler ; Handler name for SR USIC2_1
\r
165 DCD USIC2_2_IRQHandler ; Handler name for SR USIC2_2
\r
166 DCD USIC2_3_IRQHandler ; Handler name for SR USIC2_3
\r
167 DCD USIC2_4_IRQHandler ; Handler name for SR USIC2_4
\r
168 DCD USIC2_5_IRQHandler ; Handler name for SR USIC2_5
\r
169 DCD LEDTS0_0_IRQHandler ; Handler name for SR LEDTS0_0
\r
170 DCD 0 ; Not Available
\r
171 DCD FCE0_0_IRQHandler ; Handler name for SR FCE0_0
\r
172 DCD GPDMA0_0_IRQHandler ; Handler name for SR GPDMA0_0
\r
173 DCD SDMMC0_0_IRQHandler ; Handler name for SR SDMMC0_0
\r
174 DCD USB0_0_IRQHandler ; Handler name for SR USB0_0
\r
175 DCD ETH0_0_IRQHandler ; Handler name for SR ETH0_0
\r
176 DCD 0 ; Not Available
\r
177 DCD GPDMA1_0_IRQHandler ; Handler name for SR GPDMA1_0
\r
178 DCD 0 ; Not Available
\r
183 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
\r
185 ;; Default interrupt handlers.
\r
188 PUBWEAK NMI_Handler
\r
189 PUBWEAK HardFault_Handler
\r
190 PUBWEAK MemManage_Handler
\r
191 PUBWEAK BusFault_Handler
\r
192 PUBWEAK UsageFault_Handler
\r
193 PUBWEAK SVC_Handler
\r
194 PUBWEAK DebugMon_Handler
\r
195 PUBWEAK PendSV_Handler
\r
196 PUBWEAK SysTick_Handler
\r
197 ;; XMC4500 interrupt handlers
\r
198 PUBWEAK SCU_0_IRQHandler
\r
199 PUBWEAK ERU0_0_IRQHandler
\r
200 PUBWEAK ERU0_1_IRQHandler
\r
201 PUBWEAK ERU0_2_IRQHandler
\r
202 PUBWEAK ERU0_3_IRQHandler
\r
203 PUBWEAK ERU1_0_IRQHandler
\r
204 PUBWEAK ERU1_1_IRQHandler
\r
205 PUBWEAK ERU1_2_IRQHandler
\r
206 PUBWEAK ERU1_3_IRQHandler
\r
207 PUBWEAK PMU0_0_IRQHandler
\r
208 PUBWEAK PMU0_1_IRQHandler
\r
209 PUBWEAK VADC0_C0_0_IRQHandler
\r
210 PUBWEAK VADC0_C0_1_IRQHandler
\r
211 PUBWEAK VADC0_C0_2_IRQHandler
\r
212 PUBWEAK VADC0_C0_3_IRQHandler
\r
213 PUBWEAK VADC0_G0_0_IRQHandler
\r
214 PUBWEAK VADC0_G0_1_IRQHandler
\r
215 PUBWEAK VADC0_G0_2_IRQHandler
\r
216 PUBWEAK VADC0_G0_3_IRQHandler
\r
217 PUBWEAK VADC0_G1_0_IRQHandler
\r
218 PUBWEAK VADC0_G1_1_IRQHandler
\r
219 PUBWEAK VADC0_G1_2_IRQHandler
\r
220 PUBWEAK VADC0_G1_3_IRQHandler
\r
221 PUBWEAK VADC0_G2_0_IRQHandler
\r
222 PUBWEAK VADC0_G2_1_IRQHandler
\r
223 PUBWEAK VADC0_G2_2_IRQHandler
\r
224 PUBWEAK VADC0_G2_3_IRQHandler
\r
225 PUBWEAK VADC0_G3_0_IRQHandler
\r
226 PUBWEAK VADC0_G3_1_IRQHandler
\r
227 PUBWEAK VADC0_G3_2_IRQHandler
\r
228 PUBWEAK VADC0_G3_3_IRQHandler
\r
229 PUBWEAK DSD0_0_IRQHandler
\r
230 PUBWEAK DSD0_1_IRQHandler
\r
231 PUBWEAK DSD0_2_IRQHandler
\r
232 PUBWEAK DSD0_3_IRQHandler
\r
233 PUBWEAK DSD0_4_IRQHandler
\r
234 PUBWEAK DSD0_5_IRQHandler
\r
235 PUBWEAK DSD0_6_IRQHandler
\r
236 PUBWEAK DSD0_7_IRQHandler
\r
237 PUBWEAK DAC0_0_IRQHandler
\r
238 PUBWEAK DAC0_1_IRQHandler
\r
239 PUBWEAK CCU40_0_IRQHandler
\r
240 PUBWEAK CCU40_1_IRQHandler
\r
241 PUBWEAK CCU40_2_IRQHandler
\r
242 PUBWEAK CCU40_3_IRQHandler
\r
243 PUBWEAK CCU41_0_IRQHandler
\r
244 PUBWEAK CCU41_1_IRQHandler
\r
245 PUBWEAK CCU41_2_IRQHandler
\r
246 PUBWEAK CCU41_3_IRQHandler
\r
247 PUBWEAK CCU42_0_IRQHandler
\r
248 PUBWEAK CCU42_1_IRQHandler
\r
249 PUBWEAK CCU42_2_IRQHandler
\r
250 PUBWEAK CCU42_3_IRQHandler
\r
251 PUBWEAK CCU43_0_IRQHandler
\r
252 PUBWEAK CCU43_1_IRQHandler
\r
253 PUBWEAK CCU43_2_IRQHandler
\r
254 PUBWEAK CCU43_3_IRQHandler
\r
255 PUBWEAK CCU80_0_IRQHandler
\r
256 PUBWEAK CCU80_1_IRQHandler
\r
257 PUBWEAK CCU80_2_IRQHandler
\r
258 PUBWEAK CCU80_3_IRQHandler
\r
259 PUBWEAK CCU81_0_IRQHandler
\r
260 PUBWEAK CCU81_1_IRQHandler
\r
261 PUBWEAK CCU81_2_IRQHandler
\r
262 PUBWEAK CCU81_3_IRQHandler
\r
263 PUBWEAK POSIF0_0_IRQHandler
\r
264 PUBWEAK POSIF0_1_IRQHandler
\r
265 PUBWEAK POSIF1_0_IRQHandler
\r
266 PUBWEAK POSIF1_1_IRQHandler
\r
267 PUBWEAK CAN0_0_IRQHandler
\r
268 PUBWEAK CAN0_1_IRQHandler
\r
269 PUBWEAK CAN0_2_IRQHandler
\r
270 PUBWEAK CAN0_3_IRQHandler
\r
271 PUBWEAK CAN0_4_IRQHandler
\r
272 PUBWEAK CAN0_5_IRQHandler
\r
273 PUBWEAK CAN0_6_IRQHandler
\r
274 PUBWEAK CAN0_7_IRQHandler
\r
275 PUBWEAK USIC0_0_IRQHandler
\r
276 PUBWEAK USIC0_1_IRQHandler
\r
277 PUBWEAK USIC0_2_IRQHandler
\r
278 PUBWEAK USIC0_3_IRQHandler
\r
279 PUBWEAK USIC0_4_IRQHandler
\r
280 PUBWEAK USIC0_5_IRQHandler
\r
281 PUBWEAK USIC1_0_IRQHandler
\r
282 PUBWEAK USIC1_1_IRQHandler
\r
283 PUBWEAK USIC1_2_IRQHandler
\r
284 PUBWEAK USIC1_3_IRQHandler
\r
285 PUBWEAK USIC1_4_IRQHandler
\r
286 PUBWEAK USIC1_5_IRQHandler
\r
287 PUBWEAK USIC2_0_IRQHandler
\r
288 PUBWEAK USIC2_1_IRQHandler
\r
289 PUBWEAK USIC2_2_IRQHandler
\r
290 PUBWEAK USIC2_3_IRQHandler
\r
291 PUBWEAK USIC2_4_IRQHandler
\r
292 PUBWEAK USIC2_5_IRQHandler
\r
293 PUBWEAK LEDTS0_0_IRQHandler
\r
294 PUBWEAK FCE0_0_IRQHandler
\r
295 PUBWEAK GPDMA0_0_IRQHandler
\r
296 PUBWEAK SDMMC0_0_IRQHandler
\r
297 PUBWEAK USB0_0_IRQHandler
\r
298 PUBWEAK ETH0_0_IRQHandler
\r
299 PUBWEAK GPDMA1_0_IRQHandler
\r
301 SECTION .text:CODE:REORDER(2)
\r
325 VADC0_C0_0_IRQHandler
\r
326 VADC0_C0_1_IRQHandler
\r
327 VADC0_C0_2_IRQHandler
\r
328 VADC0_C0_3_IRQHandler
\r
329 VADC0_G0_0_IRQHandler
\r
330 VADC0_G0_1_IRQHandler
\r
331 VADC0_G0_2_IRQHandler
\r
332 VADC0_G0_3_IRQHandler
\r
333 VADC0_G1_0_IRQHandler
\r
334 VADC0_G1_1_IRQHandler
\r
335 VADC0_G1_2_IRQHandler
\r
336 VADC0_G1_3_IRQHandler
\r
337 VADC0_G2_0_IRQHandler
\r
338 VADC0_G2_1_IRQHandler
\r
339 VADC0_G2_2_IRQHandler
\r
340 VADC0_G2_3_IRQHandler
\r
341 VADC0_G3_0_IRQHandler
\r
342 VADC0_G3_1_IRQHandler
\r
343 VADC0_G3_2_IRQHandler
\r
344 VADC0_G3_3_IRQHandler
\r
379 POSIF0_0_IRQHandler
\r
380 POSIF0_1_IRQHandler
\r
381 POSIF1_0_IRQHandler
\r
382 POSIF1_1_IRQHandler
\r
409 LEDTS0_0_IRQHandler
\r
411 GPDMA0_0_IRQHandler
\r
412 SDMMC0_0_IRQHandler
\r
415 GPDMA1_0_IRQHandler
\r
418 NOCALL Default_Handler
\r
421 PREF_PCON EQU 0x58004000
\r
422 SCU_GCU_PEEN EQU 0x5000413C
\r
423 SCU_GCU_PEFLAG EQU 0x50004150
\r
425 SECTION .text:CODE:REORDER(2)
\r
428 ; A11 workaround for branch prediction and parity
\r
429 LDR R0,=PREF_PCON /* switch off branch prediction required in A11 step to use cached memory*/
\r
431 ORR R1,R1,#0x00010000
\r
434 /* Clear existing parity errors if any required in A11 step */
\r
435 LDR R0,=SCU_GCU_PEFLAG
\r
439 /* Disable parity required in A11 step*/
\r
440 LDR R0,=SCU_GCU_PEEN
\r
443 B __iar_program_start
\r