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 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)
 
static void PendSV_Handler (void)
 
static void SysTick_Handler (void)
 
void __attribute__ ((weak))
 
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)  )

Definition at line 50 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().

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

Referenced by __attribute__().

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

Here is the caller graph for this function:

static void DebugMon_Handler ( void  )
static

Definition at line 498 of file startup_gcc.c.

Referenced by __attribute__().

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

Here is the caller graph for this function:

static void Default_Handler ( void  )
static

Definition at line 646 of file startup_gcc.c.

646  {
647 // while (1) {}
648 }
static void HardFault_Handler ( void  )
static

Definition at line 443 of file startup_gcc.c.

Referenced by __attribute__().

444 {
445  //
446  // Enter an infinite loop.
447  //
448  while(1)
449  {
450  }
451 }

Here is the caller graph for this function:

static void MemManage_Handler ( void  )
static

Definition at line 454 of file startup_gcc.c.

Referenced by __attribute__().

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

Here is the caller graph for this function:

static void NMI_Handler ( void  )
static

Definition at line 425 of file startup_gcc.c.

Referenced by __attribute__().

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

Here is the caller graph for this function:

static void PendSV_Handler ( void  )
static

Definition at line 509 of file startup_gcc.c.

Referenced by __attribute__().

510 {
511  //
512  // Enter an infinite loop.
513  //
514  while(1)
515  {
516  }
517 }

Here is the caller graph for this function:

void Reset_Handler ( void  )

Definition at line 371 of file startup_gcc.c.

References _edata, _etext, and main().

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

Referenced by __attribute__().

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

Here is the caller graph for this function:

static void SysTick_Handler ( void  )
static

Definition at line 520 of file startup_gcc.c.

Referenced by __attribute__().

521 {
522  //
523  // Enter an infinite loop.
524  //
525  while(1)
526  {
527  }
528 }

Here is the caller graph for this function:

static void UsageFault_Handler ( void  )
static

Definition at line 476 of file startup_gcc.c.

Referenced by __attribute__().

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

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