2 *****************************************************************************
4 ** File : startup_XMC1300.s
6 ** Abstract : This assembler file contains interrupt vector and
7 ** startup code for ARM.
9 ** Functions : Reset_Handler
13 ** Target : Infineon $(DEVICE) Device
15 ** Environment : Atollic TrueSTUDIO(R)
17 ** Distribution: The file is distributed
\93as is,
\94 without any warranty
20 ** (c)Copyright Atollic AB.
21 ** You may use this file as-is or modify it according to the needs of your
22 ** project. This file may only be built (assembled or compiled and linked)
23 ** using the Atollic TrueSTUDIO(R) product. The use of this file together
24 ** with other tools than Atollic TrueSTUDIO(R) is not permitted.
26 *****************************************************************************
30 #include <Device_Data.h>
32 #define CLKVAL1_SSW 0x80000000
33 #define CLKVAL2_SSW 0x80000000
42 .global InterruptVector
43 .global Default_Handler
45 /* Linker script definitions */
46 /* start address for the initialization values of the .data section */
48 /* start address for the .data section */
50 /* end address for the .data section */
52 /* start address for the .bss section */
54 /* end address for the .bss section */
63 **===========================================================================
64 ** Program - Reset_Handler
65 ** Abstract: This code gets called after reset.
66 **===========================================================================
68 .section .text.Reset_Handler,"ax", %progbits
69 .type Reset_Handler, %function
71 /* Set stack pointer */
75 /* Branch to SystemInit function */
78 /* Copy data initialization values */
92 /* Clear BSS section */
105 /* R0 = Start address, R1 = Destination address, R2 = Size */
106 ldr r0, =VeneerLoadAddr
111 /* R2 contains byte count. Change it to word count. It is ensured in the
112 linker script that the length is always word aligned.
114 lsrs r2,r2,#2 /* Divide by 4 to obtain word count */
117 /* The proverbial loop from the schooldays */
128 /* Update System Clock */
129 ldr r0,=SystemCoreClockUpdate
132 /* Call static constructors */
138 /* If main returns, branch to Default_Handler. */
141 .size Reset_Handler, .-Reset_Handler
144 **===========================================================================
145 ** Program - Default_Handler
146 ** Abstract: This code gets called when the processor receives an
147 ** unexpected interrupt.
148 **===========================================================================
150 .section .text.Default_Handler,"ax", %progbits
154 .size Default_Handler, .-Default_Handler
157 **===========================================================================
158 ** Interrupt vector table
159 **===========================================================================
161 .section .isr_vector,"a", %progbits
162 .globl InterruptVector
163 .type InterruptVector, %object
166 .word _estack /* 0 - Stack pointer */
167 .word Reset_Handler /* 1 - Reset */
168 .word NMI_Handler /* 2 - NMI */
169 .word HardFault_Handler /* 3 - Hard fault */
170 .word CLKVAL1_SSW /* Clock configuration value */
171 .word CLKVAL2_SSW /* Clock gating configuration */
173 .size InterruptVector, . - InterruptVector
176 **===========================================================================
177 ** Weak interrupt handlers redirected to Default_Handler. These can be
178 ** overridden in user code.
179 **===========================================================================
182 .thumb_set NMI_Handler, Default_Handler
184 .weak HardFault_Handler
185 .thumb_set HardFault_Handler, Default_Handler
188 .thumb_set SVC_Handler, Default_Handler
191 .thumb_set PendSV_Handler, Default_Handler
193 .weak SysTick_Handler
194 .thumb_set SysTick_Handler, Default_Handler
196 /* ============= START OF INTERRUPT HANDLER DEFINITION ====================== */
199 .weak SCU_0_IRQHandler
200 .type SCU_0_IRQHandler, %function
203 .size SCU_0_IRQHandler, . - SCU_0_IRQHandler
204 /* ======================================================================== */
205 .weak SCU_1_IRQHandler
206 .type SCU_1_IRQHandler, %function
209 .size SCU_1_IRQHandler, . - SCU_1_IRQHandler
210 /* ======================================================================== */
211 .weak SCU_2_IRQHandler
212 .type SCU_2_IRQHandler, %function
215 .size SCU_2_IRQHandler, . - SCU_2_IRQHandler
216 /* ======================================================================== */
217 .weak ERU0_0_IRQHandler
218 .type ERU0_0_IRQHandler, %function
221 .size ERU0_0_IRQHandler, . - ERU0_0_IRQHandler
222 /* ======================================================================== */
223 .weak ERU0_1_IRQHandler
224 .type ERU0_1_IRQHandler, %function
227 .size ERU0_1_IRQHandler, . - ERU0_1_IRQHandler
228 /* ======================================================================== */
229 .weak ERU0_2_IRQHandler
230 .type ERU0_2_IRQHandler, %function
233 .size ERU0_2_IRQHandler, . - ERU0_2_IRQHandler
234 /* ======================================================================== */
235 .weak ERU0_3_IRQHandler
236 .type ERU0_3_IRQHandler, %function
239 .size ERU0_3_IRQHandler, . - ERU0_3_IRQHandler
240 /* ======================================================================== */
241 .weak MATH0_0_IRQHandler
242 .type MATH0_0_IRQHandler, %function
245 .size MATH0_0_IRQHandler, . - MATH0_0_IRQHandler
246 /* ======================================================================== */
247 .weak VADC0_C0_0_IRQHandler
248 .type VADC0_C0_0_IRQHandler , %function
249 VADC0_C0_0_IRQHandler:
251 .size VADC0_C0_0_IRQHandler , . - VADC0_C0_0_IRQHandler
252 /* ======================================================================== */
253 .weak VADC0_C0_1_IRQHandler
254 .type VADC0_C0_1_IRQHandler , %function
255 VADC0_C0_1_IRQHandler:
257 .size VADC0_C0_1_IRQHandler , . - VADC0_C0_1_IRQHandler
258 /* ======================================================================== */
259 .weak VADC0_G0_0_IRQHandler
260 .type VADC0_G0_0_IRQHandler, %function
261 VADC0_G0_0_IRQHandler:
263 .size VADC0_G0_0_IRQHandler, . - VADC0_G0_0_IRQHandler
264 /* ======================================================================== */
265 .weak VADC0_G0_1_IRQHandler
266 .type VADC0_G0_1_IRQHandler, %function
267 VADC0_G0_1_IRQHandler:
269 .size VADC0_G0_1_IRQHandler, . - VADC0_G0_1_IRQHandler
270 /* ======================================================================== */
271 .weak VADC0_G1_0_IRQHandler
272 .type VADC0_G1_0_IRQHandler, %function
273 VADC0_G1_0_IRQHandler:
275 .size VADC0_G1_0_IRQHandler, . - VADC0_G1_0_IRQHandler
276 /* ======================================================================== */
277 .weak VADC0_G1_1_IRQHandler
278 .type VADC0_G1_1_IRQHandler, %function
279 VADC0_G1_1_IRQHandler:
281 .size VADC0_G1_1_IRQHandler, . - VADC0_G1_1_IRQHandler
282 /* ======================================================================== */
283 .weak CCU40_0_IRQHandler
284 .type CCU40_0_IRQHandler, %function
287 .size CCU40_0_IRQHandler, . - CCU40_0_IRQHandler
288 /* ======================================================================== */
289 .weak CCU40_1_IRQHandler
290 .type CCU40_1_IRQHandler, %function
294 .size CCU40_1_IRQHandler, . - CCU40_1_IRQHandler
295 /* ======================================================================== */
296 .weak CCU40_2_IRQHandler
297 .type CCU40_2_IRQHandler, %function
300 .size CCU40_2_IRQHandler, . - CCU40_2_IRQHandler
301 /* ======================================================================== */
302 .weak CCU40_3_IRQHandler
303 .type CCU40_3_IRQHandler, %function
306 .size CCU40_3_IRQHandler, . - CCU40_3_IRQHandler
307 /* ======================================================================== */
308 .weak CCU80_0_IRQHandler
309 .type CCU80_0_IRQHandler, %function
312 .size CCU80_0_IRQHandler, . - CCU80_0_IRQHandler
313 /* ======================================================================== */
314 .weak CCU80_1_IRQHandler
315 .type CCU80_1_IRQHandler, %function
318 .size CCU80_1_IRQHandler, . - CCU80_1_IRQHandler
319 /* ======================================================================== */
320 .weak POSIF0_0_IRQHandler
321 .type POSIF0_0_IRQHandler, %function
325 .size POSIF0_0_IRQHandler, . - POSIF0_0_IRQHandler
326 /* ======================================================================== */
327 .weak POSIF0_1_IRQHandler
328 .type POSIF0_1_IRQHandler, %function
331 .size POSIF0_1_IRQHandler, . - POSIF0_1_IRQHandler
332 /* ======================================================================== */
333 .weak USIC0_0_IRQHandler
334 .type USIC0_0_IRQHandler, %function
337 .size USIC0_0_IRQHandler, . - USIC0_0_IRQHandler
338 /* ======================================================================== */
339 .weak USIC0_1_IRQHandler
340 .type USIC0_1_IRQHandler, %function
343 .size USIC0_1_IRQHandler, . - USIC0_1_IRQHandler
344 /* ======================================================================== */
345 .weak USIC0_2_IRQHandler
346 .type USIC0_2_IRQHandler, %function
349 .size USIC0_2_IRQHandler, . - USIC0_2_IRQHandler
350 /* ======================================================================== */
351 .weak USIC0_3_IRQHandler
352 .type USIC0_3_IRQHandler, %function
355 .size USIC0_3_IRQHandler, . - USIC0_3_IRQHandler
356 /* ======================================================================== */
357 .weak USIC0_4_IRQHandler
358 .type USIC0_4_IRQHandler, %function
361 .size USIC0_4_IRQHandler, . - USIC0_4_IRQHandler
362 /* ======================================================================== */
363 .weak USIC0_5_IRQHandler
364 .type USIC0_5_IRQHandler, %function
367 .size USIC0_5_IRQHandler, . - USIC0_5_IRQHandler
368 /* ======================================================================== */
369 .weak LEDTS0_0_IRQHandler
370 .type LEDTS0_0_IRQHandler, %function
373 .size LEDTS0_0_IRQHandler, . - LEDTS0_0_IRQHandler
374 /* ======================================================================== */
375 .weak LEDTS1_0_IRQHandler
376 .type LEDTS1_0_IRQHandler, %function
379 .size LEDTS1_0_IRQHandler, . - LEDTS1_0_IRQHandler
380 /* ======================================================================== */
381 .weak BCCU0_0_IRQHandler
382 .type BCCU0_0_IRQHandler, %function
385 .size BCCU0_0_IRQHandler, . - BCCU0_0_IRQHandler
386 /* ======================================================================== */
387 /* ======================================================================== */
389 /* ==================VENEERS VENEERS VENEERS VENEERS VENEERS=============== */
390 .section ".XmcVeneerCode","ax",%progbits
391 .globl HardFault_Veneer
393 LDR R0, =HardFault_Handler
403 /* ======================================================================== */
410 /* ======================================================================== */
413 LDR R0, =PendSV_Handler
415 /* ======================================================================== */
416 .globl SysTick_Veneer
418 LDR R0, =SysTick_Handler
420 /* ======================================================================== */
423 LDR R0, =SCU_0_IRQHandler
425 /* ======================================================================== */
428 LDR R0, =SCU_1_IRQHandler
430 /* ======================================================================== */
433 LDR R0, =SCU_2_IRQHandler
435 /* ======================================================================== */
438 LDR R0, =ERU0_0_IRQHandler
440 /* ======================================================================== */
443 LDR R0, =ERU0_1_IRQHandler
445 /* ======================================================================== */
448 LDR R0, =ERU0_2_IRQHandler
450 /* ======================================================================== */
453 LDR R0, =ERU0_3_IRQHandler
455 /* ======================================================================== */
458 LDR R0, =MATH0_0_IRQHandler
461 /* ======================================================================== */
462 .globl VADC0_C0_0_Veneer
464 LDR R0, =VADC0_C0_0_IRQHandler
466 /* ======================================================================== */
467 .globl VADC0_C0_1_Veneer
469 LDR R0, =VADC0_C0_1_IRQHandler
471 /* ======================================================================== */
472 .globl VADC0_G0_0_Veneer
474 LDR R0, =VADC0_G0_0_IRQHandler
476 /* ======================================================================== */
477 .globl VADC0_G0_1_Veneer
479 LDR R0, =VADC0_G0_1_IRQHandler
481 /* ======================================================================== */
482 .globl VADC0_G1_0_Veneer
484 LDR R0, =VADC0_G1_0_IRQHandler
486 /* ======================================================================== */
487 .globl VADC0_G1_1_Veneer
489 LDR R0, =VADC0_G1_1_IRQHandler
491 /* ======================================================================== */
492 .globl CCU40_0_Veneer
494 LDR R0, =CCU40_0_IRQHandler
496 /* ======================================================================== */
497 .globl CCU40_1_Veneer
499 LDR R0, =CCU40_1_IRQHandler
501 /* ======================================================================== */
502 .globl CCU40_2_Veneer
504 LDR R0, =CCU40_2_IRQHandler
506 /* ======================================================================== */
507 .globl CCU40_3_Veneer
509 LDR R0, =CCU40_3_IRQHandler
511 /* ======================================================================== */
512 .globl CCU80_0_Veneer
514 LDR R0, =CCU80_0_IRQHandler
516 /* ======================================================================== */
517 .globl CCU80_1_Veneer
519 LDR R0, =CCU80_1_IRQHandler
521 /* ======================================================================== */
522 .globl POSIF0_0_Veneer
524 LDR R0, =POSIF0_0_IRQHandler
526 /* ======================================================================== */
527 .globl POSIF0_1_Veneer
529 LDR R0, =POSIF0_1_IRQHandler
531 /* ======================================================================== */
532 .globl USIC0_0_Veneer
534 LDR R0, =USIC0_0_IRQHandler
536 /* ======================================================================== */
537 .globl USIC0_1_Veneer
539 LDR R0, =USIC0_1_IRQHandler
541 /* ======================================================================== */
542 .globl USIC0_2_Veneer
544 LDR R0, =USIC0_2_IRQHandler
546 /* ======================================================================== */
547 .globl USIC0_3_Veneer
549 LDR R0, =USIC0_3_IRQHandler
551 /* ======================================================================== */
552 .globl USIC0_4_Veneer
554 LDR R0, =USIC0_4_IRQHandler
556 /* ======================================================================== */
557 .globl USIC0_5_Veneer
559 LDR R0, =USIC0_5_IRQHandler
561 /* ======================================================================== */
562 .globl LEDTS0_0_Veneer
564 LDR R0, =LEDTS0_0_IRQHandler
566 /* ======================================================================== */
567 .globl LEDTS1_0_Veneer
569 LDR R0, =LEDTS1_0_IRQHandler
571 /* ======================================================================== */
572 .globl BCCU0_0_Veneer
574 LDR R0, =BCCU0_0_IRQHandler
577 /* ======================================================================== */
579 /* ===== Decision function queried by CMSIS startup for Clock tree setup === */
580 /* In the absence of DAVE code engine, CMSIS SystemInit() must perform clock
583 This decision routine defined here will always return TRUE.
585 When overridden by a definition defined in DAVE code engine, this routine
586 returns FALSE indicating that the code engine has performed the clock setup
588 .section ".XmcStartup"
589 .weak AllowClkInitByStartup
590 .type AllowClkInitByStartup, %function
591 AllowClkInitByStartup:
594 .size AllowClkInitByStartup, . - AllowClkInitByStartup
596 /* ====== Definition of the default weak SystemInit_DAVE3 function =========
597 If DAVE3 requires an extended SystemInit it will create its own version of
598 SystemInit_DAVE3 which overrides this weak definition. Example includes
599 setting up of external memory interfaces.
601 .weak SystemInit_DAVE3
602 .type SystemInit_DAVE3, %function
606 .size SystemInit_DAVE3, . - SystemInit_DAVE3