EE445M RTOS
Taken at the University of Texas Spring 2015
startup_gcc.c File Reference
#include <stdint.h>
#include <inc/hw_nvic.h>
#include <inc/hw_types.h>
#include <stdbool.h>
Include dependency graph for startup_gcc.c:

Go to the source code of this file.

Functions

void Reset_Handler (void)
 
static void NMI_Handler (void)
 
static void HardFault_Handler (void)
 
static void MemManage_Handler (void)
 
static void BusFault_Handler (void)
 
static void UsageFault_Handler (void)
 
static void SVC_Handler (void)
 
static void DebugMon_Handler (void)
 
void __attribute__ ((weak, isr, naked))
 
static void Default_Handler (void)
 

Variables

uint32_t _etext
 
uint32_t _data
 
uint32_t _edata
 
uint32_t _bss
 
uint32_t _ebss
 

Function Documentation

void __attribute__ ( (weak, isr, naked)  )

Definition at line 49 of file startup_gcc.c.

References _bss, _data, _ebss, _edata, _etext, ADC0Seq0_Handler(), ADC0Seq1_Handler(), ADC0Seq2_Handler(), ADC0Seq3_Handler(), BusFault_Handler(), DebugMon_Handler(), GPIOPortF_Handler(), HardFault_Handler(), MemManage_Handler(), NMI_Handler(), PendSV_Handler(), Reset_Handler(), SVC_Handler(), SysTick_Handler(), TIMER0A_Handler(), TIMER1A_Handler(), TIMER2A_Handler(), UART0_Handler(), and UsageFault_Handler().

