2 ******************************************************************************
3 * @file startup_stm32f40_41xxx.s
4 * @author MCD Application Team
6 * @date 21-October-2015
7 * @brief STM32F40xxx/41xxx Devices vector table for Atollic TrueSTUDIO toolchain.
8 * Same as startup_stm32f40_41xxx.s and maintained for legacy purpose
9 * This module performs:
10 * - Set the initial SP
11 * - Set the initial PC == Reset_Handler,
12 * - Set the vector table entries with the exceptions ISR address
13 * - Configure the clock system and the external SRAM mounted on
14 * STM324xG-EVAL board to be used as data memory (optional,
15 * to be enabled by user)
16 * - Branches to main in the C library (which eventually
18 * After Reset the Cortex-M4 processor is in Thread mode,
19 * priority is Privileged, and the Stack is set to Main.
20 ******************************************************************************
23 * <h2><center>© COPYRIGHT 2015 STMicroelectronics</center></h2>
25 * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
26 * You may not use this file except in compliance with the License.
27 * You may obtain a copy of the License at:
29 * http://www.st.com/software_license_agreement_liberty_v2
31 * Unless required by applicable law or agreed to in writing, software
32 * distributed under the License is distributed on an "AS IS" BASIS,
33 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
34 * See the License for the specific language governing permissions and
35 * limitations under the License.
37 ******************************************************************************
46 .global Default_Handler
48 /* start address for the initialization values of the .data section.
49 defined in linker script */
51 /* start address for the .data section. defined in linker script */
53 /* end address for the .data section. defined in linker script */
55 /* start address for the .bss section. defined in linker script */
57 /* end address for the .bss section. defined in linker script */
59 /* stack used for SystemInit_ExtMemCtl; always internal RAM used */
62 * @brief This is the code that gets called when the processor first
63 * starts execution following a reset event. Only the absolutely
64 * necessary set is performed, after which the application
65 * supplied main() routine is called.
70 .section .text.Reset_Handler
72 .type Reset_Handler, %function
75 bl persistentObjectInit
76 bl checkForBootLoaderRequest
78 /* Copy the data segment initializers from flash to SRAM */
96 /* Zero fill the bss segment. */
106 /* Mark the heap and stack */
107 ldr
r2, =_heap_stack_begin
115 ldr
r3, = _heap_stack_end
120 ldr
r0, =0xE000ED88 /* Enable CP10,CP11 */
122 orr
r1,r1,#(0xF << 20)
125 /* Call the clock system intitialization function.*/
128 /* Call the application's entry point.*/
135 .size Reset_Handler, .-Reset_Handler
138 * @brief This is the code that gets called when the processor receives an
139 * unexpected interrupt. This simply enters an infinite loop, preserving
140 * the system state for examination by a debugger.
144 .section .text.Default_Handler,"ax",%progbits
148 .size Default_Handler, .-Default_Handler
149 /******************************************************************************
151 * The minimal vector table for a Cortex M4. Note that the proper constructs
152 * must be placed on this to ensure that it ends up at physical address
155 *******************************************************************************/
156 .section .isr_vector,"a",%progbits
157 .type g_pfnVectors, %object
158 .size g_pfnVectors, .-g_pfnVectors
165 .word HardFault_Handler
166 .word MemManage_Handler
167 .word BusFault_Handler
168 .word UsageFault_Handler
174 .word DebugMon_Handler
177 .word SysTick_Handler
179 /* External Interrupts */
180 .word WWDG_IRQHandler /* Window WatchDog */
181 .word PVD_IRQHandler /* PVD through EXTI Line detection */
182 .word TAMP_STAMP_IRQHandler /* Tamper and TimeStamps through the EXTI line */
183 .word RTC_WKUP_IRQHandler /* RTC Wakeup through the EXTI line */
184 .word FLASH_IRQHandler /* FLASH */
185 .word RCC_IRQHandler /* RCC */
186 .word EXTI0_IRQHandler /* EXTI Line0 */
187 .word EXTI1_IRQHandler /* EXTI Line1 */
188 .word EXTI2_IRQHandler /* EXTI Line2 */
189 .word EXTI3_IRQHandler /* EXTI Line3 */
190 .word EXTI4_IRQHandler /* EXTI Line4 */
191 .word DMA1_Stream0_IRQHandler /* DMA1 Stream 0 */
192 .word DMA1_Stream1_IRQHandler /* DMA1 Stream 1 */
193 .word DMA1_Stream2_IRQHandler /* DMA1 Stream 2 */
194 .word DMA1_Stream3_IRQHandler /* DMA1 Stream 3 */
195 .word DMA1_Stream4_IRQHandler /* DMA1 Stream 4 */
196 .word DMA1_Stream5_IRQHandler /* DMA1 Stream 5 */
197 .word DMA1_Stream6_IRQHandler /* DMA1 Stream 6 */
198 .word ADC_IRQHandler /* ADC1, ADC2 and ADC3s */
199 .word 0 /* CAN1 TX */
200 .word 0 /* CAN1 RX0 */
201 .word 0 /* CAN1 RX1 */
202 .word 0 /* CAN1 SCE */
203 .word EXTI9_5_IRQHandler /* External Line[9:5]s */
204 .word TIM1_BRK_TIM9_IRQHandler /* TIM1 Break and TIM9 */
205 .word TIM1_UP_TIM10_IRQHandler /* TIM1 Update and TIM10 */
206 .word TIM1_TRG_COM_TIM11_IRQHandler /* TIM1 Trigger and Commutation and TIM11 */
207 .word TIM1_CC_IRQHandler /* TIM1 Capture Compare */
208 .word TIM2_IRQHandler /* TIM2 */
209 .word TIM3_IRQHandler /* TIM3 */
210 .word TIM4_IRQHandler /* TIM4 */
211 .word I2C1_EV_IRQHandler /* I2C1 Event */
212 .word I2C1_ER_IRQHandler /* I2C1 Error */
213 .word I2C2_EV_IRQHandler /* I2C2 Event */
214 .word I2C2_ER_IRQHandler /* I2C2 Error */
215 .word SPI1_IRQHandler /* SPI1 */
216 .word SPI2_IRQHandler /* SPI2 */
217 .word USART1_IRQHandler /* USART1 */
218 .word USART2_IRQHandler /* USART2 */
220 .word EXTI15_10_IRQHandler /* External Line[15:10]s */
221 .word RTC_Alarm_IRQHandler /* RTC Alarm (A and B) through EXTI Line */
222 .word OTG_FS_WKUP_IRQHandler /* USB OTG FS Wakeup through EXTI line */
223 .word 0 /* TIM8 Break and TIM12 */
224 .word 0 /* TIM8 Update and TIM13 */
225 .word 0 /* TIM8 Trigger and Commutation and TIM14 */
226 .word 0 /* TIM8 Capture Compare */
227 .word DMA1_Stream7_IRQHandler /* DMA1 Stream7 */
229 .word SDIO_IRQHandler /* SDIO */
230 .word TIM5_IRQHandler /* TIM5 */
231 .word SPI3_IRQHandler /* SPI3 */
234 .word 0 /* TIM6 and DAC1&2 underrun errors */
236 .word DMA2_Stream0_IRQHandler /* DMA2 Stream 0 */
237 .word DMA2_Stream1_IRQHandler /* DMA2 Stream 1 */
238 .word DMA2_Stream2_IRQHandler /* DMA2 Stream 2 */
239 .word DMA2_Stream3_IRQHandler /* DMA2 Stream 3 */
240 .word DMA2_Stream4_IRQHandler /* DMA2 Stream 4 */
241 .word 0 /* Ethernet */
242 .word 0 /* Ethernet Wakeup through EXTI line */
243 .word 0 /* CAN2 TX */
244 .word 0 /* CAN2 RX0 */
245 .word 0 /* CAN2 RX1 */
246 .word 0 /* CAN2 SCE */
247 .word OTG_FS_IRQHandler /* USB OTG FS */
248 .word DMA2_Stream5_IRQHandler /* DMA2 Stream 5 */
249 .word DMA2_Stream6_IRQHandler /* DMA2 Stream 6 */
250 .word DMA2_Stream7_IRQHandler /* DMA2 Stream 7 */
251 .word USART6_IRQHandler /* USART6 */
252 .word I2C3_EV_IRQHandler /* I2C3 event */
253 .word I2C3_ER_IRQHandler /* I2C3 error */
254 .word 0 /* USB OTG HS End Point 1 Out */
255 .word 0 /* USB OTG HS End Point 1 In */
256 .word 0 /* USB OTG HS Wakeup through EXTI */
257 .word 0 /* USB OTG HS */
259 .word 0 /* CRYP crypto */
260 .word 0 /* Hash and Rng */
261 .word FPU_IRQHandler /* FPU */
262 .word 0 /* Reserved */
263 .word 0 /* Reserved */
264 .word SPI4_IRQHandler /* SPI4 */
265 .word SPI5_IRQHandler /* SPI5 */
266 /*******************************************************************************
268 * Provide weak aliases for each Exception handler to the Default_Handler.
269 * As they are weak aliases, any function with the same name will override
272 *******************************************************************************/
274 .thumb_set NMI_Handler,Default_Handler
276 .weak HardFault_Handler
277 .thumb_set HardFault_Handler,Default_Handler
279 .weak MemManage_Handler
280 .thumb_set MemManage_Handler,Default_Handler
282 .weak BusFault_Handler
283 .thumb_set BusFault_Handler,Default_Handler
285 .weak UsageFault_Handler
286 .thumb_set UsageFault_Handler,Default_Handler
289 .thumb_set SVC_Handler,Default_Handler
291 .weak DebugMon_Handler
292 .thumb_set DebugMon_Handler,Default_Handler
295 .thumb_set PendSV_Handler,Default_Handler
297 .weak SysTick_Handler
298 .thumb_set SysTick_Handler,Default_Handler
300 .weak WWDG_IRQHandler
301 .thumb_set WWDG_IRQHandler,Default_Handler
304 .thumb_set PVD_IRQHandler,Default_Handler
306 .weak TAMP_STAMP_IRQHandler
307 .thumb_set TAMP_STAMP_IRQHandler,Default_Handler
309 .weak RTC_WKUP_IRQHandler
310 .thumb_set RTC_WKUP_IRQHandler,Default_Handler
312 .weak FLASH_IRQHandler
313 .thumb_set FLASH_IRQHandler,Default_Handler
316 .thumb_set RCC_IRQHandler,Default_Handler
318 .weak EXTI0_IRQHandler
319 .thumb_set EXTI0_IRQHandler,Default_Handler
321 .weak EXTI1_IRQHandler
322 .thumb_set EXTI1_IRQHandler,Default_Handler
324 .weak EXTI2_IRQHandler
325 .thumb_set EXTI2_IRQHandler,Default_Handler
327 .weak EXTI3_IRQHandler
328 .thumb_set EXTI3_IRQHandler,Default_Handler
330 .weak EXTI4_IRQHandler
331 .thumb_set EXTI4_IRQHandler,Default_Handler
333 .weak DMA1_Stream0_IRQHandler
334 .thumb_set DMA1_Stream0_IRQHandler,Default_Handler
336 .weak DMA1_Stream1_IRQHandler
337 .thumb_set DMA1_Stream1_IRQHandler,Default_Handler
339 .weak DMA1_Stream2_IRQHandler
340 .thumb_set DMA1_Stream2_IRQHandler,Default_Handler
342 .weak DMA1_Stream3_IRQHandler
343 .thumb_set DMA1_Stream3_IRQHandler,Default_Handler
345 .weak DMA1_Stream4_IRQHandler
346 .thumb_set DMA1_Stream4_IRQHandler,Default_Handler
348 .weak DMA1_Stream5_IRQHandler
349 .thumb_set DMA1_Stream5_IRQHandler,Default_Handler
351 .weak DMA1_Stream6_IRQHandler
352 .thumb_set DMA1_Stream6_IRQHandler,Default_Handler
355 .thumb_set ADC_IRQHandler,Default_Handler
357 .weak EXTI9_5_IRQHandler
358 .thumb_set EXTI9_5_IRQHandler,Default_Handler
360 .weak TIM1_BRK_TIM9_IRQHandler
361 .thumb_set TIM1_BRK_TIM9_IRQHandler,Default_Handler
363 .weak TIM1_UP_TIM10_IRQHandler
364 .thumb_set TIM1_UP_TIM10_IRQHandler,Default_Handler
366 .weak TIM1_TRG_COM_TIM11_IRQHandler
367 .thumb_set TIM1_TRG_COM_TIM11_IRQHandler,Default_Handler
369 .weak TIM1_CC_IRQHandler
370 .thumb_set TIM1_CC_IRQHandler,Default_Handler
372 .weak TIM2_IRQHandler
373 .thumb_set TIM2_IRQHandler,Default_Handler
375 .weak TIM3_IRQHandler
376 .thumb_set TIM3_IRQHandler,Default_Handler
378 .weak TIM4_IRQHandler
379 .thumb_set TIM4_IRQHandler,Default_Handler
381 .weak I2C1_EV_IRQHandler
382 .thumb_set I2C1_EV_IRQHandler,Default_Handler
384 .weak I2C1_ER_IRQHandler
385 .thumb_set I2C1_ER_IRQHandler,Default_Handler
387 .weak I2C2_EV_IRQHandler
388 .thumb_set I2C2_EV_IRQHandler,Default_Handler
390 .weak I2C2_ER_IRQHandler
391 .thumb_set I2C2_ER_IRQHandler,Default_Handler
393 .weak SPI1_IRQHandler
394 .thumb_set SPI1_IRQHandler,Default_Handler
396 .weak SPI2_IRQHandler
397 .thumb_set SPI2_IRQHandler,Default_Handler
399 .weak USART1_IRQHandler
400 .thumb_set USART1_IRQHandler,Default_Handler
402 .weak USART2_IRQHandler
403 .thumb_set USART2_IRQHandler,Default_Handler
405 .weak EXTI15_10_IRQHandler
406 .thumb_set EXTI15_10_IRQHandler,Default_Handler
408 .weak RTC_Alarm_IRQHandler
409 .thumb_set RTC_Alarm_IRQHandler,Default_Handler
411 .weak OTG_FS_WKUP_IRQHandler
412 .thumb_set OTG_FS_WKUP_IRQHandler,Default_Handler
414 .weak DMA1_Stream7_IRQHandler
415 .thumb_set DMA1_Stream7_IRQHandler,Default_Handler
417 .weak SDIO_IRQHandler
418 .thumb_set SDIO_IRQHandler,Default_Handler
420 .weak TIM5_IRQHandler
421 .thumb_set TIM5_IRQHandler,Default_Handler
423 .weak SPI3_IRQHandler
424 .thumb_set SPI3_IRQHandler,Default_Handler
426 .weak DMA2_Stream0_IRQHandler
427 .thumb_set DMA2_Stream0_IRQHandler,Default_Handler
429 .weak DMA2_Stream1_IRQHandler
430 .thumb_set DMA2_Stream1_IRQHandler,Default_Handler
432 .weak DMA2_Stream2_IRQHandler
433 .thumb_set DMA2_Stream2_IRQHandler,Default_Handler
435 .weak DMA2_Stream3_IRQHandler
436 .thumb_set DMA2_Stream3_IRQHandler,Default_Handler
438 .weak DMA2_Stream4_IRQHandler
439 .thumb_set DMA2_Stream4_IRQHandler,Default_Handler
441 .weak OTG_FS_IRQHandler
442 .thumb_set OTG_FS_IRQHandler,Default_Handler
444 .weak DMA2_Stream5_IRQHandler
445 .thumb_set DMA2_Stream5_IRQHandler,Default_Handler
447 .weak DMA2_Stream6_IRQHandler
448 .thumb_set DMA2_Stream6_IRQHandler,Default_Handler
450 .weak DMA2_Stream7_IRQHandler
451 .thumb_set DMA2_Stream7_IRQHandler,Default_Handler
453 .weak USART6_IRQHandler
454 .thumb_set USART6_IRQHandler,Default_Handler
456 .weak I2C3_EV_IRQHandler
457 .thumb_set I2C3_EV_IRQHandler,Default_Handler
459 .weak I2C3_ER_IRQHandler
460 .thumb_set I2C3_ER_IRQHandler,Default_Handler
463 .thumb_set FPU_IRQHandler,Default_Handler
465 .weak SPI4_IRQHandler
466 .thumb_set SPI4_IRQHandler,Default_Handler
468 .weak SPI5_IRQHandler
469 .thumb_set SPI5_IRQHandler,Default_Handler
471 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/