Statistics
| Branch: | Tag: | Revision:

mongoose / examples / TM4C129 / ccs / Mongoose_TM4C129_BM / startup_ccs.c @ eaef5bd1

History | View | Annotate | Download (13.2 KB)

1
/* clang-format off */
2
//*****************************************************************************
3
//
4
// startup_ccs.c - Startup code for use with TI's Code Composer Studio.
5
//
6
// Copyright (c) 2013-2016 Texas Instruments Incorporated.  All rights reserved.
7
// Software License Agreement
8
// 
9
// Texas Instruments (TI) is supplying this software for use solely and
10
// exclusively on TI's microcontroller products. The software is owned by
11
// TI and/or its suppliers, and is protected under applicable copyright
12
// laws. You may not combine this software with "viral" open-source
13
// software in order to form a larger program.
14
// 
15
// THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
16
// NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT
17
// NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18
// A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY
19
// CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
20
// DAMAGES, FOR ANY REASON WHATSOEVER.
21
// 
22
// This is part of revision 2.1.3.156 of the EK-TM4C129EXL Firmware Package.
23
//
24
//*****************************************************************************
25

    
26
#include <stdint.h>
27
#include "inc/hw_nvic.h"
28
#include "inc/hw_types.h"
29

    
30
//*****************************************************************************
31
//
32
// Forward declaration of the default fault handlers.
33
//
34
//*****************************************************************************
35
void ResetISR(void);
36
static void NmiSR(void);
37
static void FaultISR(void);
38
static void IntDefaultHandler(void);
39

    
40
//*****************************************************************************
41
//
42
// External declaration for the reset handler that is to be called when the
43
// processor is started
44
//
45
//*****************************************************************************
46
extern void _c_int00(void);
47

    
48
//*****************************************************************************
49
//
50
// Linker variable that marks the top of the stack.
51
//
52
//*****************************************************************************
53
extern uint32_t __STACK_TOP;
54

    
55
//*****************************************************************************
56
//
57
// External declarations for the interrupt handlers used by the application.
58
//
59
//*****************************************************************************
60
extern void lwIPEthernetIntHandler(void);
61
extern void SysTickIntHandler(void);
62

    
63
//*****************************************************************************
64
//
65
// The vector table.  Note that the proper constructs must be placed on this to
66
// ensure that it ends up at physical address 0x0000.0000 or at the start of
67
// the program if located at a start address other than 0.
68
//
69
//*****************************************************************************
70
#pragma DATA_SECTION(g_pfnVectors, ".intvecs")
71
void (* const g_pfnVectors[])(void) =
72
{
73
    (void (*)(void))((uint32_t)&__STACK_TOP),
74
                                            // The initial stack pointer
75
    ResetISR,                               // The reset handler
76
    NmiSR,                                  // The NMI handler
77
    FaultISR,                               // The hard fault handler
78
    IntDefaultHandler,                      // The MPU fault handler
79
    IntDefaultHandler,                      // The bus fault handler
80
    IntDefaultHandler,                      // The usage fault handler
81
    0,                                      // Reserved
82
    0,                                      // Reserved
83
    0,                                      // Reserved
84
    0,                                      // Reserved
85
    IntDefaultHandler,                      // SVCall handler
86
    IntDefaultHandler,                      // Debug monitor handler
87
    0,                                      // Reserved
88
    IntDefaultHandler,                      // The PendSV handler
89
    SysTickIntHandler,                      // The SysTick handler
90
    IntDefaultHandler,                      // GPIO Port A
91
    IntDefaultHandler,                      // GPIO Port B
92
    IntDefaultHandler,                      // GPIO Port C
93
    IntDefaultHandler,                      // GPIO Port D
94
    IntDefaultHandler,                      // GPIO Port E
95
    IntDefaultHandler,                      // UART0 Rx and Tx
96
    IntDefaultHandler,                      // UART1 Rx and Tx
97
    IntDefaultHandler,                      // SSI0 Rx and Tx
98
    IntDefaultHandler,                      // I2C0 Master and Slave
99
    IntDefaultHandler,                      // PWM Fault
100
    IntDefaultHandler,                      // PWM Generator 0
101
    IntDefaultHandler,                      // PWM Generator 1
102
    IntDefaultHandler,                      // PWM Generator 2
103
    IntDefaultHandler,                      // Quadrature Encoder 0
104
    IntDefaultHandler,                      // ADC Sequence 0
105
    IntDefaultHandler,                      // ADC Sequence 1
106
    IntDefaultHandler,                      // ADC Sequence 2
107
    IntDefaultHandler,                      // ADC Sequence 3
108
    IntDefaultHandler,                      // Watchdog timer
109
    IntDefaultHandler,                      // Timer 0 subtimer A
110
    IntDefaultHandler,                      // Timer 0 subtimer B
111
    IntDefaultHandler,                      // Timer 1 subtimer A
112
    IntDefaultHandler,                      // Timer 1 subtimer B
113
    IntDefaultHandler,                      // Timer 2 subtimer A
114
    IntDefaultHandler,                      // Timer 2 subtimer B
115
    IntDefaultHandler,                      // Analog Comparator 0
116
    IntDefaultHandler,                      // Analog Comparator 1
117
    IntDefaultHandler,                      // Analog Comparator 2
118
    IntDefaultHandler,                      // System Control (PLL, OSC, BO)
119
    IntDefaultHandler,                      // FLASH Control
120
    IntDefaultHandler,                      // GPIO Port F
121
    IntDefaultHandler,                      // GPIO Port G
122
    IntDefaultHandler,                      // GPIO Port H
123
    IntDefaultHandler,                      // UART2 Rx and Tx
124
    IntDefaultHandler,                      // SSI1 Rx and Tx
125
    IntDefaultHandler,                      // Timer 3 subtimer A
126
    IntDefaultHandler,                      // Timer 3 subtimer B
127
    IntDefaultHandler,                      // I2C1 Master and Slave
128
    IntDefaultHandler,                      // CAN0
129
    IntDefaultHandler,                      // CAN1
130
    lwIPEthernetIntHandler,                 // Ethernet
131
    IntDefaultHandler,                      // Hibernate
132
    IntDefaultHandler,                      // USB0
133
    IntDefaultHandler,                      // PWM Generator 3
134
    IntDefaultHandler,                      // uDMA Software Transfer
135
    IntDefaultHandler,                      // uDMA Error
136
    IntDefaultHandler,                      // ADC1 Sequence 0
137
    IntDefaultHandler,                      // ADC1 Sequence 1
138
    IntDefaultHandler,                      // ADC1 Sequence 2
139
    IntDefaultHandler,                      // ADC1 Sequence 3
140
    IntDefaultHandler,                      // External Bus Interface 0
141
    IntDefaultHandler,                      // GPIO Port J
142
    IntDefaultHandler,                      // GPIO Port K
143
    IntDefaultHandler,                      // GPIO Port L
144
    IntDefaultHandler,                      // SSI2 Rx and Tx
145
    IntDefaultHandler,                      // SSI3 Rx and Tx
146
    IntDefaultHandler,                      // UART3 Rx and Tx
147
    IntDefaultHandler,                      // UART4 Rx and Tx
148
    IntDefaultHandler,                      // UART5 Rx and Tx
149
    IntDefaultHandler,                      // UART6 Rx and Tx
150
    IntDefaultHandler,                      // UART7 Rx and Tx
151
    IntDefaultHandler,                      // I2C2 Master and Slave
152
    IntDefaultHandler,                      // I2C3 Master and Slave
153
    IntDefaultHandler,                      // Timer 4 subtimer A
154
    IntDefaultHandler,                      // Timer 4 subtimer B
155
    IntDefaultHandler,                      // Timer 5 subtimer A
156
    IntDefaultHandler,                      // Timer 5 subtimer B
157
    IntDefaultHandler,                      // FPU
158
    0,                                      // Reserved
159
    0,                                      // Reserved
160
    IntDefaultHandler,                      // I2C4 Master and Slave
161
    IntDefaultHandler,                      // I2C5 Master and Slave
162
    IntDefaultHandler,                      // GPIO Port M
163
    IntDefaultHandler,                      // GPIO Port N
164
    0,                                      // Reserved
165
    IntDefaultHandler,                      // Tamper
166
    IntDefaultHandler,                      // GPIO Port P (Summary or P0)
167
    IntDefaultHandler,                      // GPIO Port P1
168
    IntDefaultHandler,                      // GPIO Port P2
169
    IntDefaultHandler,                      // GPIO Port P3
170
    IntDefaultHandler,                      // GPIO Port P4
171
    IntDefaultHandler,                      // GPIO Port P5
172
    IntDefaultHandler,                      // GPIO Port P6
173
    IntDefaultHandler,                      // GPIO Port P7
174
    IntDefaultHandler,                      // GPIO Port Q (Summary or Q0)
175
    IntDefaultHandler,                      // GPIO Port Q1
176
    IntDefaultHandler,                      // GPIO Port Q2
177
    IntDefaultHandler,                      // GPIO Port Q3
178
    IntDefaultHandler,                      // GPIO Port Q4
179
    IntDefaultHandler,                      // GPIO Port Q5
180
    IntDefaultHandler,                      // GPIO Port Q6
181
    IntDefaultHandler,                      // GPIO Port Q7
182
    IntDefaultHandler,                      // GPIO Port R
183
    IntDefaultHandler,                      // GPIO Port S
184
    IntDefaultHandler,                      // SHA/MD5 0
185
    IntDefaultHandler,                      // AES 0
186
    IntDefaultHandler,                      // DES3DES 0
187
    IntDefaultHandler,                      // LCD Controller 0
188
    IntDefaultHandler,                      // Timer 6 subtimer A
189
    IntDefaultHandler,                      // Timer 6 subtimer B
190
    IntDefaultHandler,                      // Timer 7 subtimer A
191
    IntDefaultHandler,                      // Timer 7 subtimer B
192
    IntDefaultHandler,                      // I2C6 Master and Slave
193
    IntDefaultHandler,                      // I2C7 Master and Slave
194
    IntDefaultHandler,                      // HIM Scan Matrix Keyboard 0
195
    IntDefaultHandler,                      // One Wire 0
196
    IntDefaultHandler,                      // HIM PS/2 0
197
    IntDefaultHandler,                      // HIM LED Sequencer 0
198
    IntDefaultHandler,                      // HIM Consumer IR 0
199
    IntDefaultHandler,                      // I2C8 Master and Slave
200
    IntDefaultHandler,                      // I2C9 Master and Slave
201
    IntDefaultHandler                       // GPIO Port T
202
};
203

    
204
//*****************************************************************************
205
//
206
// This is the code that gets called when the processor first starts execution
207
// following a reset event.  Only the absolutely necessary set is performed,
208
// after which the application supplied entry() routine is called.  Any fancy
209
// actions (such as making decisions based on the reset cause register, and
210
// resetting the bits in that register) are left solely in the hands of the
211
// application.
212
//
213
//*****************************************************************************
214
void
215
ResetISR(void)
216
{
217
    //
218
    // Jump to the CCS C initialization routine.  This will enable the
219
    // floating-point unit as well, so that does not need to be done here.
220
    //
221
    __asm("    .global _c_int00\n"
222
          "    b.w     _c_int00");
223
}
224

    
225
//*****************************************************************************
226
//
227
// This is the code that gets called when the processor receives a NMI.  This
228
// simply enters an infinite loop, preserving the system state for examination
229
// by a debugger.
230
//
231
//*****************************************************************************
232
static void
233
NmiSR(void)
234
{
235
    //
236
    // Enter an infinite loop.
237
    //
238
    while(1)
239
    {
240
    }
241
}
242

    
243
//*****************************************************************************
244
//
245
// This is the code that gets called when the processor receives a fault
246
// interrupt.  This simply enters an infinite loop, preserving the system state
247
// for examination by a debugger.
248
//
249
//*****************************************************************************
250
static void
251
FaultISR(void)
252
{
253
    //
254
    // Enter an infinite loop.
255
    //
256
    while(1)
257
    {
258
    }
259
}
260

    
261
//*****************************************************************************
262
//
263
// This is the code that gets called when the processor receives an unexpected
264
// interrupt.  This simply enters an infinite loop, preserving the system state
265
// for examination by a debugger.
266
//
267
//*****************************************************************************
268
static void
269
IntDefaultHandler(void)
270
{
271
    //
272
    // Go into an infinite loop.
273
    //
274
    while(1)
275
    {
276
    }
277
}