189 {
190  (void (*)(void))((uint32_t)pui32Stack + sizeof(pui32Stack)),
191  // The initial stack pointer
192  Reset_Handler, // The reset handler
193  NMI_Handler, // The NMI handler
194  HardFault_Handler, // The hard fault handler
195  MemManage_Handler, // The MPU fault handler
196  BusFault_Handler, // The bus fault handler
197  UsageFault_Handler, // The usage fault handler
198  0, // Reserved
199  0, // Reserved
200  0, // Reserved
201  0, // Reserved
202  SVC_Handler, // SVCall handler
203  DebugMon_Handler, // Debug monitor handler
204  0, // Reserved
205  PendSV_Handler, // The PendSV handler
206  SysTick_Handler, // The SysTick handler
207  GPIOPortA_Handler, // GPIO Port A
208  GPIOPortB_Handler, // GPIO Port B
209  GPIOPortC_Handler, // GPIO Port C
210  GPIOPortD_Handler, // GPIO Port D
211  GPIOPortE_Handler, // GPIO Port E
212  UART0_Handler, // UART0 Rx and Tx
213  UART1_Handler, // UART1 Rx and Tx
214  SSI0_Handler, // SSI0 Rx and Tx
215  I2C0_Handler, // I2C0 Master and Slave
216  PWM0Fault_Handler, // PWM Fault
217  PWM0Generator0_Handler, // PWM Generator 0
218  PWM0Generator1_Handler, // PWM Generator 1
219  PWM0Generator2_Handler, // PWM Generator 2
220  Quadrature0_Handler, // Quadrature Encoder 0
221  ADC0Seq0_Handler, // ADC Sequence 0
222  ADC0Seq1_Handler, // ADC Sequence 1
223  ADC0Seq2_Handler, // ADC Sequence 2
224  ADC0Seq3_Handler, // ADC Sequence 3
225  WDT_Handler, // Watchdog timer
226  TIMER0A_Handler, // TIMER 0 subtimer A
227  TIMER0B_Handler, // TIMER 0 subtimer B
228  TIMER1A_Handler, // TIMER 1 subtimer A
229  TIMER1B_Handler, // TIMER 1 subtimer B
230  TIMER2A_Handler, // TIMER 2 subtimer A
231  TIMER2B_Handler, // TIMER 2 subtimer B
232  Comp0_Handler, // Analog Comparator 0
233  Comp1_Handler, // Analog Comparator 1
234  Comp2_Handler, // Analog Comparator 2
235  SysCtl_Handler, // System Control (PLL, OSC, BO)
236  FlashCtl_Handler, // FLASH Control
237  GPIOPortF_Handler, // GPIO Port F
238  GPIOPortG_Handler, // GPIO Port G
239  GPIOPortH_Handler, // GPIO Port H
240  UART2_Handler, // UART2 Rx and Tx
241  SSI1_Handler, // SSI1 Rx and Tx
242  TIMER3A_Handler, // TIMER 3 subtimer A
243  TIMER3B_Handler, // TIMER 3 subtimer B
244  I2C1_Handler, // I2C1 Master and Slave
245  Quadrature1_Handler, // Quadrature Encoder 1
246  CAN0_Handler, // CAN0
247  CAN1_Handler, // CAN1
248  CAN2_Handler, // CAN2
249  0, // Reserved
250  Hibernate_Handler, // Hibernate
251  USB0_Handler, // USB0
252  PWM0Generator3_Handler, // PWM Generator 3
253  uDMA_Handler, // uDMA Software Transfer
254  uDMA_Error, // uDMA Error
255  ADC1Seq0_Handler, // ADC1 Sequence 0
256  ADC1Seq1_Handler, // ADC1 Sequence 1
257  ADC1Seq2_Handler, // ADC1 Sequence 2
258  ADC1Seq3_Handler, // ADC1 Sequence 3
259  0, // Reserved
260  0, // Reserved
261  GPIOPortJ_Handler, // GPIO Port J
262  GPIOPortK_Handler, // GPIO Port K
263  GPIOPortL_Handler, // GPIO Port L
264  SSI2_Handler, // SSI2 Rx and Tx
265  SSI3_Handler, // SSI3 Rx and Tx
266  UART3_Handler, // UART3 Rx and Tx
267  UART4_Handler, // UART4 Rx and Tx
268  UART5_Handler, // UART5 Rx and Tx
269  UART6_Handler, // UART6 Rx and Tx
270  UART7_Handler, // UART7 Rx and Tx
271  0, // Reserved
272  0, // Reserved
273  0, // Reserved
274  0, // Reserved
275  I2C2_Handler, // I2C2 Master and Slave
276  I2C3_Handler, // I2C3 Master and Slave
277  TIMER4A_Handler, // TIMER 4 subtimer A
278  TIMER4B_Handler, // TIMER 4 subtimer B
279  0, // Reserved
280  0, // Reserved
281  0, // Reserved
282  0, // Reserved
283  0, // Reserved
284  0, // Reserved
285  0, // Reserved
286  0, // Reserved
287  0, // Reserved
288  0, // Reserved
289  0, // Reserved
290  0, // Reserved
291  0, // Reserved
292  0, // Reserved
293  0, // Reserved
294  0, // Reserved
295  0, // Reserved
296  0, // Reserved
297  0, // Reserved
298  0, // Reserved
299  TIMER5A_Handler, // TIMER 5 subtimer A
300  TIMER5B_Handler, // TIMER 5 subtimer B
301  WideTIMER0A_Handler, // Wide TIMER 0 subtimer A
302  WideTIMER0B_Handler, // Wide TIMER 0 subtimer B
303  WideTIMER1A_Handler, // Wide TIMER 1 subtimer A
304  WideTIMER1B_Handler, // Wide TIMER 1 subtimer B
305  WideTIMER2A_Handler, // Wide TIMER 2 subtimer A
306  WideTIMER2B_Handler, // Wide TIMER 2 subtimer B
307  WideTIMER3A_Handler, // Wide TIMER 3 subtimer A
308  WideTIMER3B_Handler, // Wide TIMER 3 subtimer B
309  WideTIMER4A_Handler, // Wide TIMER 4 subtimer A
310  WideTIMER4B_Handler, // Wide TIMER 4 subtimer B
311  WideTIMER5A_Handler, // Wide TIMER 5 subtimer A
312  WideTIMER5B_Handler, // Wide TIMER 5 subtimer B
313  FPU_Handler, // FPU
314  0, // Reserved
315  0, // Reserved
316  I2C4_Handler , // I2C4 Master and Slave
317  I2C5_Handler , // I2C5 Master and Slave
318  GPIOPortM_Handler , // GPIO Port M
319  GPIOPortN_Handler , // GPIO Port N
320  Quadrature2_Handler, // Quadrature Encoder 2
321  0, // Reserved
322  0, // Reserved
323  GPIOPortP_Handler , // GPIO Port P (Summary or P0)
324  GPIOPortP1_Handler , // GPIO Port P1
325  GPIOPortP2_Handler , // GPIO Port P2
326  GPIOPortP3_Handler , // GPIO Port P3
327  GPIOPortP4_Handler , // GPIO Port P4
328  GPIOPortP5_Handler , // GPIO Port P5
329  GPIOPortP6_Handler , // GPIO Port P6
330  GPIOPortP7_Handler , // GPIO Port P7
331  GPIOPortQ_Handler , // GPIO Port Q (Summary or Q0)
332  GPIOPortQ1_Handler , // GPIO Port Q1
333  GPIOPortQ2_Handler , // GPIO Port Q2
334  GPIOPortQ3_Handler , // GPIO Port Q3
335  GPIOPortQ4_Handler , // GPIO Port Q4
336  GPIOPortQ5_Handler , // GPIO Port Q5
337  GPIOPortQ6_Handler , // GPIO Port Q6
338  GPIOPortQ7_Handler , // GPIO Port Q7
339  GPIOPortR_Handler , // GPIO Port R
340  GPIOPortS_Handler , // GPIO Port S
341  PWM1Generator0_Handler, // PWM 1 Generator 0
342  PWM1Generator1_Handler, // PWM 1 Generator 1
343  PWM1Generator2_Handler, // PWM 1 Generator 2
344  PWM1Generator3_Handler, // PWM 1 Generator 3
345  PWM1Fault_Handler // PWM 1 Fault
346 };
void GPIOPortF_Handler(void)
Definition: hardware.c:238
static void BusFault_Handler(void)
Definition: startup_gcc.c:466
void PendSV_Handler()
Definition: os.c:291
static void UsageFault_Handler(void)
Definition: startup_gcc.c:477
void Reset_Handler(void)
Definition: startup_gcc.c:370
void TIMER1A_Handler(void)
Definition: hardware.c:355
void ADC0Seq2_Handler(void)
Definition: hardware.c:392
static void MemManage_Handler(void)
Definition: startup_gcc.c:455
void ADC0Seq1_Handler(void)
Definition: hardware.c:385
void TIMER0A_Handler(void)
static void HardFault_Handler(void)
Definition: startup_gcc.c:444
void ADC0Seq3_Handler(void)
Definition: hardware.c:402
void TIMER2A_Handler(void)
Definition: hardware.c:370
void SysTick_Handler()
Definition: os.c:282
static void SVC_Handler(void)
Definition: startup_gcc.c:488
static void NMI_Handler(void)
Definition: startup_gcc.c:426
static void DebugMon_Handler(void)
Definition: startup_gcc.c:499
void UART0_Handler(void)
Definition: hardware.c:254
void ADC0Seq0_Handler(void)
Definition: hardware.c:378

