1 //*****************************************************************************
\r
3 // startup_ewarm.c - Boot code for Stellaris.
\r
5 // Copyright (c) 2006-2007 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 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 100 of the Stellaris Ethernet
\r
25 // Applications Library.
\r
27 //*****************************************************************************
\r
29 //*****************************************************************************
\r
31 // Enable the IAR extensions for this source file.
\r
33 //*****************************************************************************
\r
34 #pragma language=extended
\r
36 //*****************************************************************************
\r
38 // Forward declaration of the default fault handlers.
\r
40 //*****************************************************************************
\r
41 static void NmiSR(void);
\r
42 static void FaultISR(void);
\r
43 static void IntDefaultHandler(void);
\r
45 //*****************************************************************************
\r
47 // External declaration for the interrupt handler used by the application.
\r
49 //*****************************************************************************
\r
52 //*****************************************************************************
\r
54 // The entry point for the application.
\r
56 //*****************************************************************************
\r
57 extern void __iar_program_start(void);
\r
58 extern void xPortPendSVHandler(void);
\r
59 extern void xPortSysTickHandler(void);
\r
60 extern void vPortSVCHandler(void);
\r
61 extern void vT2InterruptHandler( void );
\r
62 extern void vT3InterruptHandler( void );
\r
63 extern void vEMAC_ISR( void );
\r
64 extern void Timer0IntHandler( void );
\r
66 //*****************************************************************************
\r
68 // Reserve space for the system stack.
\r
70 //*****************************************************************************
\r
72 #define STACK_SIZE 120
\r
74 static unsigned long pulStack[STACK_SIZE] @ ".noinit";
\r
76 //*****************************************************************************
\r
78 // A union that describes the entries of the vector table. The union is needed
\r
79 // since the first entry is the stack pointer and the remainder are function
\r
82 //*****************************************************************************
\r
85 void (*pfnHandler)(void);
\r
86 unsigned long ulPtr;
\r
90 //*****************************************************************************
\r
92 // The minimal vector table for a Cortex-M3. Note that the proper constructs
\r
93 // must be placed on this to ensure that it ends up at physical address
\r
96 //*****************************************************************************
\r
97 __root const uVectorEntry __vector_table[] @ ".intvec" =
\r
99 { .ulPtr = (unsigned long)pulStack + sizeof(pulStack) },
\r
100 // The initial stack pointer
\r
101 __iar_program_start, // The reset handler
\r
102 NmiSR, // The NMI handler
\r
103 FaultISR, // The hard fault handler
\r
104 IntDefaultHandler, // The MPU fault handler
\r
105 IntDefaultHandler, // The bus fault handler
\r
106 IntDefaultHandler, // The usage fault handler
\r
111 vPortSVCHandler, // SVCall handler
\r
112 IntDefaultHandler, // Debug monitor handler
\r
114 xPortPendSVHandler, // The PendSV handler
\r
115 xPortSysTickHandler, // The SysTick handler
\r
116 IntDefaultHandler, // GPIO Port A
\r
117 IntDefaultHandler, // GPIO Port B
\r
118 IntDefaultHandler, // GPIO Port C
\r
119 IntDefaultHandler, // GPIO Port D
\r
120 IntDefaultHandler, // GPIO Port E
\r
121 IntDefaultHandler, // UART0 Rx and Tx
\r
122 IntDefaultHandler, // UART1 Rx and Tx
\r
123 IntDefaultHandler, // SSI Rx and Tx
\r
124 IntDefaultHandler, // I2C Master and Slave
\r
125 IntDefaultHandler, // PWM Fault
\r
126 IntDefaultHandler, // PWM Generator 0
\r
127 IntDefaultHandler, // PWM Generator 1
\r
128 IntDefaultHandler, // PWM Generator 2
\r
129 IntDefaultHandler, // Quadrature Encoder
\r
130 IntDefaultHandler, // ADC Sequence 0
\r
131 IntDefaultHandler, // ADC Sequence 1
\r
132 IntDefaultHandler, // ADC Sequence 2
\r
133 IntDefaultHandler, // ADC Sequence 3
\r
134 IntDefaultHandler, // Watchdog timer
\r
135 Timer0IntHandler, // Timer 0 subtimer A
\r
136 IntDefaultHandler, // Timer 0 subtimer B
\r
137 IntDefaultHandler, // Timer 1 subtimer A
\r
138 IntDefaultHandler, // Timer 1 subtimer B
\r
139 vT2InterruptHandler, // Timer 2 subtimer A
\r
140 IntDefaultHandler, // Timer 2 subtimer B
\r
141 IntDefaultHandler, // Analog Comparator 0
\r
142 IntDefaultHandler, // Analog Comparator 1
\r
143 IntDefaultHandler, // Analog Comparator 2
\r
144 IntDefaultHandler, // System Control (PLL, OSC, BO)
\r
145 IntDefaultHandler, // FLASH Control
\r
146 IntDefaultHandler, // GPIO Port F
\r
147 IntDefaultHandler, // GPIO Port G
\r
148 IntDefaultHandler, // GPIO Port H
\r
149 IntDefaultHandler, // UART2 Rx and Tx
\r
150 IntDefaultHandler, // SSI1 Rx and Tx
\r
151 vT3InterruptHandler, // Timer 3 subtimer A
\r
152 IntDefaultHandler, // Timer 3 subtimer B
\r
153 IntDefaultHandler, // I2C1 Master and Slave
\r
154 IntDefaultHandler, // Quadrature Encoder 1
\r
155 IntDefaultHandler, // CAN0
\r
156 IntDefaultHandler, // CAN1
\r
157 IntDefaultHandler, // CAN2
\r
158 vEMAC_ISR, // Ethernet
\r
159 IntDefaultHandler, // Hibernate
\r
160 IntDefaultHandler, // USB0
\r
161 IntDefaultHandler, // PWM Generator 3
\r
162 IntDefaultHandler, // uDMA Software Transfer
\r
163 IntDefaultHandler // uDMA Error
\r
167 //*****************************************************************************
\r
169 // This is the code that gets called when the processor receives a NMI. This
\r
170 // simply enters an infinite loop, preserving the system state for examination
\r
173 //*****************************************************************************
\r
178 // Enter an infinite loop.
\r
185 //*****************************************************************************
\r
187 // This is the code that gets called when the processor receives a fault
\r
188 // interrupt. This simply enters an infinite loop, preserving the system state
\r
189 // for examination by a debugger.
\r
191 //*****************************************************************************
\r
196 // Enter an infinite loop.
\r
203 //*****************************************************************************
\r
205 // This is the code that gets called when the processor receives an unexpected
\r
206 // interrupt. This simply enters an infinite loop, preserving the system state
\r
207 // for examination by a debugger.
\r
209 //*****************************************************************************
\r
211 IntDefaultHandler(void)
\r
214 // Go into an infinite loop.
\r