-
Notifications
You must be signed in to change notification settings - Fork 2
/
startup_ccs.c
199 lines (188 loc) · 7.54 KB
/
startup_ccs.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
//###########################################################################
// FILE: startup_ccs.c
// TITLE: Startup code for use with TI's Code Composer Studio.
//###########################################################################
// $TI Release: F28M35x Driver Library v100 $
// $Release Date: October 12, 2011 $
//###########################################################################
//*****************************************************************************
// Forward declaration of the default fault handlers.
//*****************************************************************************
void ResetISR(void);
static void NmiSR(void);
static void FaultISR(void);
static void IntDefaultHandler(void);
//*****************************************************************************
// External declaration for the reset handler that is to be called when the
// processor is started
//*****************************************************************************
extern void _c_int00(void);
//*****************************************************************************
// Linker variable that marks the top of the stack.
//*****************************************************************************
extern unsigned long __STACK_TOP;
//*****************************************************************************
// External declarations for the interrupt handlers used by the application.
//*****************************************************************************
//*****************************************************************************
// The vector table. Note that the proper constructs must be placed on this to
// ensure that it ends up at physical address 0x0000.0000 or at the start of
// the program if located at a start address other than 0.
//*****************************************************************************
#pragma DATA_SECTION(g_pfnVectors, ".intvecs")
void (* const g_pfnVectors[])(void) =
{
(void (*) (void))((unsigned long)&__STACK_TOP),
// The initial stack pointer
ResetISR,// The reset handler
NmiSR,// The NMI handler
FaultISR,// The hard fault handler
IntDefaultHandler,// The MPU fault handler
IntDefaultHandler,// The bus fault handler
IntDefaultHandler,// The usage fault handler
0,// Reserved
0,// Reserved
0,// Reserved
0,// Reserved
IntDefaultHandler,// SVCall handler
IntDefaultHandler,// Debug monitor handler
0,// Reserved
IntDefaultHandler,// The PendSV handler
IntDefaultHandler,// The SysTick handler
IntDefaultHandler,// GPIO Port A
IntDefaultHandler,// GPIO Port B
IntDefaultHandler,// GPIO Port C
IntDefaultHandler,// GPIO Port D
IntDefaultHandler,// GPIO Port E
IntDefaultHandler,// UART0 Rx and Tx
IntDefaultHandler,// UART1 Rx and Tx
IntDefaultHandler,// SSI0 Rx and Tx
IntDefaultHandler,// I2C0 Master and Slave
IntDefaultHandler,// Reserved
IntDefaultHandler,// Reserved
IntDefaultHandler,// Reserved
IntDefaultHandler,// Reserved
IntDefaultHandler,// Reserved
IntDefaultHandler,// Reserved
IntDefaultHandler,// Reserved
IntDefaultHandler,// Reserved
IntDefaultHandler,// Reserved
IntDefaultHandler,// Watchdog timer
IntDefaultHandler,// Timer 0 subtimer A
IntDefaultHandler,// Timer 0 subtimer B
IntDefaultHandler,// Timer 1 subtimer A
IntDefaultHandler,// Timer 1 subtimer B
IntDefaultHandler,// Timer 2 subtimer A
IntDefaultHandler,// Timer 2 subtimer B
IntDefaultHandler,// Reserved
IntDefaultHandler,// Reserved
IntDefaultHandler,// Reserved
IntDefaultHandler,// System Control
IntDefaultHandler,// FLASH Control
IntDefaultHandler,// GPIO Port F
IntDefaultHandler,// GPIO Port G
IntDefaultHandler,// GPIO Port H
IntDefaultHandler,// UART2 Rx and Tx
IntDefaultHandler,// SSI1 Rx and Tx
IntDefaultHandler,// Timer 3 subtimer A
IntDefaultHandler,// Timer 3 subtimer B
IntDefaultHandler,// I2C1 Master and Slave
IntDefaultHandler,// Reserved
IntDefaultHandler,// Reserved
IntDefaultHandler,// Reserved
IntDefaultHandler,// Reserved
IntDefaultHandler,// EMAC
IntDefaultHandler,// Reserved
IntDefaultHandler,// USB0
IntDefaultHandler,// Reserved
IntDefaultHandler,// uDMA Software Transfer
IntDefaultHandler,// uDMA Error
IntDefaultHandler,// Reserved
IntDefaultHandler,// Reserved
IntDefaultHandler,// Reserved
IntDefaultHandler,// Reserved
IntDefaultHandler,// Reserved
IntDefaultHandler,// External Peripheral Interface
IntDefaultHandler,// GPIO Port J
IntDefaultHandler,// Reserved
IntDefaultHandler,// Reserved
IntDefaultHandler,// SSI2
IntDefaultHandler,// SSI3
IntDefaultHandler,// UART3
IntDefaultHandler,// UART4
IntDefaultHandler,// Reserved
IntDefaultHandler,// Reserved
IntDefaultHandler,// Reserved
IntDefaultHandler,// CAN0 INT0
IntDefaultHandler,// CAN0 INT1
IntDefaultHandler,// CAN1 INT0
IntDefaultHandler,// CAN1 INT1
IntDefaultHandler,// Reserved
IntDefaultHandler,// Reserved
IntDefaultHandler,// Reserved
IntDefaultHandler,// Reserved
IntDefaultHandler,// ADCINT1
IntDefaultHandler,// ADCINT2
IntDefaultHandler,// ADCINT3
IntDefaultHandler,// ADCINT4
IntDefaultHandler,// ADCINT5
IntDefaultHandler,// ADCINT6
IntDefaultHandler,// ADCINT7
IntDefaultHandler,// ADCINT8
IntDefaultHandler,// CTOMIPC1
IntDefaultHandler,// CTOMIPC2
IntDefaultHandler,// CTOMIPC3
IntDefaultHandler,// CTOMIPC4
IntDefaultHandler,// Reserved
IntDefaultHandler,// Reserved
IntDefaultHandler,// Reserved
IntDefaultHandler,// Reserved
IntDefaultHandler,// RAM Single Error
IntDefaultHandler,// System/USB PLL Out of Lock
IntDefaultHandler,// M3 Flash Single Error
IntDefaultHandler// Reserved
};
//*****************************************************************************
// This is the code that gets called when the processor first starts execution
// following a reset event. Only the absolutely necessary set is performed,
// after which the application supplied entry() routine is called. Any fancy
// actions (such as making decisions based on the reset cause register, and
// resetting the bits in that register) are left solely in the hands of the
// application.
//*****************************************************************************
#pragma CODE_SECTION(ResetISR, ".resetisr")
void ResetISR(void) {
// Jump to the CCS C Initialization Routine.
__asm(" .global _c_int00\n"
" b.w _c_int00");
}
//*****************************************************************************
// This is the code that gets called when the processor receives a NMI. This
// simply enters an infinite loop, preserving the system state for examination
// by a debugger.
//*****************************************************************************
static void NmiSR(void) {
// Enter an infinite loop.
while (1) {
}
}
//*****************************************************************************
// This is the code that gets called when the processor receives a fault
// interrupt. This simply enters an infinite loop, preserving the system state
// for examination by a debugger.
//*****************************************************************************
static void FaultISR(void) {
// Enter an infinite loop.
while (1) {
}
}
//*****************************************************************************
// This is the code that gets called when the processor receives an unexpected
// interrupt. This simply enters an infinite loop, preserving the system state
// for examination by a debugger.
//*****************************************************************************
static void IntDefaultHandler(void) {
// Go into an infinite loop.
while (1) {
}
}