Here is the call graph for this function:

static void BusFault_Handler ( void  )
static

Definition at line 466 of file startup_gcc.c.

Referenced by __attribute__().

467 {
468  //
469  // Enter an infinite loop.
470  //
471  while(1)
472  {
473  }
474 }

Here is the caller graph for this function:

static void DebugMon_Handler ( void  )
static

Definition at line 499 of file startup_gcc.c.

Referenced by __attribute__().

500 {
501  //
502  // Enter an infinite loop.
503  //
504  while(1)
505  {
506  }
507 }

Here is the caller graph for this function:

static void Default_Handler ( void  )
static

Definition at line 627 of file startup_gcc.c.

627  {
628 // while (1) {}
629 }
static void HardFault_Handler ( void  )
static

Definition at line 444 of file startup_gcc.c.

Referenced by __attribute__().

445 {
446  //
447  // Enter an infinite loop.
448  // Try this in gdb: x /x 0xe000ed2c
449  while(1)
450  {
451  }
452 }

Here is the caller graph for this function:

static void MemManage_Handler ( void  )
static

Definition at line 455 of file startup_gcc.c.

Referenced by __attribute__().

456 {
457  //
458  // Enter an infinite loop.
459  //
460  while(1)
461  {
462  }
463 }

Here is the caller graph for this function:

static void NMI_Handler ( void  )
static

Definition at line 426 of file startup_gcc.c.

Referenced by __attribute__().

427 {
428  //
429  // Enter an infinite loop.
430  //
431  while(1)
432  {
433  }
434 }

Here is the caller graph for this function:

void Reset_Handler ( void  )

Definition at line 372 of file startup_gcc.c.

References _edata, _etext, and main().

373 {
374  uint32_t *pui32Src, *pui32Dest;
375 
376  //
377  // Copy the data segment initializers from flash to SRAM.
378  //
379  pui32Src = &_etext;
380  for(pui32Dest = &_data; pui32Dest < &_edata; )
381  {
382  *pui32Dest++ = *pui32Src++;
383  }
384 
385  //
386  // Zero fill the bss segment.
387  //
388  __asm(" ldr r0, =_bss\n"
389  " ldr r1, =_ebss\n"
390  " mov r2, #0\n"
391  " .thumb_func\n"
392  "zero_loop:\n"
393  " cmp r0, r1\n"
394  " it lt\n"
395  " strlt r2, [r0], #4\n"
396  " blt zero_loop");
397 
398  //
399  // Enable the floating-point unit. This must be done here to handle the
400  // case where main() uses floating-point and the function prologue saves
401  // floating-point registers (which will fault if floating-point is not
402  // enabled). Any configuration of the floating-point unit using DriverLib
403  // APIs must be done here prior to the floating-point unit being enabled.
404  //
405  // Note that this does not use DriverLib since it might not be included in
406  // this project.
407  //
408 // HWREG(NVIC_CPAC) = ((HWREG(NVIC_CPAC) &
409 // ~(NVIC_CPAC_CP10_M | NVIC_CPAC_CP11_M)) |
410 // NVIC_CPAC_CP10_FULL | NVIC_CPAC_CP11_FULL);
411 //
412  //
413  // Call the application's entry point.
414  //
415  main();
416 }
uint32_t _etext
uint32_t _edata
int main(void)
Definition: blinky.c:45
uint32_t _data

Here is the call graph for this function:

static void SVC_Handler ( void  )
static

Definition at line 488 of file startup_gcc.c.

Referenced by __attribute__().

489 {
490  //
491  // Enter an infinite loop.
492  //
493  while(1)
494  {
495  }
496 }

Here is the caller graph for this function:

static void UsageFault_Handler ( void  )
static

Definition at line 477 of file startup_gcc.c.

Referenced by __attribute__().

478 {
479  //
480  // Enter an infinite loop.
481  //
482  while(1)
483  {
484  }
485 }

Here is the caller graph for this function:

Variable Documentation

uint32_t _bss
uint32_t _data
uint32_t _ebss
uint32_t _edata
uint32_t _etext