]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/CORTEX_STM32F100_Atollic/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x/startup/TrueSTUDIO/startup_stm32f10x_md_vl.s
Add FreeRTOS-Plus directory.
[freertos] / FreeRTOS / Demo / CORTEX_STM32F100_Atollic / Libraries / CMSIS / CM3 / DeviceSupport / ST / STM32F10x / startup / TrueSTUDIO / startup_stm32f10x_md_vl.s
1 /**\r
2  ******************************************************************************\r
3  * @file      startup_stm32f10x_md_vl.s\r
4  * @author    MCD Application Team\r
5  * @version   V3.4.0\r
6  * @date      10/15/2010\r
7  * @brief     STM32F10x Medium Density Value Line 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-M3 processor is in Thread mode,\r
16  *            priority is Privileged, and the Stack is set to Main.\r
17  *******************************************************************************\r
18  * @copy\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  * <h2><center>&copy; COPYRIGHT 2010 STMicroelectronics</center></h2>\r
28  */\r
29 \r
30   .syntax unified\r
31         .cpu cortex-m3\r
32         .fpu softvfp\r
33         .thumb\r
34 \r
35 .global g_pfnVectors\r
36 .global Default_Handler\r
37 \r
38 /* start address for the initialization values of the .data section.\r
39 defined in linker script */\r
40 .word   _sidata\r
41 /* start address for the .data section. defined in linker script */\r
42 .word   _sdata\r
43 /* end address for the .data section. defined in linker script */\r
44 .word   _edata\r
45 /* start address for the .bss section. defined in linker script */\r
46 .word   _sbss\r
47 /* end address for the .bss section. defined in linker script */\r
48 .word   _ebss\r
49 \r
50 .equ  BootRAM, 0xF108F85F\r
51 /**\r
52  * @brief  This is the code that gets called when the processor first\r
53  *          starts execution following a reset event. Only the absolutely\r
54  *          necessary set is performed, after which the application\r
55  *          supplied main() routine is called.\r
56  * @param  None\r
57  * @retval : None\r
58 */\r
59 \r
60     .section    .text.Reset_Handler\r
61         .weak   Reset_Handler\r
62         .type   Reset_Handler, %function\r
63 Reset_Handler:\r
64 \r
65 /* Copy the data segment initializers from flash to SRAM */\r
66   movs  r1, #0\r
67   b     LoopCopyDataInit\r
68 \r
69 CopyDataInit:\r
70         ldr     r3, =_sidata\r
71         ldr     r3, [r3, r1]\r
72         str     r3, [r0, r1]\r
73         adds    r1, r1, #4\r
74 \r
75 LoopCopyDataInit:\r
76         ldr     r0, =_sdata\r
77         ldr     r3, =_edata\r
78         adds    r2, r0, r1\r
79         cmp     r2, r3\r
80         bcc     CopyDataInit\r
81         ldr     r2, =_sbss\r
82         b       LoopFillZerobss\r
83 /* Zero fill the bss segment. */\r
84 FillZerobss:\r
85         movs    r3, #0\r
86         str     r3, [r2], #4\r
87 \r
88 LoopFillZerobss:\r
89         ldr     r3, = _ebss\r
90         cmp     r2, r3\r
91         bcc     FillZerobss\r
92         \r
93 /* Call the clock system intitialization function.*/\r
94   bl  SystemInit \r
95 /* Call static constructors */\r
96   bl __libc_init_array  \r
97 /* Call the application's entry point.*/\r
98         bl      main\r
99         bx      lr\r
100 .size   Reset_Handler, .-Reset_Handler\r
101 \r
102 /**\r
103  * @brief  This is the code that gets called when the processor receives an\r
104  *         unexpected interrupt.  This simply enters an infinite loop, preserving\r
105  *         the system state for examination by a debugger.\r
106  *\r
107  * @param  None\r
108  * @retval : None\r
109 */\r
110     .section    .text.Default_Handler,"ax",%progbits\r
111 Default_Handler:\r
112 Infinite_Loop:\r
113         b       Infinite_Loop\r
114         .size   Default_Handler, .-Default_Handler\r
115 /******************************************************************************\r
116 *\r
117 * The minimal vector table for a Cortex M3.  Note that the proper constructs\r
118 * must be placed on this to ensure that it ends up at physical address\r
119 * 0x0000.0000.\r
120 *\r
121 ******************************************************************************/\r
122         .section        .isr_vector,"a",%progbits\r
123         .type   g_pfnVectors, %object\r
124         .size   g_pfnVectors, .-g_pfnVectors\r
125 \r
126 \r
127 g_pfnVectors:\r
128         .word   _estack\r
129         .word   Reset_Handler\r
130         .word   NMI_Handler\r
131         .word   HardFault_Handler\r
132         .word   MemManage_Handler\r
133         .word   BusFault_Handler\r
134         .word   UsageFault_Handler\r
135         .word   0\r
136         .word   0\r
137         .word   0\r
138         .word   0\r
139         .word   SVC_Handler\r
140         .word   DebugMon_Handler\r
141         .word   0\r
142         .word   PendSV_Handler\r
143         .word   SysTick_Handler\r
144         .word   WWDG_IRQHandler\r
145         .word   PVD_IRQHandler\r
146         .word   TAMPER_IRQHandler\r
147         .word   RTC_IRQHandler\r
148         .word   FLASH_IRQHandler\r
149         .word   RCC_IRQHandler\r
150         .word   EXTI0_IRQHandler\r
151         .word   EXTI1_IRQHandler\r
152         .word   EXTI2_IRQHandler\r
153         .word   EXTI3_IRQHandler\r
154         .word   EXTI4_IRQHandler\r
155         .word   DMA1_Channel1_IRQHandler\r
156         .word   DMA1_Channel2_IRQHandler\r
157         .word   DMA1_Channel3_IRQHandler\r
158         .word   DMA1_Channel4_IRQHandler\r
159         .word   DMA1_Channel5_IRQHandler\r
160         .word   DMA1_Channel6_IRQHandler\r
161         .word   DMA1_Channel7_IRQHandler\r
162         .word   ADC1_IRQHandler\r
163         .word   0\r
164         .word   0\r
165         .word   0\r
166         .word   0\r
167         .word   EXTI9_5_IRQHandler\r
168         .word   TIM1_BRK_TIM15_IRQHandler\r
169         .word   TIM1_UP_TIM16_IRQHandler\r
170         .word   TIM1_TRG_COM_TIM17_IRQHandler\r
171         .word   TIM1_CC_IRQHandler\r
172         .word   TIM2_IRQHandler\r
173         .word   TIM3_IRQHandler\r
174         .word   TIM4_IRQHandler\r
175         .word   I2C1_EV_IRQHandler\r
176         .word   I2C1_ER_IRQHandler\r
177         .word   I2C2_EV_IRQHandler\r
178         .word   I2C2_ER_IRQHandler\r
179         .word   SPI1_IRQHandler\r
180         .word   SPI2_IRQHandler\r
181         .word   USART1_IRQHandler\r
182         .word   USART2_IRQHandler\r
183         .word   USART3_IRQHandler\r
184         .word   EXTI15_10_IRQHandler\r
185         .word   RTCAlarm_IRQHandler\r
186         .word   CEC_IRQHandler\r
187         .word   0\r
188         .word   0\r
189         .word   0\r
190         .word   0\r
191         .word   0\r
192         .word   0\r
193         .word   0\r
194         .word 0  \r
195         .word 0\r
196         .word 0\r
197         .word 0\r
198         .word TIM6_DAC_IRQHandler\r
199         .word TIM7_IRQHandler  \r
200         .word 0\r
201         .word 0\r
202         .word 0\r
203         .word 0\r
204         .word 0\r
205         .word 0\r
206         .word 0\r
207         .word 0\r
208         .word 0\r
209         .word 0\r
210         .word 0\r
211         .word 0\r
212         .word 0\r
213         .word 0\r
214         .word 0\r
215         .word 0\r
216         .word 0\r
217         .word 0\r
218         .word 0\r
219         .word 0\r
220         .word 0\r
221         .word 0\r
222         .word 0\r
223         .word 0\r
224         .word 0\r
225         .word 0\r
226         .word 0\r
227         .word 0\r
228         .word 0\r
229         .word 0\r
230         .word 0\r
231         .word 0\r
232         .word 0\r
233         .word 0\r
234         .word 0\r
235         .word 0\r
236         .word 0\r
237         .word 0\r
238         .word 0\r
239         .word 0\r
240         .word 0\r
241         .word 0\r
242         .word 0\r
243         .word BootRAM          /* @0x01CC. This is for boot in RAM mode for \r
244                          STM32F10x Medium Value Line Density devices. */\r
245 \r
246 /*******************************************************************************\r
247 *\r
248 * Provide weak aliases for each Exception handler to the Default_Handler.\r
249 * As they are weak aliases, any function with the same name will override\r
250 * this definition.\r
251 *\r
252 *******************************************************************************/\r
253 \r
254     \r
255   .weak  NMI_Handler\r
256   .thumb_set NMI_Handler,Default_Handler\r
257   \r
258   .weak  HardFault_Handler\r
259   .thumb_set HardFault_Handler,Default_Handler\r
260   \r
261   .weak  MemManage_Handler\r
262   .thumb_set MemManage_Handler,Default_Handler\r
263   \r
264   .weak  BusFault_Handler\r
265   .thumb_set BusFault_Handler,Default_Handler\r
266 \r
267   .weak  UsageFault_Handler\r
268   .thumb_set UsageFault_Handler,Default_Handler\r
269 \r
270   .weak  SVC_Handler\r
271   .thumb_set SVC_Handler,Default_Handler\r
272 \r
273   .weak  DebugMon_Handler\r
274   .thumb_set DebugMon_Handler,Default_Handler\r
275 \r
276   .weak  PendSV_Handler\r
277   .thumb_set PendSV_Handler,Default_Handler\r
278 \r
279   .weak  SysTick_Handler\r
280   .thumb_set SysTick_Handler,Default_Handler\r
281 \r
282   .weak  WWDG_IRQHandler\r
283   .thumb_set WWDG_IRQHandler,Default_Handler\r
284 \r
285   .weak  PVD_IRQHandler\r
286   .thumb_set PVD_IRQHandler,Default_Handler\r
287 \r
288   .weak  TAMPER_IRQHandler\r
289   .thumb_set TAMPER_IRQHandler,Default_Handler\r
290 \r
291   .weak  RTC_IRQHandler\r
292   .thumb_set RTC_IRQHandler,Default_Handler\r
293 \r
294   .weak  FLASH_IRQHandler\r
295   .thumb_set FLASH_IRQHandler,Default_Handler\r
296 \r
297   .weak  RCC_IRQHandler\r
298   .thumb_set RCC_IRQHandler,Default_Handler\r
299 \r
300   .weak  EXTI0_IRQHandler\r
301   .thumb_set EXTI0_IRQHandler,Default_Handler\r
302 \r
303   .weak  EXTI1_IRQHandler\r
304   .thumb_set EXTI1_IRQHandler,Default_Handler\r
305 \r
306   .weak  EXTI2_IRQHandler\r
307   .thumb_set EXTI2_IRQHandler,Default_Handler\r
308 \r
309   .weak  EXTI3_IRQHandler\r
310   .thumb_set EXTI3_IRQHandler,Default_Handler\r
311 \r
312   .weak  EXTI4_IRQHandler\r
313   .thumb_set EXTI4_IRQHandler,Default_Handler\r
314 \r
315   .weak  DMA1_Channel1_IRQHandler\r
316   .thumb_set DMA1_Channel1_IRQHandler,Default_Handler\r
317 \r
318   .weak  DMA1_Channel2_IRQHandler\r
319   .thumb_set DMA1_Channel2_IRQHandler,Default_Handler\r
320 \r
321   .weak  DMA1_Channel3_IRQHandler\r
322   .thumb_set DMA1_Channel3_IRQHandler,Default_Handler\r
323 \r
324   .weak  DMA1_Channel4_IRQHandler\r
325   .thumb_set DMA1_Channel4_IRQHandler,Default_Handler\r
326 \r
327   .weak  DMA1_Channel5_IRQHandler\r
328   .thumb_set DMA1_Channel5_IRQHandler,Default_Handler\r
329 \r
330   .weak  DMA1_Channel6_IRQHandler\r
331   .thumb_set DMA1_Channel6_IRQHandler,Default_Handler\r
332 \r
333   .weak  DMA1_Channel7_IRQHandler\r
334   .thumb_set DMA1_Channel7_IRQHandler,Default_Handler\r
335 \r
336   .weak  ADC1_IRQHandler\r
337   .thumb_set ADC1_IRQHandler,Default_Handler\r
338 \r
339   .weak  EXTI9_5_IRQHandler\r
340   .thumb_set EXTI9_5_IRQHandler,Default_Handler\r
341 \r
342   .weak  TIM1_BRK_TIM15_IRQHandler\r
343   .thumb_set TIM1_BRK_TIM15_IRQHandler,Default_Handler\r
344 \r
345   .weak  TIM1_UP_TIM16_IRQHandler\r
346   .thumb_set TIM1_UP_TIM16_IRQHandler,Default_Handler\r
347 \r
348   .weak  TIM1_TRG_COM_TIM17_IRQHandler\r
349   .thumb_set TIM1_TRG_COM_TIM17_IRQHandler,Default_Handler\r
350 \r
351   .weak  TIM1_CC_IRQHandler\r
352   .thumb_set TIM1_CC_IRQHandler,Default_Handler\r
353 \r
354   .weak  TIM2_IRQHandler\r
355   .thumb_set TIM2_IRQHandler,Default_Handler\r
356 \r
357   .weak  TIM3_IRQHandler\r
358   .thumb_set TIM3_IRQHandler,Default_Handler\r
359 \r
360   .weak  TIM4_IRQHandler\r
361   .thumb_set TIM4_IRQHandler,Default_Handler\r
362 \r
363   .weak  I2C1_EV_IRQHandler\r
364   .thumb_set I2C1_EV_IRQHandler,Default_Handler\r
365 \r
366   .weak  I2C1_ER_IRQHandler\r
367   .thumb_set I2C1_ER_IRQHandler,Default_Handler\r
368 \r
369   .weak  I2C2_EV_IRQHandler\r
370   .thumb_set I2C2_EV_IRQHandler,Default_Handler\r
371 \r
372   .weak  I2C2_ER_IRQHandler\r
373   .thumb_set I2C2_ER_IRQHandler,Default_Handler\r
374 \r
375   .weak  SPI1_IRQHandler\r
376   .thumb_set SPI1_IRQHandler,Default_Handler\r
377 \r
378   .weak  SPI2_IRQHandler\r
379   .thumb_set SPI2_IRQHandler,Default_Handler\r
380 \r
381   .weak  USART1_IRQHandler\r
382   .thumb_set USART1_IRQHandler,Default_Handler\r
383 \r
384   .weak  USART2_IRQHandler\r
385   .thumb_set USART2_IRQHandler,Default_Handler\r
386 \r
387   .weak  USART3_IRQHandler\r
388   .thumb_set USART3_IRQHandler,Default_Handler\r
389 \r
390   .weak  EXTI15_10_IRQHandler\r
391   .thumb_set EXTI15_10_IRQHandler,Default_Handler\r
392 \r
393   .weak  RTCAlarm_IRQHandler\r
394   .thumb_set RTCAlarm_IRQHandler,Default_Handler\r
395 \r
396   .weak  CEC_IRQHandler\r
397   .thumb_set CEC_IRQHandler,Default_Handler\r
398 \r
399   .weak  TIM6_DAC_IRQHandler\r
400   .thumb_set TIM6_DAC_IRQHandler,Default_Handler\r
401 \r
402   .weak  TIM7_IRQHandler\r
403   .thumb_set TIM7_IRQHandler,Default_Handler  \r
404 \r
405 /******************* (C) COPYRIGHT 2010 STMicroelectronics *****END OF FILE****/\r
406 \r