6 #include "RtosInterrupt.hpp"
9 extern "C" void entryPoint(
void);
10 extern "C" void __libc_init_array(
void);
11 extern int main(
void);
13 #ifndef RTOS_CFG_MAIN_STACK_SIZE
14 #define RTOS_CFG_MAIN_STACK_SIZE 128
16 volatile static unsigned long mainStack[RTOS_CFG_MAIN_STACK_SIZE] __attribute__ ((section(
".stack")));
18 __attribute__ ((section(
".isr_vector"), used)) uint32_t vectorsTable[] = {
20 ((uint32_t) mainStack) +
sizeof(mainStack),
21 (uint32_t) entryPoint,
22 (uint32_t) RtosInterrupt::IRQ_NonMaskableInt,
23 (uint32_t) RtosInterrupt::IRQ_HardFault,
24 (uint32_t) RtosInterrupt::IRQ_MemoryManagement,
25 (uint32_t) RtosInterrupt::IRQ_BusFault,
26 (uint32_t) RtosInterrupt::IRQ_UsageFault,
31 (uint32_t) RtosInterrupt::IRQ_SVCall,
32 (uint32_t) RtosInterrupt::IRQ_DebugMonitor,
34 (uint32_t) RtosInterrupt::IRQ_PendSV,
35 (uint32_t) RtosInterrupt::IRQ_SysTick,
38 (uint32_t) RtosInterrupt::IRQ_WWDG,
39 (uint32_t) RtosInterrupt::IRQ_PVD,
40 (uint32_t) RtosInterrupt::IRQ_TAMPER_STAMP,
41 (uint32_t) RtosInterrupt::IRQ_RTC_WKUP,
42 (uint32_t) RtosInterrupt::IRQ_FLASH,
43 (uint32_t) RtosInterrupt::IRQ_RCC,
44 (uint32_t) RtosInterrupt::IRQ_EXTI0,
45 (uint32_t) RtosInterrupt::IRQ_EXTI1,
46 (uint32_t) RtosInterrupt::IRQ_EXTI2_TS,
47 (uint32_t) RtosInterrupt::IRQ_EXTI3,
48 (uint32_t) RtosInterrupt::IRQ_EXTI4,
49 (uint32_t) RtosInterrupt::IRQ_DMA1_Channel1,
50 (uint32_t) RtosInterrupt::IRQ_DMA1_Channel2,
51 (uint32_t) RtosInterrupt::IRQ_DMA1_Channel3,
52 (uint32_t) RtosInterrupt::IRQ_DMA1_Channel4,
53 (uint32_t) RtosInterrupt::IRQ_DMA1_Channel5,
54 (uint32_t) RtosInterrupt::IRQ_DMA1_Channel6,
55 (uint32_t) RtosInterrupt::IRQ_DMA1_Channel7,
56 (uint32_t) RtosInterrupt::IRQ_ADC1_2,
57 (uint32_t) RtosInterrupt::IRQ_USB_HP_CAN1_TX,
58 (uint32_t) RtosInterrupt::IRQ_USB_LP_CAN1_RX0,
59 (uint32_t) RtosInterrupt::IRQ_CAN1_RX1,
60 (uint32_t) RtosInterrupt::IRQ_CAN1_SCE,
61 (uint32_t) RtosInterrupt::IRQ_EXTI9_5,
62 (uint32_t) RtosInterrupt::IRQ_TIM1_BRK_TIM15,
63 (uint32_t) RtosInterrupt::IRQ_TIM1_UP_TIM16,
64 (uint32_t) RtosInterrupt::IRQ_TIM1_TRG_COM_TIM17,
65 (uint32_t) RtosInterrupt::IRQ_TIM1_CC,
66 (uint32_t) RtosInterrupt::IRQ_TIM2,
67 (uint32_t) RtosInterrupt::IRQ_TIM3,
68 (uint32_t) RtosInterrupt::IRQ_TIM4,
69 (uint32_t) RtosInterrupt::IRQ_I2C1_EV,
70 (uint32_t) RtosInterrupt::IRQ_I2C1_ER,
71 (uint32_t) RtosInterrupt::IRQ_I2C2_EV,
72 (uint32_t) RtosInterrupt::IRQ_I2C2_ER,
73 (uint32_t) RtosInterrupt::IRQ_SPI1,
74 (uint32_t) RtosInterrupt::IRQ_SPI2,
75 (uint32_t) RtosInterrupt::IRQ_USART1,
76 (uint32_t) RtosInterrupt::IRQ_USART2,
77 (uint32_t) RtosInterrupt::IRQ_USART3,
78 (uint32_t) RtosInterrupt::IRQ_EXTI15_10,
79 (uint32_t) RtosInterrupt::IRQ_RTC_Alarm,
80 (uint32_t) RtosInterrupt::IRQ_USBWakeUp,
81 (uint32_t) RtosInterrupt::IRQ_TIM8_BRK,
82 (uint32_t) RtosInterrupt::IRQ_TIM8_UP,
83 (uint32_t) RtosInterrupt::IRQ_TIM8_TRG_COM,
84 (uint32_t) RtosInterrupt::IRQ_TIM8_CC,
85 (uint32_t) RtosInterrupt::IRQ_ADC3,
89 (uint32_t) RtosInterrupt::IRQ_SPI3,
90 (uint32_t) RtosInterrupt::IRQ_UART4,
91 (uint32_t) RtosInterrupt::IRQ_UART5,
92 (uint32_t) RtosInterrupt::IRQ_TIM6_DAC,
93 (uint32_t) RtosInterrupt::IRQ_TIM7,
94 (uint32_t) RtosInterrupt::IRQ_DMA2_Channel1,
95 (uint32_t) RtosInterrupt::IRQ_DMA2_Channel2,
96 (uint32_t) RtosInterrupt::IRQ_DMA2_Channel3,
97 (uint32_t) RtosInterrupt::IRQ_DMA2_Channel4,
98 (uint32_t) RtosInterrupt::IRQ_DMA2_Channel5,
99 (uint32_t) RtosInterrupt::IRQ_ADC4,
102 (uint32_t) RtosInterrupt::IRQ_COMP1_2_3,
103 (uint32_t) RtosInterrupt::IRQ_COMP4_5_6,
104 (uint32_t) RtosInterrupt::IRQ_COMP7,
112 (uint32_t) RtosInterrupt::IRQ_USB_HP,
113 (uint32_t) RtosInterrupt::IRQ_USB_LP,
114 (uint32_t) RtosInterrupt::IRQ_USBWakeUp_RMP,
119 (uint32_t) RtosInterrupt::IRQ_FPU,
122 extern
unsigned long _flash_data;
123 extern
unsigned long _data;
124 extern
unsigned long _edata;
125 extern
unsigned long _bss;
126 extern
unsigned long _ebss;
127 extern
unsigned long _ccram_flash_data;
128 extern
unsigned long _ccram_data;
129 extern
unsigned long _ccram_edata;
131 __attribute__ ((naked,used))
void entryPoint(
void) {
139 (void) _ccram_flash_data;
146 " ldr r0, =_flash_data \n"
148 " ldr r2, =_edata \n"
153 " ldr r3, [r0], #4 \n"
154 " str r3, [r1], #4 \n"
157 :::
"r0",
"r1",
"r2",
"r3");
168 " strlt r2, [r0], #4 \n"
175 " ldr r13, =vectorsTable \n"