2 ******************************************************************************
3 * @file startup_stm32f0xx.s
4 * @author MCD Application Team
6 * @date 17-January-2014
7 * @brief STM32F051 Devices vector table for RIDE7 toolchain.
8 * This module performs:
10 * - Set the initial PC == Reset_Handler,
11 * - Set the vector table entries with the exceptions ISR address
12 * - Configure the system clock
13 * - Branches to main in the C library (which eventually
15 * After Reset the Cortex-M0 processor is in Thread mode,
16 * priority is Privileged, and the Stack is set to Main.
17 ******************************************************************************
20 * <h2><center>© COPYRIGHT 2014 STMicroelectronics</center></h2>
22 * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
23 * You may not use this file except in compliance with the License.
24 * You may obtain a copy of the License at:
26 * http://www.st.com/software_license_agreement_liberty_v2
28 * Unless required by applicable law or agreed to in writing, software
29 * distributed under the License is distributed on an "AS IS" BASIS,
30 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31 * See the License for the specific language governing permissions and
32 * limitations under the License.
34 ******************************************************************************
43 .global Default_Handler
45 /* start address for the initialization values of the .data section.
46 defined in linker script */
48 /* start address for the .data section. defined in linker script */
50 /* end address for the .data section. defined in linker script */
52 /* start address for the .bss section. defined in linker script */
54 /* end address for the .bss section. defined in linker script */
57 .equ BootRAM, 0xF108F85F
59 * @brief This is the code that gets called when the processor first
60 * starts execution following a reset event. Only the absolutely
61 * necessary set is performed, after which the application
62 * supplied main() routine is called.
67 .section .text.Reset_Handler
69 .type Reset_Handler, %function
72 mov sp, r0 /* set stack pointer */
74 /* Copy the data segment initializers from flash to SRAM */
92 /* Zero fill the bss segment. */
104 /* Call the clock system intitialization function.*/
107 /* Call the application's entry point.*/
114 .size Reset_Handler, .-Reset_Handler
117 * @brief This is the code that swaps stack (from end of heap to irq_stack).
118 * Also reclaim the heap that was used as a stack.
122 .section .text.Stack_Change
124 .type Stack_Change, %function
127 /* Switches stack back momentarily to MSP */
131 /* add heap_post_rtos to the heap (if the capability/function exist) */
132 /* Also claim the unused memory (between end of heap to end of memory */
133 /* CAREFULL: the heap section must be the last section in RAM in order this to work */
134 ldr r0, = _init_stack_size
135 ldr r1, = _eheap_post_rtos
139 bl xPortIncreaseHeapSize
141 .size Stack_Change, .-Stack_Change
144 * @brief This is the code that gets called when the processor receives an
145 * unexpected interrupt. This simply enters an infinite loop, preserving
146 * the system state for examination by a debugger.
151 .section .text.Default_Handler,"ax",%progbits
155 .size Default_Handler, .-Default_Handler
156 /******************************************************************************
158 * The minimal vector table for a Cortex M0. Note that the proper constructs
159 * must be placed on this to ensure that it ends up at physical address
162 ******************************************************************************/
163 .section .isr_vector,"a",%progbits
164 .type g_pfnVectors, %object
165 .size g_pfnVectors, .-g_pfnVectors
173 .word HardFault_Handler
185 .word SysTick_Handler
188 .word WWDG_IRQHandler
191 .word FLASH_IRQHandler
193 .word EXTI0_1_IRQHandler
194 .word EXTI2_3_IRQHandler
195 .word EXTI4_15_IRQHandler
197 .word DMA1_Channel1_IRQHandler
198 .word DMA1_Channel2_3_IRQHandler
199 .word DMA1_Channel4_5_IRQHandler
200 .word ADC1_COMP_IRQHandler
201 .word TIM1_BRK_UP_TRG_COM_IRQHandler
202 .word TIM1_CC_IRQHandler
203 .word TIM2_IRQHandler
204 .word TIM3_IRQHandler
205 .word TIM6_DAC_IRQHandler
207 .word TIM14_IRQHandler
208 .word TIM15_IRQHandler
209 .word TIM16_IRQHandler
210 .word TIM17_IRQHandler
211 .word I2C1_IRQHandler
212 .word I2C2_IRQHandler
213 .word SPI1_IRQHandler
214 .word SPI2_IRQHandler
215 .word USART1_IRQHandler
216 .word USART2_IRQHandler
220 .word BootRAM /* @0x108. This is for boot in RAM mode for
221 STM32F0xx devices. */
223 /*******************************************************************************
225 * Provide weak aliases for each Exception handler to the Default_Handler.
226 * As they are weak aliases, any function with the same name will override
229 *******************************************************************************/
232 .thumb_set NMI_Handler,Default_Handler
234 .weak HardFault_Handler
235 .thumb_set HardFault_Handler,Default_Handler
238 .thumb_set SVC_Handler,Default_Handler
241 .thumb_set PendSV_Handler,Default_Handler
243 .weak SysTick_Handler
244 .thumb_set SysTick_Handler,Default_Handler
246 .weak WWDG_IRQHandler
247 .thumb_set WWDG_IRQHandler,Default_Handler
250 .thumb_set PVD_IRQHandler,Default_Handler
253 .thumb_set RTC_IRQHandler,Default_Handler
255 .weak FLASH_IRQHandler
256 .thumb_set FLASH_IRQHandler,Default_Handler
259 .thumb_set RCC_IRQHandler,Default_Handler
261 .weak EXTI0_1_IRQHandler
262 .thumb_set EXTI0_1_IRQHandler,Default_Handler
264 .weak EXTI2_3_IRQHandler
265 .thumb_set EXTI2_3_IRQHandler,Default_Handler
267 .weak EXTI4_15_IRQHandler
268 .thumb_set EXTI4_15_IRQHandler,Default_Handler
271 .thumb_set TS_IRQHandler,Default_Handler
273 .weak DMA1_Channel1_IRQHandler
274 .thumb_set DMA1_Channel1_IRQHandler,Default_Handler
276 .weak DMA1_Channel2_3_IRQHandler
277 .thumb_set DMA1_Channel2_3_IRQHandler,Default_Handler
279 .weak DMA1_Channel4_5_IRQHandler
280 .thumb_set DMA1_Channel4_5_IRQHandler,Default_Handler
282 .weak ADC1_COMP_IRQHandler
283 .thumb_set ADC1_COMP_IRQHandler,Default_Handler
285 .weak TIM1_BRK_UP_TRG_COM_IRQHandler
286 .thumb_set TIM1_BRK_UP_TRG_COM_IRQHandler,Default_Handler
288 .weak TIM1_CC_IRQHandler
289 .thumb_set TIM1_CC_IRQHandler,Default_Handler
291 .weak TIM2_IRQHandler
292 .thumb_set TIM2_IRQHandler,Default_Handler
294 .weak TIM3_IRQHandler
295 .thumb_set TIM3_IRQHandler,Default_Handler
297 .weak TIM6_DAC_IRQHandler
298 .thumb_set TIM6_DAC_IRQHandler,Default_Handler
300 .weak TIM14_IRQHandler
301 .thumb_set TIM14_IRQHandler,Default_Handler
303 .weak TIM15_IRQHandler
304 .thumb_set TIM15_IRQHandler,Default_Handler
306 .weak TIM16_IRQHandler
307 .thumb_set TIM16_IRQHandler,Default_Handler
309 .weak TIM17_IRQHandler
310 .thumb_set TIM17_IRQHandler,Default_Handler
312 .weak I2C1_IRQHandler
313 .thumb_set I2C1_IRQHandler,Default_Handler
315 .weak I2C2_IRQHandler
316 .thumb_set I2C2_IRQHandler,Default_Handler
318 .weak SPI1_IRQHandler
319 .thumb_set SPI1_IRQHandler,Default_Handler
321 .weak SPI2_IRQHandler
322 .thumb_set SPI2_IRQHandler,Default_Handler
324 .weak USART1_IRQHandler
325 .thumb_set USART1_IRQHandler,Default_Handler
327 .weak USART2_IRQHandler
328 .thumb_set USART2_IRQHandler,Default_Handler
331 .thumb_set CEC_IRQHandler,Default_Handler
333 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/