1 //*****************************************************************************
\r
3 // startup_ewarm.c - Boot code for Stellaris.
\r
5 // Copyright (c) 2005,2006 Luminary Micro, Inc. All rights reserved.
\r
7 // Software License Agreement
\r
9 // Luminary Micro, Inc. (LMI) is supplying this software for use solely and
\r
10 // exclusively on LMI's Stellaris Family of microcontroller products.
\r
12 // The software is owned by LMI and/or its suppliers, and is protected under
\r
13 // applicable copyright laws. All rights are reserved. Any use in violation
\r
14 // of the foregoing restrictions may subject the user to criminal sanctions
\r
15 // under applicable laws, as well as to civil liability for the breach of the
\r
16 // terms and conditions of this license.
\r
18 // THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
\r
19 // OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
\r
20 // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
\r
21 // LMI SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
\r
22 // CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
\r
24 // This is part of revision 991 of the Stellaris Driver Library.
\r
26 //*****************************************************************************
\r
28 //*****************************************************************************
\r
30 // Enable the IAR extensions for this source file.
\r
32 //*****************************************************************************
\r
33 #pragma language=extended
\r
35 //*****************************************************************************
\r
37 // Forward declaration of the default fault handlers.
\r
39 //*****************************************************************************
\r
40 static void NmiSR(void);
\r
41 static void FaultISR(void);
\r
42 static void IntDefaultHandler(void);
\r
44 //*****************************************************************************
\r
46 // The entry point for the application.
\r
48 //*****************************************************************************
\r
49 extern void __iar_program_start(void);
\r
51 //*****************************************************************************
\r
53 // External declaration for the interrupt handler used by the application.
\r
55 //*****************************************************************************
\r
56 extern void xPortPendSVHandler(void);
\r
57 extern void xPortSysTickHandler(void);
\r
58 extern void vGPIO_ISR(void);
\r
59 extern void vUART_ISR(void);
\r
61 //*****************************************************************************
\r
63 // Reserve space for the system stack.
\r
65 //*****************************************************************************
\r
67 #define STACK_SIZE 64
\r
69 static unsigned long pulStack[STACK_SIZE] @ ".noinit";
\r
71 //*****************************************************************************
\r
73 // A union that describes the entries of the vector table. The union is needed
\r
74 // since the first entry is the stack pointer and the remainder are function
\r
77 //*****************************************************************************
\r
80 void (*pfnHandler)(void);
\r
81 unsigned long ulPtr;
\r
85 //*****************************************************************************
\r
87 // The minimal vector table for a Cortex M3. Note that the proper constructs
\r
88 // must be placed on this to ensure that it ends up at physical address
\r
91 //*****************************************************************************
\r
92 __root const uVectorEntry __vector_table[] @ ".intvec" =
\r
94 { .ulPtr = (unsigned long)pulStack + sizeof(pulStack) },
\r
95 // The initial stack pointer
\r
96 __iar_program_start, // The reset handler
\r
97 NmiSR, // The NMI handler
\r
98 FaultISR, // The hard fault handler
\r
99 IntDefaultHandler, // The MPU fault handler
\r
100 IntDefaultHandler, // The bus fault handler
\r
101 IntDefaultHandler, // The usage fault handler
\r
106 IntDefaultHandler, // SVCall handler
\r
107 IntDefaultHandler, // Debug monitor handler
\r
109 xPortPendSVHandler, // The PendSV handler
\r
110 xPortSysTickHandler, // The SysTick handler
\r
111 IntDefaultHandler, // GPIO Port A
\r
112 IntDefaultHandler, // GPIO Port B
\r
113 vGPIO_ISR, // GPIO Port C
\r
114 IntDefaultHandler, // GPIO Port D
\r
115 IntDefaultHandler, // GPIO Port E
\r
116 vUART_ISR, // UART0 Rx and Tx
\r
117 IntDefaultHandler, // UART1 Rx and Tx
\r
118 IntDefaultHandler, // SSI Rx and Tx
\r
119 IntDefaultHandler, // I2C Master and Slave
\r
120 IntDefaultHandler, // PWM Fault
\r
121 IntDefaultHandler, // PWM Generator 0
\r
122 IntDefaultHandler, // PWM Generator 1
\r
123 IntDefaultHandler, // PWM Generator 2
\r
124 IntDefaultHandler, // Quadrature Encoder
\r
125 IntDefaultHandler, // ADC Sequence 0
\r
126 IntDefaultHandler, // ADC Sequence 1
\r
127 IntDefaultHandler, // ADC Sequence 2
\r
128 IntDefaultHandler, // ADC Sequence 3
\r
129 IntDefaultHandler, // Watchdog timer
\r
130 IntDefaultHandler, // Timer 0 subtimer A
\r
131 IntDefaultHandler, // Timer 0 subtimer B
\r
132 IntDefaultHandler, // Timer 1 subtimer A
\r
133 IntDefaultHandler, // Timer 1 subtimer B
\r
134 IntDefaultHandler, // Timer 2 subtimer A
\r
135 IntDefaultHandler, // Timer 2 subtimer B
\r
136 IntDefaultHandler, // Analog Comparator 0
\r
137 IntDefaultHandler, // Analog Comparator 1
\r
138 IntDefaultHandler, // Analog Comparator 2
\r
139 IntDefaultHandler, // System Control (PLL, OSC, BO)
\r
140 IntDefaultHandler // FLASH Control
\r
144 //*****************************************************************************
\r
146 // This is the code that gets called when the processor receives a NMI. This
\r
147 // simply enters an infinite loop, preserving the system state for examination
\r
150 //*****************************************************************************
\r
155 // Enter an infinite loop.
\r
162 //*****************************************************************************
\r
164 // This is the code that gets called when the processor receives a fault
\r
165 // interrupt. This simply enters an infinite loop, preserving the system state
\r
166 // for examination by a debugger.
\r
168 //*****************************************************************************
\r
173 // Enter an infinite loop.
\r
180 //*****************************************************************************
\r
182 // This is the code that gets called when the processor receives an unexpected
\r
183 // interrupt. This simply enters an infinite loop, preserving the system state
\r
184 // for examination by a debugger.
\r
186 //*****************************************************************************
\r
188 IntDefaultHandler(void)
\r
191 // Go into an infinite loop.
\r