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().

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

Referenced by __attribute__().

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

Here is the caller graph for this function:

static void DebugMon_Handler ( void  )
static

Definition at line 497 of file startup_gcc.c.

Referenced by __attribute__().

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

Here is the caller graph for this function:

static void Default_Handler ( void  )
static

Definition at line 645 of file startup_gcc.c.

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

Definition at line 442 of file startup_gcc.c.

Referenced by __attribute__().

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

Here is the caller graph for this function:

static void MemManage_Handler ( void  )
static

Definition at line 453 of file startup_gcc.c.

Referenced by __attribute__().

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

Here is the caller graph for this function:

static void NMI_Handler ( void  )
static

Definition at line 424 of file startup_gcc.c.

Referenced by __attribute__().

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

Here is the caller graph for this function:

static void PendSV_Handler ( void  )
static

Definition at line 508 of file startup_gcc.c.

Referenced by __attribute__().

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

Here is the caller graph for this function:

void Reset_Handler ( void  )

Definition at line 370 of file startup_gcc.c.

References _edata, _etext, and main().

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

Referenced by __attribute__().

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

Here is the caller graph for this function:

static void SysTick_Handler ( void  )
static

Definition at line 519 of file startup_gcc.c.

Referenced by __attribute__().

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

Here is the caller graph for this function:

static void UsageFault_Handler ( void  )
static

Definition at line 475 of file startup_gcc.c.

Referenced by __attribute__().

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

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