-
Notifications
You must be signed in to change notification settings - Fork 0
/
startup_msp432p401r_gcc.c
211 lines (197 loc) · 12.4 KB
/
startup_msp432p401r_gcc.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
199
200
201
202
203
204
205
206
207
208
209
210
211
/******************************************************************************
*
* Copyright (C) 2012 - 2017 Texas Instruments Incorporated - http://www.ti.com/
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
*
* Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* MSP432P401R Interrupt Vector Table
*
*****************************************************************************/
#include <stdint.h>
/* Entry point for the application. */
extern int _mainCRTStartup();
/* External declaration for system initialization function */
extern void SystemInit(void);
extern uint32_t __data_load__;
extern uint32_t __data_start__;
extern uint32_t __data_end__;
extern uint32_t __StackTop;
typedef void( *pFunc )( void );
/* Forward declaration of the default fault handlers. */
void Default_Handler(void);
extern void Reset_Handler (void) __attribute__((weak));
/* Cortex-M4 Processor Exceptions */
extern void NMI_Handler (void) __attribute__((weak, alias("Default_Handler")));
extern void HardFault_Handler (void) __attribute__((weak, alias("Default_Handler")));
extern void MemManage_Handler (void) __attribute__((weak, alias("Default_Handler")));
extern void BusFault_Handler (void) __attribute__((weak, alias("Default_Handler")));
extern void UsageFault_Handler (void) __attribute__((weak, alias("Default_Handler")));
extern void SVC_Handler (void) __attribute__((weak, alias("Default_Handler")));
extern void DebugMon_Handler (void) __attribute__((weak, alias("Default_Handler")));
extern void PendSV_Handler (void) __attribute__((weak, alias("Default_Handler")));
/* device specific interrupt handler */
extern void SysTick_Handler (void) __attribute__((weak,alias("Default_Handler")));
extern void PSS_IRQHandler (void) __attribute__((weak,alias("Default_Handler")));
extern void CS_IRQHandler (void) __attribute__((weak,alias("Default_Handler")));
extern void PCM_IRQHandler (void) __attribute__((weak,alias("Default_Handler")));
extern void WDT_A_IRQHandler (void) __attribute__((weak,alias("Default_Handler")));
extern void FPU_IRQHandler (void) __attribute__((weak,alias("Default_Handler")));
extern void FLCTL_IRQHandler (void) __attribute__((weak,alias("Default_Handler")));
extern void COMP_E0_IRQHandler (void) __attribute__((weak,alias("Default_Handler")));
extern void COMP_E1_IRQHandler (void) __attribute__((weak,alias("Default_Handler")));
extern void TA0_0_IRQHandler (void) __attribute__((weak,alias("Default_Handler")));
extern void TA0_N_IRQHandler (void) __attribute__((weak,alias("Default_Handler")));
extern void TA1_0_IRQHandler (void) __attribute__((weak,alias("Default_Handler")));
extern void TA1_N_IRQHandler (void) __attribute__((weak,alias("Default_Handler")));
extern void TA2_0_IRQHandler (void) __attribute__((weak,alias("Default_Handler")));
extern void TA2_N_IRQHandler (void) __attribute__((weak,alias("Default_Handler")));
extern void TA3_0_IRQHandler (void) __attribute__((weak,alias("Default_Handler")));
extern void TA3_N_IRQHandler (void) __attribute__((weak,alias("Default_Handler")));
extern void EUSCIA0_IRQHandler (void) __attribute__((weak,alias("Default_Handler")));
extern void EUSCIA1_IRQHandler (void) __attribute__((weak,alias("Default_Handler")));
extern void EUSCIA2_IRQHandler (void) __attribute__((weak,alias("Default_Handler")));
extern void EUSCIA3_IRQHandler (void) __attribute__((weak,alias("Default_Handler")));
extern void EUSCIB0_IRQHandler (void) __attribute__((weak,alias("Default_Handler")));
extern void EUSCIB1_IRQHandler (void) __attribute__((weak,alias("Default_Handler")));
extern void EUSCIB2_IRQHandler (void) __attribute__((weak,alias("Default_Handler")));
extern void EUSCIB3_IRQHandler (void) __attribute__((weak,alias("Default_Handler")));
extern void ADC14_IRQHandler (void) __attribute__((weak,alias("Default_Handler")));
extern void T32_INT1_IRQHandler (void) __attribute__((weak,alias("Default_Handler")));
extern void T32_INT2_IRQHandler (void) __attribute__((weak,alias("Default_Handler")));
extern void T32_INTC_IRQHandler (void) __attribute__((weak,alias("Default_Handler")));
extern void AES256_IRQHandler (void) __attribute__((weak,alias("Default_Handler")));
extern void RTC_C_IRQHandler (void) __attribute__((weak,alias("Default_Handler")));
extern void DMA_ERR_IRQHandler (void) __attribute__((weak,alias("Default_Handler")));
extern void DMA_INT3_IRQHandler (void) __attribute__((weak,alias("Default_Handler")));
extern void DMA_INT2_IRQHandler (void) __attribute__((weak,alias("Default_Handler")));
extern void DMA_INT1_IRQHandler (void) __attribute__((weak,alias("Default_Handler")));
extern void DMA_INT0_IRQHandler (void) __attribute__((weak,alias("Default_Handler")));
extern void PORT1_IRQHandler (void) __attribute__((weak,alias("Default_Handler")));
extern void PORT2_IRQHandler (void) __attribute__((weak,alias("Default_Handler")));
extern void PORT3_IRQHandler (void) __attribute__((weak,alias("Default_Handler")));
extern void PORT4_IRQHandler (void) __attribute__((weak,alias("Default_Handler")));
extern void PORT5_IRQHandler (void) __attribute__((weak,alias("Default_Handler")));
extern void PORT6_IRQHandler (void) __attribute__((weak,alias("Default_Handler")));
/* Interrupt 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. */
void (* const interruptVectors[])(void) __attribute__ ((section (".intvecs"))) =
{
(pFunc)&__StackTop,
/* The initial stack pointer */
Reset_Handler, /* The reset handler */
NMI_Handler, /* The NMI handler */
HardFault_Handler, /* The hard fault handler */
MemManage_Handler, /* The MPU fault handler */
BusFault_Handler, /* The bus fault handler */
UsageFault_Handler, /* The usage fault handler */
0, /* Reserved */
0, /* Reserved */
0, /* Reserved */
0, /* Reserved */
SVC_Handler, /* SVCall handler */
DebugMon_Handler, /* Debug monitor handler */
0, /* Reserved */
PendSV_Handler, /* The PendSV handler */
SysTick_Handler, /* The SysTick handler */
PSS_IRQHandler, /* PSS Interrupt */
CS_IRQHandler, /* CS Interrupt */
PCM_IRQHandler, /* PCM Interrupt */
WDT_A_IRQHandler, /* WDT_A Interrupt */
FPU_IRQHandler, /* FPU Interrupt */
FLCTL_IRQHandler, /* Flash Controller Interrupt*/
COMP_E0_IRQHandler, /* COMP_E0 Interrupt */
COMP_E1_IRQHandler, /* COMP_E1 Interrupt */
TA0_0_IRQHandler, /* TA0_0 Interrupt */
TA0_N_IRQHandler, /* TA0_N Interrupt */
TA1_0_IRQHandler, /* TA1_0 Interrupt */
TA1_N_IRQHandler, /* TA1_N Interrupt */
TA2_0_IRQHandler, /* TA2_0 Interrupt */
TA2_N_IRQHandler, /* TA2_N Interrupt */
TA3_0_IRQHandler, /* TA3_0 Interrupt */
TA3_N_IRQHandler, /* TA3_N Interrupt */
EUSCIA0_IRQHandler, /* EUSCIA0 Interrupt */
EUSCIA1_IRQHandler, /* EUSCIA1 Interrupt */
EUSCIA2_IRQHandler, /* EUSCIA2 Interrupt */
EUSCIA3_IRQHandler, /* EUSCIA3 Interrupt */
EUSCIB0_IRQHandler, /* EUSCIB0 Interrupt */
EUSCIB1_IRQHandler, /* EUSCIB1 Interrupt */
EUSCIB2_IRQHandler, /* EUSCIB2 Interrupt */
EUSCIB3_IRQHandler, /* EUSCIB3 Interrupt */
ADC14_IRQHandler, /* ADC14 Interrupt */
T32_INT1_IRQHandler, /* T32_INT1 Interrupt */
T32_INT2_IRQHandler, /* T32_INT2 Interrupt */
T32_INTC_IRQHandler, /* T32_INTC Interrupt */
AES256_IRQHandler, /* AES256 Interrupt */
RTC_C_IRQHandler, /* RTC_C Interrupt */
DMA_ERR_IRQHandler, /* DMA_ERR Interrupt */
DMA_INT3_IRQHandler, /* DMA_INT3 Interrupt */
DMA_INT2_IRQHandler, /* DMA_INT2 Interrupt */
DMA_INT1_IRQHandler, /* DMA_INT1 Interrupt */
DMA_INT0_IRQHandler, /* DMA_INT0 Interrupt */
PORT1_IRQHandler, /* Port1 Interrupt */
PORT2_IRQHandler, /* Port2 Interrupt */
PORT3_IRQHandler, /* Port3 Interrupt */
PORT4_IRQHandler, /* Port4 Interrupt */
PORT5_IRQHandler, /* Port5 Interrupt */
PORT6_IRQHandler /* Port6 Interrupt */
};
/* Forward declaration of the default fault handlers. */
/* 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. */
void Reset_Handler(void)
{
uint32_t *pui32Src, *pui32Dest;
//
// Copy the data segment initializers from flash to SRAM.
//
pui32Src = &__data_load__;
for(pui32Dest = &__data_start__; pui32Dest < &__data_end__; )
{
*pui32Dest++ = *pui32Src++;
}
/* Call system initialization routine */
SystemInit();
/* Jump to the main initialization routine. */
_mainCRTStartup();
}
/* 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. */
void Default_Handler(void)
{
/* Enter an infinite loop. */
while(1)
{
}
}