]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/CORTEX_M0_STM32F0518_IAR/Libraries/CMSIS/Device/ST/STM32F0xx/Source/Templates/TrueSTUDIO/startup_stm32f0xx.s
Add FreeRTOS-Plus directory.
[freertos] / FreeRTOS / Demo / CORTEX_M0_STM32F0518_IAR / Libraries / CMSIS / Device / ST / STM32F0xx / Source / Templates / TrueSTUDIO / startup_stm32f0xx.s
1 /**\r
2  ******************************************************************************\r
3  * @file      startup_stm32f0xx.s\r
4  * @author    MCD Application Team\r
5  * @version   V1.0.0RC1\r
6  * @date      27-January-2012\r
7  * @brief     STM32F0xx Devices vector table for Atollic toolchain.\r
8  *            This module performs:\r
9  *                - Set the initial SP\r
10  *                - Set the initial PC == Reset_Handler,\r
11  *                - Set the vector table entries with the exceptions ISR address\r
12  *                - Configure the clock system\r
13  *                - Branches to main in the C library (which eventually\r
14  *                  calls main()).\r
15  *            After Reset the Cortex-M0 processor is in Thread mode,\r
16  *            priority is Privileged, and the Stack is set to Main.\r
17  *******************************************************************************\r
18  * @attention\r
19  *\r
20  * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS\r
21  * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE\r
22  * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY\r
23  * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING\r
24  * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE\r
25  * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.\r
26   *\r
27   * FOR MORE INFORMATION PLEASE READ CAREFULLY THE LICENSE AGREEMENT FILE\r
28   * LOCATED IN THE ROOT DIRECTORY OF THIS FIRMWARE PACKAGE.\r
29   *\r
30   * <h2><center>&copy; COPYRIGHT 2012 STMicroelectronics</center></h2>\r
31   ******************************************************************************\r
32   */\r
33 \r
34   .syntax unified\r
35   .cpu cortex-m0\r
36   .fpu softvfp\r
37   .thumb\r
38 \r
39 .global g_pfnVectors\r
40 .global Default_Handler\r
41 \r
42 /* start address for the initialization values of the .data section.\r
43 defined in linker script */\r
44 .word _sidata\r
45 /* start address for the .data section. defined in linker script */\r
46 .word _sdata\r
47 /* end address for the .data section. defined in linker script */\r
48 .word _edata\r
49 /* start address for the .bss section. defined in linker script */\r
50 .word _sbss\r
51 /* end address for the .bss section. defined in linker script */\r
52 .word _ebss\r
53 \r
54 .equ  BootRAM, 0xF108F85F\r
55 /**\r
56  * @brief  This is the code that gets called when the processor first\r
57  *          starts execution following a reset event. Only the absolutely\r
58  *          necessary set is performed, after which the application\r
59  *          supplied main() routine is called.\r
60  * @param  None\r
61  * @retval : None\r
62 */\r
63 \r
64   .section .text.Reset_Handler\r
65   .weak Reset_Handler\r
66   .type Reset_Handler, %function\r
67 Reset_Handler:\r
68 \r
69 /* Copy the data segment initializers from flash to SRAM */\r
70   movs r1, #0\r
71   b LoopCopyDataInit\r
72 \r
73 CopyDataInit:\r
74   ldr r3, =_sidata\r
75   ldr r3, [r3, r1]\r
76   str r3, [r0, r1]\r
77   adds r1, r1, #4\r
78 \r
79 LoopCopyDataInit:\r
80   ldr r0, =_sdata\r
81   ldr r3, =_edata\r
82   adds r2, r0, r1\r
83   cmp r2, r3\r
84   bcc CopyDataInit\r
85   ldr r2, =_sbss\r
86   b LoopFillZerobss\r
87 /* Zero fill the bss segment. */\r
88 FillZerobss:\r
89   movs r3, #0\r
90   str r3, [r2], #4\r
91 \r
92 LoopFillZerobss:\r
93   ldr r3, = _ebss\r
94   cmp r2, r3\r
95   bcc FillZerobss\r
96 \r
97 /* Call the clock system intitialization function.*/\r
98     bl  SystemInit\r
99 /* Call static constructors */\r
100     bl __libc_init_array\r
101 /* Call the application's entry point.*/\r
102   bl main\r
103   bx lr\r
104 .size Reset_Handler, .-Reset_Handler\r
105 \r
106 /**\r
107  * @brief  This is the code that gets called when the processor receives an\r
108  *         unexpected interrupt.  This simply enters an infinite loop, preserving\r
109  *         the system state for examination by a debugger.\r
110  *\r
111  * @param  None\r
112  * @retval : None\r
113 */\r
114     .section .text.Default_Handler,"ax",%progbits\r
115 Default_Handler:\r
116 Infinite_Loop:\r
117   b Infinite_Loop\r
118   .size Default_Handler, .-Default_Handler\r
119 /******************************************************************************\r
120 *\r
121 * The minimal vector table for a Cortex M0.  Note that the proper constructs\r
122 * must be placed on this to ensure that it ends up at physical address\r
123 * 0x0000.0000.\r
124 *\r
125 ******************************************************************************/\r
126    .section .isr_vector,"a",%progbits\r
127   .type g_pfnVectors, %object\r
128   .size g_pfnVectors, .-g_pfnVectors\r
129 \r
130 \r
131 g_pfnVectors:\r
132   .word _estack\r
133   .word Reset_Handler\r
134   .word NMI_Handler\r
135   .word HardFault_Handler\r
136   .word 0\r
137   .word 0\r
138   .word 0\r
139   .word 0\r
140   .word 0\r
141   .word 0\r
142   .word 0\r
143   .word SVC_Handler\r
144   .word 0\r
145   .word 0\r
146   .word PendSV_Handler\r
147   .word SysTick_Handler\r
148   .word WWDG_IRQHandler\r
149   .word PVD_IRQHandler\r
150   .word RTC_IRQHandler\r
151   .word FLASH_IRQHandler\r
152   .word RCC_IRQHandler\r
153   .word EXTI0_1_IRQHandler\r
154   .word EXTI2_3_IRQHandler\r
155   .word EXTI4_15_IRQHandler\r
156   .word TS_IRQHandler\r
157   .word DMA1_Channel1_IRQHandler\r
158   .word DMA1_Channel2_3_IRQHandler\r
159   .word DMA1_Channel4_5_IRQHandler\r
160   .word ADC1_COMP_IRQHandler \r
161   .word TIM1_BRK_UP_TRG_COM_IRQHandler\r
162   .word TIM1_CC_IRQHandler\r
163   .word TIM2_IRQHandler\r
164   .word TIM3_IRQHandler\r
165   .word TIM6_DAC_IRQHandler\r
166   .word 0  \r
167   .word TIM14_IRQHandler\r
168   .word TIM15_IRQHandler\r
169   .word TIM16_IRQHandler\r
170   .word TIM17_IRQHandler\r
171   .word I2C1_IRQHandler\r
172   .word I2C2_IRQHandler\r
173   .word SPI1_IRQHandler\r
174   .word SPI2_IRQHandler\r
175   .word USART1_IRQHandler\r
176   .word USART2_IRQHandler\r
177   .word 0\r
178   .word CEC_IRQHandler\r
179   .word 0\r
180   .word BootRAM          /* @0x108. This is for boot in RAM mode for \r
181                             STM32F0xx devices. */\r
182 \r
183 /*******************************************************************************\r
184 *\r
185 * Provide weak aliases for each Exception handler to the Default_Handler.\r
186 * As they are weak aliases, any function with the same name will override\r
187 * this definition.\r
188 *\r
189 *******************************************************************************/\r
190 \r
191   .weak NMI_Handler\r
192   .thumb_set NMI_Handler,Default_Handler\r
193 \r
194   .weak HardFault_Handler\r
195   .thumb_set HardFault_Handler,Default_Handler\r
196 \r
197   .weak SVC_Handler\r
198   .thumb_set SVC_Handler,Default_Handler\r
199 \r
200   .weak PendSV_Handler\r
201   .thumb_set PendSV_Handler,Default_Handler\r
202 \r
203   .weak SysTick_Handler\r
204   .thumb_set SysTick_Handler,Default_Handler\r
205 \r
206   .weak WWDG_IRQHandler\r
207   .thumb_set WWDG_IRQHandler,Default_Handler\r
208 \r
209   .weak PVD_IRQHandler\r
210   .thumb_set PVD_IRQHandler,Default_Handler\r
211   \r
212   .weak RTC_IRQHandler\r
213   .thumb_set RTC_IRQHandler,Default_Handler\r
214   \r
215   .weak FLASH_IRQHandler\r
216   .thumb_set FLASH_IRQHandler,Default_Handler\r
217   \r
218   .weak RCC_IRQHandler\r
219   .thumb_set RCC_IRQHandler,Default_Handler\r
220   \r
221   .weak EXTI0_1_IRQHandler\r
222   .thumb_set EXTI0_1_IRQHandler,Default_Handler\r
223   \r
224   .weak EXTI2_3_IRQHandler\r
225   .thumb_set EXTI2_3_IRQHandler,Default_Handler\r
226   \r
227   .weak EXTI4_15_IRQHandler\r
228   .thumb_set EXTI4_15_IRQHandler,Default_Handler\r
229   \r
230   .weak TS_IRQHandler\r
231   .thumb_set TS_IRQHandler,Default_Handler\r
232   \r
233   .weak DMA1_Channel1_IRQHandler\r
234   .thumb_set DMA1_Channel1_IRQHandler,Default_Handler\r
235   \r
236   .weak DMA1_Channel2_3_IRQHandler\r
237   .thumb_set DMA1_Channel2_3_IRQHandler,Default_Handler\r
238   \r
239   .weak DMA1_Channel4_5_IRQHandler\r
240   .thumb_set DMA1_Channel4_5_IRQHandler,Default_Handler\r
241   \r
242   .weak ADC1_COMP_IRQHandler\r
243   .thumb_set ADC1_COMP_IRQHandler,Default_Handler\r
244    \r
245   .weak TIM1_BRK_UP_TRG_COM_IRQHandler\r
246   .thumb_set TIM1_BRK_UP_TRG_COM_IRQHandler,Default_Handler\r
247   \r
248   .weak TIM1_CC_IRQHandler\r
249   .thumb_set TIM1_CC_IRQHandler,Default_Handler\r
250   \r
251   .weak TIM2_IRQHandler\r
252   .thumb_set TIM2_IRQHandler,Default_Handler\r
253   \r
254   .weak TIM3_IRQHandler\r
255   .thumb_set TIM3_IRQHandler,Default_Handler\r
256   \r
257   .weak TIM6_DAC_IRQHandler\r
258   .thumb_set TIM6_DAC_IRQHandler,Default_Handler\r
259   \r
260   .weak TIM14_IRQHandler\r
261   .thumb_set TIM14_IRQHandler,Default_Handler\r
262   \r
263   .weak TIM15_IRQHandler\r
264   .thumb_set TIM15_IRQHandler,Default_Handler\r
265   \r
266   .weak TIM16_IRQHandler\r
267   .thumb_set TIM16_IRQHandler,Default_Handler\r
268   \r
269   .weak TIM17_IRQHandler\r
270   .thumb_set TIM17_IRQHandler,Default_Handler\r
271   \r
272   .weak I2C1_IRQHandler\r
273   .thumb_set I2C1_IRQHandler,Default_Handler\r
274   \r
275   .weak I2C2_IRQHandler\r
276   .thumb_set I2C2_IRQHandler,Default_Handler\r
277   \r
278   .weak SPI1_IRQHandler\r
279   .thumb_set SPI1_IRQHandler,Default_Handler\r
280   \r
281   .weak SPI2_IRQHandler\r
282   .thumb_set SPI2_IRQHandler,Default_Handler\r
283   \r
284   .weak USART1_IRQHandler\r
285   .thumb_set USART1_IRQHandler,Default_Handler\r
286   \r
287   .weak USART2_IRQHandler\r
288   .thumb_set USART2_IRQHandler,Default_Handler\r
289   \r
290   .weak CEC_IRQHandler\r
291   .thumb_set CEC_IRQHandler,Default_Handler\r
292 \r
293 /******************* (C) COPYRIGHT 2012 STMicroelectronics *****END OF FILE****/\r
294 \r