Only call strtoul when there is an argument that strtoul can work on
[fw/stlink] / example / 32l_dac / startup_stm32l1xx_md.s
1 /**\r
2  ******************************************************************************\r
3  * @file      startup_stm32l1xx_md.s\r
4  * @author    MCD Application Team\r
5  * @version   V1.0.0\r
6  * @date      31-December-2010\r
7  * @brief     STM32L1xx Ultra Low Power Medium-density Devices vector table for \r
8  *            RIDE7 toolchain.\r
9  *            This module performs:\r
10  *                - Set the initial SP\r
11  *                - Set the initial PC == Reset_Handler,\r
12  *                - Set the vector table entries with the exceptions ISR address\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  * @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  * <h2><center>&copy; COPYRIGHT 2010 STMicroelectronics</center></h2>\r
28  ******************************************************************************* \r
29  */\r
30     \r
31   .syntax unified\r
32   .cpu cortex-m3\r
33   .fpu softvfp\r
34   .thumb\r
35 \r
36 .global g_pfnVectors\r
37 .global Default_Handler\r
38 \r
39 /* start address for the initialization values of the .data section. \r
40 defined in linker script */\r
41 .word _sidata\r
42 /* start address for the .data section. defined in linker script */  \r
43 .word _sdata\r
44 /* end address for the .data section. defined in linker script */\r
45 .word _edata\r
46 /* start address for the .bss section. defined in linker script */\r
47 .word _sbss\r
48 /* end address for the .bss section. defined in linker script */\r
49 .word _ebss\r
50 \r
51 .equ  BootRAM, 0xF108F85F\r
52 /**\r
53  * @brief  This is the code that gets called when the processor first\r
54  *          starts execution following a reset event. Only the absolutely\r
55  *          necessary set is performed, after which the application\r
56  *          supplied main() routine is called. \r
57  * @param  None\r
58  * @retval : None\r
59 */\r
60 \r
61     .section .text.Reset_Handler\r
62   .weak Reset_Handler\r
63   .type Reset_Handler, %function\r
64 Reset_Handler:\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 /* Call the clock system intitialization function.*/\r
93 /* let main do the system initialization */\r
94   bl  SystemInit\r
95 /* Call the application's entry point.*/\r
96   bl main\r
97   bx lr\r
98 .size Reset_Handler, .-Reset_Handler\r
99 \r
100 /**\r
101  * @brief  This is the code that gets called when the processor receives an \r
102  *         unexpected interrupt.  This simply enters an infinite loop, preserving\r
103  *         the system state for examination by a debugger.\r
104  *\r
105  * @param  None     \r
106  * @retval None       \r
107 */\r
108     .section .text.Default_Handler,"ax",%progbits\r
109 Default_Handler:\r
110 Infinite_Loop:\r
111   b Infinite_Loop\r
112   .size Default_Handler, .-Default_Handler\r
113 /*******************************************************************************\r
114 *\r
115 * The minimal vector table for a Cortex M3. Note that the proper constructs\r
116 * must be placed on this to ensure that it ends up at physical address\r
117 * 0x0000.0000.\r
118 *******************************************************************************/    \r
119   .section .isr_vector,"a",%progbits\r
120   .type g_pfnVectors, %object\r
121   .size g_pfnVectors, .-g_pfnVectors\r
122     \r
123     \r
124 g_pfnVectors:\r
125   .word _estack\r
126   .word Reset_Handler\r
127   .word NMI_Handler\r
128   .word HardFault_Handler\r
129   .word MemManage_Handler\r
130   .word BusFault_Handler\r
131   .word UsageFault_Handler\r
132   .word 0\r
133   .word 0\r
134   .word 0\r
135   .word 0\r
136   .word SVC_Handler\r
137   .word DebugMon_Handler\r
138   .word 0\r
139   .word PendSV_Handler\r
140   .word SysTick_Handler\r
141   .word WWDG_IRQHandler\r
142   .word PVD_IRQHandler\r
143   .word TAMPER_STAMP_IRQHandler\r
144   .word RTC_WKUP_IRQHandler\r
145   .word FLASH_IRQHandler\r
146   .word RCC_IRQHandler\r
147   .word EXTI0_IRQHandler\r
148   .word EXTI1_IRQHandler\r
149   .word EXTI2_IRQHandler\r
150   .word EXTI3_IRQHandler\r
151   .word EXTI4_IRQHandler\r
152   .word DMA1_Channel1_IRQHandler\r
153   .word DMA1_Channel2_IRQHandler\r
154   .word DMA1_Channel3_IRQHandler\r
155   .word DMA1_Channel4_IRQHandler\r
156   .word DMA1_Channel5_IRQHandler\r
157   .word DMA1_Channel6_IRQHandler\r
158   .word DMA1_Channel7_IRQHandler\r
159   .word ADC1_IRQHandler\r
160   .word USB_HP_IRQHandler\r
161   .word USB_LP_IRQHandler\r
162   .word DAC_IRQHandler\r
163   .word COMP_IRQHandler\r
164   .word EXTI9_5_IRQHandler\r
165   .word LCD_IRQHandler\r
166   .word TIM9_IRQHandler\r
167   .word TIM10_IRQHandler\r
168   .word TIM11_IRQHandler\r
169   .word TIM2_IRQHandler\r
170   .word TIM3_IRQHandler\r
171   .word TIM4_IRQHandler\r
172   .word I2C1_EV_IRQHandler\r
173   .word I2C1_ER_IRQHandler\r
174   .word I2C2_EV_IRQHandler\r
175   .word I2C2_ER_IRQHandler\r
176   .word SPI1_IRQHandler\r
177   .word SPI2_IRQHandler\r
178   .word USART1_IRQHandler\r
179   .word USART2_IRQHandler\r
180   .word USART3_IRQHandler\r
181   .word EXTI15_10_IRQHandler\r
182   .word RTC_Alarm_IRQHandler\r
183   .word USB_FS_WKUP_IRQHandler\r
184   .word TIM6_IRQHandler\r
185   .word TIM7_IRQHandler\r
186   .word 0\r
187   .word 0\r
188   .word 0\r
189   .word 0\r
190   .word 0\r
191   .word BootRAM          /* @0x108. This is for boot in RAM mode for \r
192                             STM32L15x ULtra Low Power Medium-density devices. */\r
193    \r
194 /*******************************************************************************\r
195 *\r
196 * Provide weak aliases for each Exception handler to the Default_Handler. \r
197 * As they are weak aliases, any function with the same name will override \r
198 * this definition.\r
199 *\r
200 *******************************************************************************/\r
201     \r
202   .weak NMI_Handler\r
203   .thumb_set NMI_Handler,Default_Handler\r
204 \r
205   .weak HardFault_Handler\r
206   .thumb_set HardFault_Handler,Default_Handler\r
207 \r
208   .weak MemManage_Handler\r
209   .thumb_set MemManage_Handler,Default_Handler\r
210 \r
211   .weak BusFault_Handler\r
212   .thumb_set BusFault_Handler,Default_Handler\r
213 \r
214   .weak UsageFault_Handler\r
215   .thumb_set UsageFault_Handler,Default_Handler\r
216 \r
217   .weak SVC_Handler\r
218   .thumb_set SVC_Handler,Default_Handler\r
219 \r
220   .weak DebugMon_Handler\r
221   .thumb_set DebugMon_Handler,Default_Handler\r
222 \r
223   .weak PendSV_Handler\r
224   .thumb_set PendSV_Handler,Default_Handler\r
225 \r
226   .weak SysTick_Handler\r
227   .thumb_set SysTick_Handler,Default_Handler\r
228 \r
229   .weak WWDG_IRQHandler\r
230   .thumb_set WWDG_IRQHandler,Default_Handler\r
231 \r
232   .weak PVD_IRQHandler\r
233   .thumb_set PVD_IRQHandler,Default_Handler\r
234 \r
235   .weak TAMPER_STAMP_IRQHandler\r
236   .thumb_set TAMPER_STAMP_IRQHandler,Default_Handler\r
237 \r
238   .weak RTC_WKUP_IRQHandler\r
239   .thumb_set RTC_WKUP_IRQHandler,Default_Handler\r
240 \r
241   .weak FLASH_IRQHandler\r
242   .thumb_set FLASH_IRQHandler,Default_Handler\r
243 \r
244   .weak RCC_IRQHandler\r
245   .thumb_set RCC_IRQHandler,Default_Handler\r
246 \r
247   .weak EXTI0_IRQHandler\r
248   .thumb_set EXTI0_IRQHandler,Default_Handler\r
249 \r
250   .weak EXTI1_IRQHandler\r
251   .thumb_set EXTI1_IRQHandler,Default_Handler\r
252 \r
253   .weak EXTI2_IRQHandler\r
254   .thumb_set EXTI2_IRQHandler,Default_Handler\r
255 \r
256   .weak EXTI3_IRQHandler\r
257   .thumb_set EXTI3_IRQHandler,Default_Handler\r
258 \r
259   .weak EXTI4_IRQHandler\r
260   .thumb_set EXTI4_IRQHandler,Default_Handler\r
261 \r
262   .weak DMA1_Channel1_IRQHandler\r
263   .thumb_set DMA1_Channel1_IRQHandler,Default_Handler\r
264 \r
265   .weak DMA1_Channel2_IRQHandler\r
266   .thumb_set DMA1_Channel2_IRQHandler,Default_Handler\r
267 \r
268   .weak DMA1_Channel3_IRQHandler\r
269   .thumb_set DMA1_Channel3_IRQHandler,Default_Handler\r
270 \r
271   .weak DMA1_Channel4_IRQHandler\r
272   .thumb_set DMA1_Channel4_IRQHandler,Default_Handler\r
273 \r
274   .weak DMA1_Channel5_IRQHandler\r
275   .thumb_set DMA1_Channel5_IRQHandler,Default_Handler\r
276 \r
277   .weak DMA1_Channel6_IRQHandler\r
278   .thumb_set DMA1_Channel6_IRQHandler,Default_Handler\r
279 \r
280   .weak DMA1_Channel7_IRQHandler\r
281   .thumb_set DMA1_Channel7_IRQHandler,Default_Handler\r
282 \r
283   .weak ADC1_IRQHandler\r
284   .thumb_set ADC1_IRQHandler,Default_Handler\r
285 \r
286   .weak USB_HP_IRQHandler\r
287   .thumb_set USB_HP_IRQHandler,Default_Handler\r
288 \r
289   .weak USB_LP_IRQHandler\r
290   .thumb_set USB_LP_IRQHandler,Default_Handler\r
291 \r
292   .weak DAC_IRQHandler\r
293   .thumb_set DAC_IRQHandler,Default_Handler\r
294 \r
295   .weak COMP_IRQHandler\r
296   .thumb_set COMP_IRQHandler,Default_Handler\r
297 \r
298   .weak EXTI9_5_IRQHandler\r
299   .thumb_set EXTI9_5_IRQHandler,Default_Handler\r
300 \r
301   .weak LCD_IRQHandler\r
302   .thumb_set LCD_IRQHandler,Default_Handler\r
303   \r
304   .weak TIM9_IRQHandler\r
305   .thumb_set TIM9_IRQHandler,Default_Handler\r
306 \r
307   .weak TIM10_IRQHandler\r
308   .thumb_set TIM10_IRQHandler,Default_Handler\r
309 \r
310   .weak TIM11_IRQHandler\r
311   .thumb_set TIM11_IRQHandler,Default_Handler\r
312 \r
313   .weak TIM2_IRQHandler\r
314   .thumb_set TIM2_IRQHandler,Default_Handler\r
315 \r
316   .weak TIM3_IRQHandler\r
317   .thumb_set TIM3_IRQHandler,Default_Handler\r
318 \r
319   .weak TIM4_IRQHandler\r
320   .thumb_set TIM4_IRQHandler,Default_Handler\r
321 \r
322   .weak I2C1_EV_IRQHandler\r
323   .thumb_set I2C1_EV_IRQHandler,Default_Handler\r
324 \r
325   .weak I2C1_ER_IRQHandler\r
326   .thumb_set I2C1_ER_IRQHandler,Default_Handler\r
327 \r
328   .weak I2C2_EV_IRQHandler\r
329   .thumb_set I2C2_EV_IRQHandler,Default_Handler\r
330 \r
331   .weak I2C2_ER_IRQHandler\r
332   .thumb_set I2C2_ER_IRQHandler,Default_Handler\r
333 \r
334   .weak SPI1_IRQHandler\r
335   .thumb_set SPI1_IRQHandler,Default_Handler\r
336 \r
337   .weak SPI2_IRQHandler\r
338   .thumb_set SPI2_IRQHandler,Default_Handler\r
339 \r
340   .weak USART1_IRQHandler\r
341   .thumb_set USART1_IRQHandler,Default_Handler\r
342 \r
343   .weak USART2_IRQHandler\r
344   .thumb_set USART2_IRQHandler,Default_Handler\r
345 \r
346   .weak USART3_IRQHandler\r
347   .thumb_set USART3_IRQHandler,Default_Handler\r
348 \r
349   .weak EXTI15_10_IRQHandler\r
350   .thumb_set EXTI15_10_IRQHandler,Default_Handler\r
351 \r
352   .weak RTC_Alarm_IRQHandler\r
353   .thumb_set RTC_Alarm_IRQHandler,Default_Handler\r
354 \r
355   .weak USB_FS_WKUP_IRQHandler\r
356   .thumb_set USB_FS_WKUP_IRQHandler,Default_Handler\r
357 \r
358   .weak TIM6_IRQHandler\r
359   .thumb_set TIM6_IRQHandler,Default_Handler\r
360 \r
361   .weak TIM7_IRQHandler\r
362   .thumb_set TIM7_IRQHandler,Default_Handler\r
363 \r
364 /******************** (C) COPYRIGHT 2010 STMicroelectronics *****END OF FILE***/\r
365 \r