1 //*****************************************************************************
\r
2 // LPC55S69_cm33_core0 startup code for use with MCUXpresso IDE
\r
5 //*****************************************************************************
\r
7 // Copyright 2016-2019 NXP
\r
8 // All rights reserved.
\r
10 // SPDX-License-Identifier: BSD-3-Clause
\r
11 //*****************************************************************************
\r
14 #pragma GCC push_options
\r
15 #pragma GCC optimize ("Og")
\r
18 #if defined (__cplusplus)
\r
20 #error Redlib does not support C++
\r
22 //*****************************************************************************
\r
24 // The entry point for the C++ library startup
\r
26 //*****************************************************************************
\r
28 extern void __libc_init_array(void);
\r
33 #define WEAK __attribute__ ((weak))
\r
34 #define WEAK_AV __attribute__ ((weak, section(".after_vectors")))
\r
35 #define ALIAS(f) __attribute__ ((weak, alias (#f)))
\r
37 //*****************************************************************************
\r
38 #if defined (__cplusplus)
\r
42 //*****************************************************************************
\r
43 // Variable to store CRP value in. Will be placed automatically
\r
44 // by the linker when "Enable Code Read Protect" selected.
\r
45 // See crp.h header for more information
\r
46 //*****************************************************************************
\r
47 //*****************************************************************************
\r
48 // Declaration of external SystemInit function
\r
49 //*****************************************************************************
\r
50 #if defined (__USE_CMSIS)
\r
51 extern void SystemInit(void);
\r
52 #endif // (__USE_CMSIS)
\r
54 //*****************************************************************************
\r
55 // Forward declaration of the core exception handlers.
\r
56 // When the application defines a handler (with the same name), this will
\r
57 // automatically take precedence over these weak definitions.
\r
58 // If your application is a C++ one, then any interrupt handlers defined
\r
59 // in C++ files within in your main application will need to have C linkage
\r
60 // rather than C++ linkage. To do this, make sure that you are using extern "C"
\r
61 // { .... } around the interrupt handler within your main application code.
\r
62 //*****************************************************************************
\r
63 void ResetISR(void);
\r
64 WEAK void NMI_Handler(void);
\r
65 WEAK void HardFault_Handler(void);
\r
66 WEAK void MemManage_Handler(void);
\r
67 WEAK void BusFault_Handler(void);
\r
68 WEAK void UsageFault_Handler(void);
\r
69 WEAK void SVC_Handler(void);
\r
70 WEAK void DebugMon_Handler(void);
\r
71 WEAK void PendSV_Handler(void);
\r
72 WEAK void SysTick_Handler(void);
\r
73 WEAK void IntDefaultHandler(void);
\r
75 //*****************************************************************************
\r
76 // Forward declaration of the application IRQ handlers. When the application
\r
77 // defines a handler (with the same name), this will automatically take
\r
78 // precedence over weak definitions below
\r
79 //*****************************************************************************
\r
80 WEAK void WDT_BOD_IRQHandler(void);
\r
81 WEAK void DMA0_IRQHandler(void);
\r
82 WEAK void GINT0_IRQHandler(void);
\r
83 WEAK void GINT1_IRQHandler(void);
\r
84 WEAK void PIN_INT0_IRQHandler(void);
\r
85 WEAK void PIN_INT1_IRQHandler(void);
\r
86 WEAK void PIN_INT2_IRQHandler(void);
\r
87 WEAK void PIN_INT3_IRQHandler(void);
\r
88 WEAK void UTICK0_IRQHandler(void);
\r
89 WEAK void MRT0_IRQHandler(void);
\r
90 WEAK void CTIMER0_IRQHandler(void);
\r
91 WEAK void CTIMER1_IRQHandler(void);
\r
92 WEAK void SCT0_IRQHandler(void);
\r
93 WEAK void CTIMER3_IRQHandler(void);
\r
94 WEAK void FLEXCOMM0_IRQHandler(void);
\r
95 WEAK void FLEXCOMM1_IRQHandler(void);
\r
96 WEAK void FLEXCOMM2_IRQHandler(void);
\r
97 WEAK void FLEXCOMM3_IRQHandler(void);
\r
98 WEAK void FLEXCOMM4_IRQHandler(void);
\r
99 WEAK void FLEXCOMM5_IRQHandler(void);
\r
100 WEAK void FLEXCOMM6_IRQHandler(void);
\r
101 WEAK void FLEXCOMM7_IRQHandler(void);
\r
102 WEAK void ADC0_IRQHandler(void);
\r
103 WEAK void Reserved39_IRQHandler(void);
\r
104 WEAK void ACMP_IRQHandler(void);
\r
105 WEAK void Reserved41_IRQHandler(void);
\r
106 WEAK void Reserved42_IRQHandler(void);
\r
107 WEAK void USB0_NEEDCLK_IRQHandler(void);
\r
108 WEAK void USB0_IRQHandler(void);
\r
109 WEAK void RTC_IRQHandler(void);
\r
110 WEAK void Reserved46_IRQHandler(void);
\r
111 WEAK void MAILBOX_IRQHandler(void);
\r
112 WEAK void PIN_INT4_IRQHandler(void);
\r
113 WEAK void PIN_INT5_IRQHandler(void);
\r
114 WEAK void PIN_INT6_IRQHandler(void);
\r
115 WEAK void PIN_INT7_IRQHandler(void);
\r
116 WEAK void CTIMER2_IRQHandler(void);
\r
117 WEAK void CTIMER4_IRQHandler(void);
\r
118 WEAK void OS_EVENT_IRQHandler(void);
\r
119 WEAK void Reserved55_IRQHandler(void);
\r
120 WEAK void Reserved56_IRQHandler(void);
\r
121 WEAK void Reserved57_IRQHandler(void);
\r
122 WEAK void SDIO_IRQHandler(void);
\r
123 WEAK void Reserved59_IRQHandler(void);
\r
124 WEAK void Reserved60_IRQHandler(void);
\r
125 WEAK void Reserved61_IRQHandler(void);
\r
126 WEAK void USB1_UTMI_IRQHandler(void);
\r
127 WEAK void USB1_IRQHandler(void);
\r
128 WEAK void USB1_NEEDCLK_IRQHandler(void);
\r
129 WEAK void SEC_HYPERVISOR_CALL_IRQHandler(void);
\r
130 WEAK void SEC_GPIO_INT0_IRQ0_IRQHandler(void);
\r
131 WEAK void SEC_GPIO_INT0_IRQ1_IRQHandler(void);
\r
132 WEAK void PLU_IRQHandler(void);
\r
133 WEAK void SEC_VIO_IRQHandler(void);
\r
134 WEAK void HASHCRYPT_IRQHandler(void);
\r
135 WEAK void CASER_IRQHandler(void);
\r
136 WEAK void PUF_IRQHandler(void);
\r
137 WEAK void PQ_IRQHandler(void);
\r
138 WEAK void DMA1_IRQHandler(void);
\r
139 WEAK void LSPI_HS_IRQHandler(void);
\r
141 //*****************************************************************************
\r
142 // Forward declaration of the driver IRQ handlers. These are aliased
\r
143 // to the IntDefaultHandler, which is a 'forever' loop. When the driver
\r
144 // defines a handler (with the same name), this will automatically take
\r
145 // precedence over these weak definitions
\r
146 //*****************************************************************************
\r
147 void WDT_BOD_DriverIRQHandler(void) ALIAS(IntDefaultHandler);
\r
148 void DMA0_DriverIRQHandler(void) ALIAS(IntDefaultHandler);
\r
149 void GINT0_DriverIRQHandler(void) ALIAS(IntDefaultHandler);
\r
150 void GINT1_DriverIRQHandler(void) ALIAS(IntDefaultHandler);
\r
151 void PIN_INT0_DriverIRQHandler(void) ALIAS(IntDefaultHandler);
\r
152 void PIN_INT1_DriverIRQHandler(void) ALIAS(IntDefaultHandler);
\r
153 void PIN_INT2_DriverIRQHandler(void) ALIAS(IntDefaultHandler);
\r
154 void PIN_INT3_DriverIRQHandler(void) ALIAS(IntDefaultHandler);
\r
155 void UTICK0_DriverIRQHandler(void) ALIAS(IntDefaultHandler);
\r
156 void MRT0_DriverIRQHandler(void) ALIAS(IntDefaultHandler);
\r
157 void CTIMER0_DriverIRQHandler(void) ALIAS(IntDefaultHandler);
\r
158 void CTIMER1_DriverIRQHandler(void) ALIAS(IntDefaultHandler);
\r
159 void SCT0_DriverIRQHandler(void) ALIAS(IntDefaultHandler);
\r
160 void CTIMER3_DriverIRQHandler(void) ALIAS(IntDefaultHandler);
\r
161 void FLEXCOMM0_DriverIRQHandler(void) ALIAS(IntDefaultHandler);
\r
162 void FLEXCOMM1_DriverIRQHandler(void) ALIAS(IntDefaultHandler);
\r
163 void FLEXCOMM2_DriverIRQHandler(void) ALIAS(IntDefaultHandler);
\r
164 void FLEXCOMM3_DriverIRQHandler(void) ALIAS(IntDefaultHandler);
\r
165 void FLEXCOMM4_DriverIRQHandler(void) ALIAS(IntDefaultHandler);
\r
166 void FLEXCOMM5_DriverIRQHandler(void) ALIAS(IntDefaultHandler);
\r
167 void FLEXCOMM6_DriverIRQHandler(void) ALIAS(IntDefaultHandler);
\r
168 void FLEXCOMM7_DriverIRQHandler(void) ALIAS(IntDefaultHandler);
\r
169 void ADC0_DriverIRQHandler(void) ALIAS(IntDefaultHandler);
\r
170 void Reserved39_DriverIRQHandler(void) ALIAS(IntDefaultHandler);
\r
171 void ACMP_DriverIRQHandler(void) ALIAS(IntDefaultHandler);
\r
172 void Reserved41_DriverIRQHandler(void) ALIAS(IntDefaultHandler);
\r
173 void Reserved42_DriverIRQHandler(void) ALIAS(IntDefaultHandler);
\r
174 void USB0_NEEDCLK_DriverIRQHandler(void) ALIAS(IntDefaultHandler);
\r
175 void USB0_DriverIRQHandler(void) ALIAS(IntDefaultHandler);
\r
176 void RTC_DriverIRQHandler(void) ALIAS(IntDefaultHandler);
\r
177 void Reserved46_DriverIRQHandler(void) ALIAS(IntDefaultHandler);
\r
178 void MAILBOX_DriverIRQHandler(void) ALIAS(IntDefaultHandler);
\r
179 void PIN_INT4_DriverIRQHandler(void) ALIAS(IntDefaultHandler);
\r
180 void PIN_INT5_DriverIRQHandler(void) ALIAS(IntDefaultHandler);
\r
181 void PIN_INT6_DriverIRQHandler(void) ALIAS(IntDefaultHandler);
\r
182 void PIN_INT7_DriverIRQHandler(void) ALIAS(IntDefaultHandler);
\r
183 void CTIMER2_DriverIRQHandler(void) ALIAS(IntDefaultHandler);
\r
184 void CTIMER4_DriverIRQHandler(void) ALIAS(IntDefaultHandler);
\r
185 void OS_EVENT_DriverIRQHandler(void) ALIAS(IntDefaultHandler);
\r
186 void Reserved55_DriverIRQHandler(void) ALIAS(IntDefaultHandler);
\r
187 void Reserved56_DriverIRQHandler(void) ALIAS(IntDefaultHandler);
\r
188 void Reserved57_DriverIRQHandler(void) ALIAS(IntDefaultHandler);
\r
189 void SDIO_DriverIRQHandler(void) ALIAS(IntDefaultHandler);
\r
190 void Reserved59_DriverIRQHandler(void) ALIAS(IntDefaultHandler);
\r
191 void Reserved60_DriverIRQHandler(void) ALIAS(IntDefaultHandler);
\r
192 void Reserved61_DriverIRQHandler(void) ALIAS(IntDefaultHandler);
\r
193 void USB1_UTMI_DriverIRQHandler(void) ALIAS(IntDefaultHandler);
\r
194 void USB1_DriverIRQHandler(void) ALIAS(IntDefaultHandler);
\r
195 void USB1_NEEDCLK_DriverIRQHandler(void) ALIAS(IntDefaultHandler);
\r
196 void SEC_HYPERVISOR_CALL_DriverIRQHandler(void) ALIAS(IntDefaultHandler);
\r
197 void SEC_GPIO_INT0_IRQ0_DriverIRQHandler(void) ALIAS(IntDefaultHandler);
\r
198 void SEC_GPIO_INT0_IRQ1_DriverIRQHandler(void) ALIAS(IntDefaultHandler);
\r
199 void PLU_DriverIRQHandler(void) ALIAS(IntDefaultHandler);
\r
200 void SEC_VIO_DriverIRQHandler(void) ALIAS(IntDefaultHandler);
\r
201 void HASHCRYPT_DriverIRQHandler(void) ALIAS(IntDefaultHandler);
\r
202 void CASER_DriverIRQHandler(void) ALIAS(IntDefaultHandler);
\r
203 void PUF_DriverIRQHandler(void) ALIAS(IntDefaultHandler);
\r
204 void PQ_DriverIRQHandler(void) ALIAS(IntDefaultHandler);
\r
205 void DMA1_DriverIRQHandler(void) ALIAS(IntDefaultHandler);
\r
206 void LSPI_HS_DriverIRQHandler(void) ALIAS(IntDefaultHandler);
\r
208 //*****************************************************************************
\r
209 // The entry point for the application.
\r
210 // __main() is the entry point for Redlib based applications
\r
211 // main() is the entry point for Newlib based applications
\r
212 //*****************************************************************************
\r
213 #if defined (__REDLIB__)
\r
214 extern void __main(void);
\r
216 extern int main(void);
\r
218 //*****************************************************************************
\r
219 // External declaration for the pointer to the stack top from the Linker Script
\r
220 //*****************************************************************************
\r
221 extern void _vStackTop(void);
\r
222 //*****************************************************************************
\r
223 // External declaration for LPC MCU vector table checksum from Linker Script
\r
224 //*****************************************************************************
\r
225 WEAK extern void __valid_user_code_checksum();
\r
227 //*****************************************************************************
\r
228 //*****************************************************************************
\r
229 #if defined (__cplusplus)
\r
232 //*****************************************************************************
\r
233 // The vector table.
\r
234 // This relies on the linker script to place at correct location in memory.
\r
235 //*****************************************************************************
\r
236 extern void (* const g_pfnVectors[])(void);
\r
237 extern void * __Vectors __attribute__ ((alias ("g_pfnVectors")));
\r
239 __attribute__ ((used, section(".isr_vector")))
\r
240 void (* const g_pfnVectors[])(void) = {
\r
241 // Core Level - CM33
\r
242 &_vStackTop, // The initial stack pointer
\r
243 ResetISR, // The reset handler
\r
244 NMI_Handler, // The NMI handler
\r
245 HardFault_Handler, // The hard fault handler
\r
246 MemManage_Handler, // The MPU fault handler
\r
247 BusFault_Handler, // The bus fault handler
\r
248 UsageFault_Handler, // The usage fault handler
\r
249 __valid_user_code_checksum, // LPC MCU checksum
\r
253 SVC_Handler, // SVCall handler
\r
254 DebugMon_Handler, // Debug monitor handler
\r
256 PendSV_Handler, // The PendSV handler
\r
257 SysTick_Handler, // The SysTick handler
\r
259 // Chip Level - LPC55S69_cm33_core0
\r
260 WDT_BOD_IRQHandler, // 16: Windowed watchdog timer, Brownout detect, Flash interrupt
\r
261 DMA0_IRQHandler, // 17: DMA0 controller
\r
262 GINT0_IRQHandler, // 18: GPIO group 0
\r
263 GINT1_IRQHandler, // 19: GPIO group 1
\r
264 PIN_INT0_IRQHandler, // 20: Pin interrupt 0 or pattern match engine slice 0
\r
265 PIN_INT1_IRQHandler, // 21: Pin interrupt 1or pattern match engine slice 1
\r
266 PIN_INT2_IRQHandler, // 22: Pin interrupt 2 or pattern match engine slice 2
\r
267 PIN_INT3_IRQHandler, // 23: Pin interrupt 3 or pattern match engine slice 3
\r
268 UTICK0_IRQHandler, // 24: Micro-tick Timer
\r
269 MRT0_IRQHandler, // 25: Multi-rate timer
\r
270 CTIMER0_IRQHandler, // 26: Standard counter/timer CTIMER0
\r
271 CTIMER1_IRQHandler, // 27: Standard counter/timer CTIMER1
\r
272 SCT0_IRQHandler, // 28: SCTimer/PWM
\r
273 CTIMER3_IRQHandler, // 29: Standard counter/timer CTIMER3
\r
274 FLEXCOMM0_IRQHandler, // 30: Flexcomm Interface 0 (USART, SPI, I2C, I2S, FLEXCOMM)
\r
275 FLEXCOMM1_IRQHandler, // 31: Flexcomm Interface 1 (USART, SPI, I2C, I2S, FLEXCOMM)
\r
276 FLEXCOMM2_IRQHandler, // 32: Flexcomm Interface 2 (USART, SPI, I2C, I2S, FLEXCOMM)
\r
277 FLEXCOMM3_IRQHandler, // 33: Flexcomm Interface 3 (USART, SPI, I2C, I2S, FLEXCOMM)
\r
278 FLEXCOMM4_IRQHandler, // 34: Flexcomm Interface 4 (USART, SPI, I2C, I2S, FLEXCOMM)
\r
279 FLEXCOMM5_IRQHandler, // 35: Flexcomm Interface 5 (USART, SPI, I2C, I2S, FLEXCOMM)
\r
280 FLEXCOMM6_IRQHandler, // 36: Flexcomm Interface 6 (USART, SPI, I2C, I2S, FLEXCOMM)
\r
281 FLEXCOMM7_IRQHandler, // 37: Flexcomm Interface 7 (USART, SPI, I2C, I2S, FLEXCOMM)
\r
282 ADC0_IRQHandler, // 38: ADC0
\r
283 Reserved39_IRQHandler, // 39: Reserved interrupt
\r
284 ACMP_IRQHandler, // 40: ACMP interrupts
\r
285 Reserved41_IRQHandler, // 41: Reserved interrupt
\r
286 Reserved42_IRQHandler, // 42: Reserved interrupt
\r
287 USB0_NEEDCLK_IRQHandler, // 43: USB Activity Wake-up Interrupt
\r
288 USB0_IRQHandler, // 44: USB device
\r
289 RTC_IRQHandler, // 45: RTC alarm and wake-up interrupts
\r
290 Reserved46_IRQHandler, // 46: Reserved interrupt
\r
291 MAILBOX_IRQHandler, // 47: WAKEUP,Mailbox interrupt (present on selected devices)
\r
292 PIN_INT4_IRQHandler, // 48: Pin interrupt 4 or pattern match engine slice 4 int
\r
293 PIN_INT5_IRQHandler, // 49: Pin interrupt 5 or pattern match engine slice 5 int
\r
294 PIN_INT6_IRQHandler, // 50: Pin interrupt 6 or pattern match engine slice 6 int
\r
295 PIN_INT7_IRQHandler, // 51: Pin interrupt 7 or pattern match engine slice 7 int
\r
296 CTIMER2_IRQHandler, // 52: Standard counter/timer CTIMER2
\r
297 CTIMER4_IRQHandler, // 53: Standard counter/timer CTIMER4
\r
298 OS_EVENT_IRQHandler, // 54: OSEVTIMER0 and OSEVTIMER0_WAKEUP interrupts
\r
299 Reserved55_IRQHandler, // 55: Reserved interrupt
\r
300 Reserved56_IRQHandler, // 56: Reserved interrupt
\r
301 Reserved57_IRQHandler, // 57: Reserved interrupt
\r
302 SDIO_IRQHandler, // 58: SD/MMC
\r
303 Reserved59_IRQHandler, // 59: Reserved interrupt
\r
304 Reserved60_IRQHandler, // 60: Reserved interrupt
\r
305 Reserved61_IRQHandler, // 61: Reserved interrupt
\r
306 USB1_UTMI_IRQHandler, // 62: USB1_UTMI
\r
307 USB1_IRQHandler, // 63: USB1 interrupt
\r
308 USB1_NEEDCLK_IRQHandler, // 64: USB1 activity
\r
309 SEC_HYPERVISOR_CALL_IRQHandler, // 65: SEC_HYPERVISOR_CALL interrupt
\r
310 SEC_GPIO_INT0_IRQ0_IRQHandler, // 66: SEC_GPIO_INT0_IRQ0 interrupt
\r
311 SEC_GPIO_INT0_IRQ1_IRQHandler, // 67: SEC_GPIO_INT0_IRQ1 interrupt
\r
312 PLU_IRQHandler, // 68: PLU interrupt
\r
313 SEC_VIO_IRQHandler, // 69: SEC_VIO interrupt
\r
314 HASHCRYPT_IRQHandler, // 70: HASHCRYPT interrupt
\r
315 CASER_IRQHandler, // 71: CASPER interrupt
\r
316 PUF_IRQHandler, // 72: PUF interrupt
\r
317 PQ_IRQHandler, // 73: PQ interrupt
\r
318 DMA1_IRQHandler, // 74: DMA1 interrupt
\r
319 LSPI_HS_IRQHandler, // 75: Flexcomm Interface 8 (SPI, , FLEXCOMM)
\r
321 }; /* End of g_pfnVectors */
\r
323 //*****************************************************************************
\r
324 // Functions to carry out the initialization of RW and BSS data sections. These
\r
325 // are written as separate functions rather than being inlined within the
\r
326 // ResetISR() function in order to cope with MCUs with multiple banks of
\r
328 //*****************************************************************************
\r
329 __attribute__ ((section(".after_vectors.init_data")))
\r
330 void data_init(unsigned int romstart, unsigned int start, unsigned int len) {
\r
331 unsigned int *pulDest = (unsigned int*) start;
\r
332 unsigned int *pulSrc = (unsigned int*) romstart;
\r
334 for (loop = 0; loop < len; loop = loop + 4)
\r
335 *pulDest++ = *pulSrc++;
\r
338 __attribute__ ((section(".after_vectors.init_bss")))
\r
339 void bss_init(unsigned int start, unsigned int len) {
\r
340 unsigned int *pulDest = (unsigned int*) start;
\r
342 for (loop = 0; loop < len; loop = loop + 4)
\r
346 //*****************************************************************************
\r
347 // The following symbols are constructs generated by the linker, indicating
\r
348 // the location of various points in the "Global Section Table". This table is
\r
349 // created by the linker via the Code Red managed linker script mechanism. It
\r
350 // contains the load address, execution address and length of each RW data
\r
351 // section and the execution and length of each BSS (zero initialized) section.
\r
352 //*****************************************************************************
\r
353 extern unsigned int __data_section_table;
\r
354 extern unsigned int __data_section_table_end;
\r
355 extern unsigned int __bss_section_table;
\r
356 extern unsigned int __bss_section_table_end;
\r
358 //*****************************************************************************
\r
359 // Reset entry point for your code.
\r
360 // Sets up a simple runtime environment and initializes the C/C++
\r
362 //*****************************************************************************
\r
363 __attribute__ ((section(".after_vectors.reset")))
\r
364 void ResetISR(void) {
\r
366 // Disable interrupts
\r
367 __asm volatile ("cpsid i");
\r
369 #if defined (__USE_CMSIS)
\r
370 // If __USE_CMSIS defined, then call CMSIS SystemInit code
\r
373 #endif // (__USE_CMSIS)
\r
376 // Copy the data sections from flash to SRAM.
\r
378 unsigned int LoadAddr, ExeAddr, SectionLen;
\r
379 unsigned int *SectionTableAddr;
\r
381 // Load base address of Global Section Table
\r
382 SectionTableAddr = &__data_section_table;
\r
384 // Copy the data sections from flash to SRAM.
\r
385 while (SectionTableAddr < &__data_section_table_end) {
\r
386 LoadAddr = *SectionTableAddr++;
\r
387 ExeAddr = *SectionTableAddr++;
\r
388 SectionLen = *SectionTableAddr++;
\r
389 data_init(LoadAddr, ExeAddr, SectionLen);
\r
392 // At this point, SectionTableAddr = &__bss_section_table;
\r
393 // Zero fill the bss segment
\r
394 while (SectionTableAddr < &__bss_section_table_end) {
\r
395 ExeAddr = *SectionTableAddr++;
\r
396 SectionLen = *SectionTableAddr++;
\r
397 bss_init(ExeAddr, SectionLen);
\r
401 #if !defined (__USE_CMSIS)
\r
402 // Assume that if __USE_CMSIS defined, then CMSIS SystemInit code
\r
403 // will setup the VTOR register
\r
405 // Check to see if we are running the code from a non-zero
\r
406 // address (eg RAM, external flash), in which case we need
\r
407 // to modify the VTOR register to tell the CPU that the
\r
408 // vector table is located at a non-0x0 address.
\r
409 unsigned int * pSCB_VTOR = (unsigned int *) 0xE000ED08;
\r
410 if ((unsigned int *)g_pfnVectors!=(unsigned int *) 0x00000000) {
\r
411 *pSCB_VTOR = (unsigned int)g_pfnVectors;
\r
413 #endif // (__USE_CMSIS)
\r
414 #if defined (__cplusplus)
\r
416 // Call C++ library initialisation
\r
418 __libc_init_array();
\r
421 // Reenable interrupts
\r
422 __asm volatile ("cpsie i");
\r
424 #if defined (__REDLIB__)
\r
425 // Call the Redlib library, which in turn calls main()
\r
432 // main() shouldn't return, but if it does, we'll just enter an infinite loop
\r
439 //*****************************************************************************
\r
440 // Default core exception handlers. Override the ones here by defining your own
\r
441 // handler routines in your application code.
\r
442 //*****************************************************************************
\r
443 WEAK_AV void NMI_Handler(void)
\r
447 WEAK_AV void HardFault_Handler(void)
\r
451 WEAK_AV void MemManage_Handler(void)
\r
455 WEAK_AV void BusFault_Handler(void)
\r
459 WEAK_AV void UsageFault_Handler(void)
\r
463 WEAK_AV void SVC_Handler(void)
\r
467 WEAK_AV void DebugMon_Handler(void)
\r
471 WEAK_AV void PendSV_Handler(void)
\r
475 WEAK_AV void SysTick_Handler(void)
\r
479 //*****************************************************************************
\r
480 // Processor ends up here if an unexpected interrupt occurs or a specific
\r
481 // handler is not present in the application code.
\r
482 //*****************************************************************************
\r
483 WEAK_AV void IntDefaultHandler(void)
\r
487 //*****************************************************************************
\r
488 // Default application exception handlers. Override the ones here by defining
\r
489 // your own handler routines in your application code. These routines call
\r
490 // driver exception handlers or IntDefaultHandler() if no driver exception
\r
491 // handler is included.
\r
492 //*****************************************************************************
\r
493 WEAK void WDT_BOD_IRQHandler(void)
\r
494 { WDT_BOD_DriverIRQHandler();
\r
497 WEAK void DMA0_IRQHandler(void)
\r
498 { DMA0_DriverIRQHandler();
\r
501 WEAK void GINT0_IRQHandler(void)
\r
502 { GINT0_DriverIRQHandler();
\r
505 WEAK void GINT1_IRQHandler(void)
\r
506 { GINT1_DriverIRQHandler();
\r
509 WEAK void PIN_INT0_IRQHandler(void)
\r
510 { PIN_INT0_DriverIRQHandler();
\r
513 WEAK void PIN_INT1_IRQHandler(void)
\r
514 { PIN_INT1_DriverIRQHandler();
\r
517 WEAK void PIN_INT2_IRQHandler(void)
\r
518 { PIN_INT2_DriverIRQHandler();
\r
521 WEAK void PIN_INT3_IRQHandler(void)
\r
522 { PIN_INT3_DriverIRQHandler();
\r
525 WEAK void UTICK0_IRQHandler(void)
\r
526 { UTICK0_DriverIRQHandler();
\r
529 WEAK void MRT0_IRQHandler(void)
\r
530 { MRT0_DriverIRQHandler();
\r
533 WEAK void CTIMER0_IRQHandler(void)
\r
534 { CTIMER0_DriverIRQHandler();
\r
537 WEAK void CTIMER1_IRQHandler(void)
\r
538 { CTIMER1_DriverIRQHandler();
\r
541 WEAK void SCT0_IRQHandler(void)
\r
542 { SCT0_DriverIRQHandler();
\r
545 WEAK void CTIMER3_IRQHandler(void)
\r
546 { CTIMER3_DriverIRQHandler();
\r
549 WEAK void FLEXCOMM0_IRQHandler(void)
\r
550 { FLEXCOMM0_DriverIRQHandler();
\r
553 WEAK void FLEXCOMM1_IRQHandler(void)
\r
554 { FLEXCOMM1_DriverIRQHandler();
\r
557 WEAK void FLEXCOMM2_IRQHandler(void)
\r
558 { FLEXCOMM2_DriverIRQHandler();
\r
561 WEAK void FLEXCOMM3_IRQHandler(void)
\r
562 { FLEXCOMM3_DriverIRQHandler();
\r
565 WEAK void FLEXCOMM4_IRQHandler(void)
\r
566 { FLEXCOMM4_DriverIRQHandler();
\r
569 WEAK void FLEXCOMM5_IRQHandler(void)
\r
570 { FLEXCOMM5_DriverIRQHandler();
\r
573 WEAK void FLEXCOMM6_IRQHandler(void)
\r
574 { FLEXCOMM6_DriverIRQHandler();
\r
577 WEAK void FLEXCOMM7_IRQHandler(void)
\r
578 { FLEXCOMM7_DriverIRQHandler();
\r
581 WEAK void ADC0_IRQHandler(void)
\r
582 { ADC0_DriverIRQHandler();
\r
585 WEAK void Reserved39_IRQHandler(void)
\r
586 { Reserved39_DriverIRQHandler();
\r
589 WEAK void ACMP_IRQHandler(void)
\r
590 { ACMP_DriverIRQHandler();
\r
593 WEAK void Reserved41_IRQHandler(void)
\r
594 { Reserved41_DriverIRQHandler();
\r
597 WEAK void Reserved42_IRQHandler(void)
\r
598 { Reserved42_DriverIRQHandler();
\r
601 WEAK void USB0_NEEDCLK_IRQHandler(void)
\r
602 { USB0_NEEDCLK_DriverIRQHandler();
\r
605 WEAK void USB0_IRQHandler(void)
\r
606 { USB0_DriverIRQHandler();
\r
609 WEAK void RTC_IRQHandler(void)
\r
610 { RTC_DriverIRQHandler();
\r
613 WEAK void Reserved46_IRQHandler(void)
\r
614 { Reserved46_DriverIRQHandler();
\r
617 WEAK void MAILBOX_IRQHandler(void)
\r
618 { MAILBOX_DriverIRQHandler();
\r
621 WEAK void PIN_INT4_IRQHandler(void)
\r
622 { PIN_INT4_DriverIRQHandler();
\r
625 WEAK void PIN_INT5_IRQHandler(void)
\r
626 { PIN_INT5_DriverIRQHandler();
\r
629 WEAK void PIN_INT6_IRQHandler(void)
\r
630 { PIN_INT6_DriverIRQHandler();
\r
633 WEAK void PIN_INT7_IRQHandler(void)
\r
634 { PIN_INT7_DriverIRQHandler();
\r
637 WEAK void CTIMER2_IRQHandler(void)
\r
638 { CTIMER2_DriverIRQHandler();
\r
641 WEAK void CTIMER4_IRQHandler(void)
\r
642 { CTIMER4_DriverIRQHandler();
\r
645 WEAK void OS_EVENT_IRQHandler(void)
\r
646 { OS_EVENT_DriverIRQHandler();
\r
649 WEAK void Reserved55_IRQHandler(void)
\r
650 { Reserved55_DriverIRQHandler();
\r
653 WEAK void Reserved56_IRQHandler(void)
\r
654 { Reserved56_DriverIRQHandler();
\r
657 WEAK void Reserved57_IRQHandler(void)
\r
658 { Reserved57_DriverIRQHandler();
\r
661 WEAK void SDIO_IRQHandler(void)
\r
662 { SDIO_DriverIRQHandler();
\r
665 WEAK void Reserved59_IRQHandler(void)
\r
666 { Reserved59_DriverIRQHandler();
\r
669 WEAK void Reserved60_IRQHandler(void)
\r
670 { Reserved60_DriverIRQHandler();
\r
673 WEAK void Reserved61_IRQHandler(void)
\r
674 { Reserved61_DriverIRQHandler();
\r
677 WEAK void USB1_UTMI_IRQHandler(void)
\r
678 { USB1_UTMI_DriverIRQHandler();
\r
681 WEAK void USB1_IRQHandler(void)
\r
682 { USB1_DriverIRQHandler();
\r
685 WEAK void USB1_NEEDCLK_IRQHandler(void)
\r
686 { USB1_NEEDCLK_DriverIRQHandler();
\r
689 WEAK void SEC_HYPERVISOR_CALL_IRQHandler(void)
\r
690 { SEC_HYPERVISOR_CALL_DriverIRQHandler();
\r
693 WEAK void SEC_GPIO_INT0_IRQ0_IRQHandler(void)
\r
694 { SEC_GPIO_INT0_IRQ0_DriverIRQHandler();
\r
697 WEAK void SEC_GPIO_INT0_IRQ1_IRQHandler(void)
\r
698 { SEC_GPIO_INT0_IRQ1_DriverIRQHandler();
\r
701 WEAK void PLU_IRQHandler(void)
\r
702 { PLU_DriverIRQHandler();
\r
705 WEAK void SEC_VIO_IRQHandler(void)
\r
706 { SEC_VIO_DriverIRQHandler();
\r
709 WEAK void HASHCRYPT_IRQHandler(void)
\r
710 { HASHCRYPT_DriverIRQHandler();
\r
713 WEAK void CASER_IRQHandler(void)
\r
714 { CASER_DriverIRQHandler();
\r
717 WEAK void PUF_IRQHandler(void)
\r
718 { PUF_DriverIRQHandler();
\r
721 WEAK void PQ_IRQHandler(void)
\r
722 { PQ_DriverIRQHandler();
\r
725 WEAK void DMA1_IRQHandler(void)
\r
726 { DMA1_DriverIRQHandler();
\r
729 WEAK void LSPI_HS_IRQHandler(void)
\r
730 { LSPI_HS_DriverIRQHandler();
\r
733 //*****************************************************************************
\r
735 #if defined (DEBUG)
\r
736 #pragma GCC pop_options
\r