2 * This is an ARM Cortex-M3 startup file for the NXP LPC1768.
4 * TODO: Add vendor (NXP) specific interrupt vectors.
6 * See also: http://bitbucket.org/jpc/lpc1768/
8 * Copyright (c) 2010 LoEE - Jakub Piotr Cłapa
9 * This program is released under the new BSD license.
11 #include "CMSIS/LPC17xx.h"
14 void Default_Handler (void) { while (1); }
16 // Weakly bind all interrupt vectors to the dummy handler.
17 void __attribute__((weak)) Reset_Handler(void);
18 void __attribute__((weak)) NMI_Handler(void);
19 void __attribute__((weak)) HardFault_Handler(void);
20 void __attribute__((weak)) MemManage_Handler(void);
21 void __attribute__((weak)) BusFault_Handler(void);
22 void __attribute__((weak)) UsageFault_Handler(void);
23 void __attribute__((weak)) SVC_Handler(void);
24 void __attribute__((weak)) DebugMon_Handler(void);
25 void __attribute__((weak)) PendSV_Handler(void);
26 void __attribute__((weak)) SysTick_Handler(void);
27 #pragma weak NMI_Handler = Default_Handler
28 #pragma weak HardFault_Handler = Default_Handler
29 #pragma weak MemManage_Handler = Default_Handler
30 #pragma weak BusFault_Handler = Default_Handler
31 #pragma weak UsageFault_Handler = Default_Handler
32 #pragma weak SVC_Handler = Default_Handler
33 #pragma weak DebugMon_Handler = Default_Handler
34 #pragma weak PendSV_Handler = Default_Handler
35 #pragma weak SysTick_Handler = Default_Handler
37 // Start of the stack (last RAM address; exported in the linker script)
40 // The signature of Cortex-M3 interrupt handlers.
41 typedef void (* const Interrupt_Handler_P)(void);
43 // Interrupt vectors table
44 __attribute__ ((section(".cs3.interrupt_vector")))
45 Interrupt_Handler_P interrupt_vectors[] = {
46 &_sstack, // the first word contains the initial
47 // stack pointer the hardware loads it
48 // to the SP register before the first
50 // Standard Cortex-M3 interrupts:
66 // Vendor specific interrupts for LPC1768:
69 extern int main (void);
71 extern uint32_t _etext, _sdata, _edata, _sbss, _ebss;
80 // Copy initialization data to RAM (.data section)
83 while (d < &_edata) *d++ = *s++;
84 // Zero the remaining allocated RAM (.bss section)
86 while (d < &_ebss) *d++ = 0;
88 // Everything is ready. Run the user program.