2 ******************************************************************************
3 * @file startup_stm32f746xx.s
4 * @author MCD Application Team
6 * @date 30-December-2016
7 * @brief STM32F746xx Devices vector table for GCC based toolchain.
8 * This module performs:
10 * - Set the initial PC == Reset_Handler,
11 * - Set the vector table entries with the exceptions ISR address
12 * - Branches to main in the C library (which eventually
14 * After Reset the Cortex-M7 processor is in Thread mode,
15 * priority is Privileged, and the Stack is set to Main.
16 ******************************************************************************
19 * <h2><center>© COPYRIGHT 2016 STMicroelectronics</center></h2>
21 * Redistribution and use in source and binary forms, with or without modification,
22 * are permitted provided that the following conditions are met:
23 * 1. Redistributions of source code must retain the above copyright notice,
24 * this list of conditions and the following disclaimer.
25 * 2. Redistributions in binary form must reproduce the above copyright notice,
26 * this list of conditions and the following disclaimer in the documentation
27 * and/or other materials provided with the distribution.
28 * 3. Neither the name of STMicroelectronics nor the names of its contributors
29 * may be used to endorse or promote products derived from this software
30 * without specific prior written permission.
32 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
33 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
34 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
35 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
36 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
37 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
38 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
39 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
40 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
41 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
43 ******************************************************************************
52 .global Default_Handler
54 /* start address for the initialization values of the .data section.
55 defined in linker script */
57 /* start address for the .data section. defined in linker script */
59 /* end address for the .data section. defined in linker script */
61 /* start address for the .bss section. defined in linker script */
63 /* end address for the .bss section. defined in linker script */
65 /* start address for the .fastram_bss section. defined in linker script */
67 /* end address for the .fastram_bss section. defined in linker script */
69 /* stack used for SystemInit_ExtMemCtl; always internal RAM used */
72 * @brief This is the code that gets called when the processor first
73 * starts execution following a reset event. Only the absolutely
74 * necessary set is performed, after which the application
75 * supplied main() routine is called.
80 .section .text.Reset_Handler
82 .type Reset_Handler, %function
84 ldr sp
, =_estack
/* set stack pointer */
86 bl persistentObjectInit
88 /* Copy the data segment initializers from flash to SRAM */
107 /* Zero fill the bss segment. */
119 /* Zero fill the sram2 segment. */
129 ldr
r2, =_sfastram_bss
130 b LoopFillZerofastram_bss
131 /* Zero fill the fastram_bss segment. */
136 LoopFillZerofastram_bss
:
137 ldr
r3, = _efastram_bss
139 bcc FillZerofastram_bss
141 /* Mark the heap and stack */
142 ldr
r2, =_heap_stack_begin
150 ldr
r3, = _heap_stack_end
154 /* Call the clock system initialization function.*/
156 /* Call the application's entry point.*/
159 .size Reset_Handler, .-Reset_Handler
162 * @brief This is the code that gets called when the processor receives an
163 * unexpected interrupt. This simply enters an infinite loop, preserving
164 * the system state for examination by a debugger.
168 .section .text.Default_Handler,"ax",%progbits
172 .size Default_Handler, .-Default_Handler
173 /******************************************************************************
175 * The minimal vector table for a Cortex M7. Note that the proper constructs
176 * must be placed on this to ensure that it ends up at physical address
179 *******************************************************************************/
180 .section .isr_vector,"a",%progbits
181 .type g_pfnVectors, %object
182 .size g_pfnVectors, .-g_pfnVectors
190 .word HardFault_Handler
191 .word MemManage_Handler
192 .word BusFault_Handler
193 .word UsageFault_Handler
199 .word DebugMon_Handler
202 .word SysTick_Handler
204 /* External Interrupts */
205 .word WWDG_IRQHandler /* Window WatchDog */
206 .word PVD_IRQHandler /* PVD through EXTI Line detection */
207 .word TAMP_STAMP_IRQHandler /* Tamper and TimeStamps through the EXTI line */
208 .word RTC_WKUP_IRQHandler /* RTC Wakeup through the EXTI line */
209 .word FLASH_IRQHandler /* FLASH */
210 .word RCC_IRQHandler /* RCC */
211 .word EXTI0_IRQHandler /* EXTI Line0 */
212 .word EXTI1_IRQHandler /* EXTI Line1 */
213 .word EXTI2_IRQHandler /* EXTI Line2 */
214 .word EXTI3_IRQHandler /* EXTI Line3 */
215 .word EXTI4_IRQHandler /* EXTI Line4 */
216 .word DMA1_Stream0_IRQHandler /* DMA1 Stream 0 */
217 .word DMA1_Stream1_IRQHandler /* DMA1 Stream 1 */
218 .word DMA1_Stream2_IRQHandler /* DMA1 Stream 2 */
219 .word DMA1_Stream3_IRQHandler /* DMA1 Stream 3 */
220 .word DMA1_Stream4_IRQHandler /* DMA1 Stream 4 */
221 .word DMA1_Stream5_IRQHandler /* DMA1 Stream 5 */
222 .word DMA1_Stream6_IRQHandler /* DMA1 Stream 6 */
223 .word ADC_IRQHandler /* ADC1, ADC2 and ADC3s */
224 .word CAN1_TX_IRQHandler /* CAN1 TX */
225 .word CAN1_RX0_IRQHandler /* CAN1 RX0 */
226 .word CAN1_RX1_IRQHandler /* CAN1 RX1 */
227 .word CAN1_SCE_IRQHandler /* CAN1 SCE */
228 .word EXTI9_5_IRQHandler /* External Line[9:5]s */
229 .word TIM1_BRK_TIM9_IRQHandler /* TIM1 Break and TIM9 */
230 .word TIM1_UP_TIM10_IRQHandler /* TIM1 Update and TIM10 */
231 .word TIM1_TRG_COM_TIM11_IRQHandler /* TIM1 Trigger and Commutation and TIM11 */
232 .word TIM1_CC_IRQHandler /* TIM1 Capture Compare */
233 .word TIM2_IRQHandler /* TIM2 */
234 .word TIM3_IRQHandler /* TIM3 */
235 .word TIM4_IRQHandler /* TIM4 */
236 .word I2C1_EV_IRQHandler /* I2C1 Event */
237 .word I2C1_ER_IRQHandler /* I2C1 Error */
238 .word I2C2_EV_IRQHandler /* I2C2 Event */
239 .word I2C2_ER_IRQHandler /* I2C2 Error */
240 .word SPI1_IRQHandler /* SPI1 */
241 .word SPI2_IRQHandler /* SPI2 */
242 .word USART1_IRQHandler /* USART1 */
243 .word USART2_IRQHandler /* USART2 */
244 .word USART3_IRQHandler /* USART3 */
245 .word EXTI15_10_IRQHandler /* External Line[15:10]s */
246 .word RTC_Alarm_IRQHandler /* RTC Alarm (A and B) through EXTI Line */
247 .word OTG_FS_WKUP_IRQHandler /* USB OTG FS Wakeup through EXTI line */
248 .word TIM8_BRK_TIM12_IRQHandler /* TIM8 Break and TIM12 */
249 .word TIM8_UP_TIM13_IRQHandler /* TIM8 Update and TIM13 */
250 .word TIM8_TRG_COM_TIM14_IRQHandler /* TIM8 Trigger and Commutation and TIM14 */
251 .word TIM8_CC_IRQHandler /* TIM8 Capture Compare */
252 .word DMA1_Stream7_IRQHandler /* DMA1 Stream7 */
253 .word FMC_IRQHandler /* FMC */
254 .word SDMMC1_IRQHandler /* SDMMC1 */
255 .word TIM5_IRQHandler /* TIM5 */
256 .word SPI3_IRQHandler /* SPI3 */
257 .word UART4_IRQHandler /* UART4 */
258 .word UART5_IRQHandler /* UART5 */
259 .word TIM6_DAC_IRQHandler /* TIM6 and DAC1&2 underrun errors */
260 .word TIM7_IRQHandler /* TIM7 */
261 .word DMA2_Stream0_IRQHandler /* DMA2 Stream 0 */
262 .word DMA2_Stream1_IRQHandler /* DMA2 Stream 1 */
263 .word DMA2_Stream2_IRQHandler /* DMA2 Stream 2 */
264 .word DMA2_Stream3_IRQHandler /* DMA2 Stream 3 */
265 .word DMA2_Stream4_IRQHandler /* DMA2 Stream 4 */
266 .word ETH_IRQHandler /* Ethernet */
267 .word ETH_WKUP_IRQHandler /* Ethernet Wakeup through EXTI line */
268 .word CAN2_TX_IRQHandler /* CAN2 TX */
269 .word CAN2_RX0_IRQHandler /* CAN2 RX0 */
270 .word CAN2_RX1_IRQHandler /* CAN2 RX1 */
271 .word CAN2_SCE_IRQHandler /* CAN2 SCE */
272 .word OTG_FS_IRQHandler /* USB OTG FS */
273 .word DMA2_Stream5_IRQHandler /* DMA2 Stream 5 */
274 .word DMA2_Stream6_IRQHandler /* DMA2 Stream 6 */
275 .word DMA2_Stream7_IRQHandler /* DMA2 Stream 7 */
276 .word USART6_IRQHandler /* USART6 */
277 .word I2C3_EV_IRQHandler /* I2C3 event */
278 .word I2C3_ER_IRQHandler /* I2C3 error */
279 .word OTG_HS_EP1_OUT_IRQHandler /* USB OTG HS End Point 1 Out */
280 .word OTG_HS_EP1_IN_IRQHandler /* USB OTG HS End Point 1 In */
281 .word OTG_HS_WKUP_IRQHandler /* USB OTG HS Wakeup through EXTI */
282 .word OTG_HS_IRQHandler /* USB OTG HS */
283 .word DCMI_IRQHandler /* DCMI */
284 .word 0 /* Reserved */
285 .word RNG_IRQHandler /* Rng */
286 .word FPU_IRQHandler /* FPU */
287 .word UART7_IRQHandler /* UART7 */
288 .word UART8_IRQHandler /* UART8 */
289 .word SPI4_IRQHandler /* SPI4 */
290 .word SPI5_IRQHandler /* SPI5 */
291 .word SPI6_IRQHandler /* SPI6 */
292 .word SAI1_IRQHandler /* SAI1 */
293 .word LTDC_IRQHandler /* LTDC */
294 .word LTDC_ER_IRQHandler /* LTDC error */
295 .word DMA2D_IRQHandler /* DMA2D */
296 .word SAI2_IRQHandler /* SAI2 */
297 .word QUADSPI_IRQHandler /* QUADSPI */
298 .word LPTIM1_IRQHandler /* LPTIM1 */
299 .word CEC_IRQHandler /* HDMI_CEC */
300 .word I2C4_EV_IRQHandler /* I2C4 Event */
301 .word I2C4_ER_IRQHandler /* I2C4 Error */
302 .word SPDIF_RX_IRQHandler /* SPDIF_RX */
304 /*******************************************************************************
306 * Provide weak aliases for each Exception handler to the Default_Handler.
307 * As they are weak aliases, any function with the same name will override
310 *******************************************************************************/
312 .thumb_set NMI_Handler,Default_Handler
314 .weak HardFault_Handler
315 .thumb_set HardFault_Handler,Default_Handler
317 .weak MemManage_Handler
318 .thumb_set MemManage_Handler,Default_Handler
320 .weak BusFault_Handler
321 .thumb_set BusFault_Handler,Default_Handler
323 .weak UsageFault_Handler
324 .thumb_set UsageFault_Handler,Default_Handler
327 .thumb_set SVC_Handler,Default_Handler
329 .weak DebugMon_Handler
330 .thumb_set DebugMon_Handler,Default_Handler
333 .thumb_set PendSV_Handler,Default_Handler
335 .weak SysTick_Handler
336 .thumb_set SysTick_Handler,Default_Handler
338 .weak WWDG_IRQHandler
339 .thumb_set WWDG_IRQHandler,Default_Handler
342 .thumb_set PVD_IRQHandler,Default_Handler
344 .weak TAMP_STAMP_IRQHandler
345 .thumb_set TAMP_STAMP_IRQHandler,Default_Handler
347 .weak RTC_WKUP_IRQHandler
348 .thumb_set RTC_WKUP_IRQHandler,Default_Handler
350 .weak FLASH_IRQHandler
351 .thumb_set FLASH_IRQHandler,Default_Handler
354 .thumb_set RCC_IRQHandler,Default_Handler
356 .weak EXTI0_IRQHandler
357 .thumb_set EXTI0_IRQHandler,Default_Handler
359 .weak EXTI1_IRQHandler
360 .thumb_set EXTI1_IRQHandler,Default_Handler
362 .weak EXTI2_IRQHandler
363 .thumb_set EXTI2_IRQHandler,Default_Handler
365 .weak EXTI3_IRQHandler
366 .thumb_set EXTI3_IRQHandler,Default_Handler
368 .weak EXTI4_IRQHandler
369 .thumb_set EXTI4_IRQHandler,Default_Handler
371 .weak DMA1_Stream0_IRQHandler
372 .thumb_set DMA1_Stream0_IRQHandler,Default_Handler
374 .weak DMA1_Stream1_IRQHandler
375 .thumb_set DMA1_Stream1_IRQHandler,Default_Handler
377 .weak DMA1_Stream2_IRQHandler
378 .thumb_set DMA1_Stream2_IRQHandler,Default_Handler
380 .weak DMA1_Stream3_IRQHandler
381 .thumb_set DMA1_Stream3_IRQHandler,Default_Handler
383 .weak DMA1_Stream4_IRQHandler
384 .thumb_set DMA1_Stream4_IRQHandler,Default_Handler
386 .weak DMA1_Stream5_IRQHandler
387 .thumb_set DMA1_Stream5_IRQHandler,Default_Handler
389 .weak DMA1_Stream6_IRQHandler
390 .thumb_set DMA1_Stream6_IRQHandler,Default_Handler
393 .thumb_set ADC_IRQHandler,Default_Handler
395 .weak CAN1_TX_IRQHandler
396 .thumb_set CAN1_TX_IRQHandler,Default_Handler
398 .weak CAN1_RX0_IRQHandler
399 .thumb_set CAN1_RX0_IRQHandler,Default_Handler
401 .weak CAN1_RX1_IRQHandler
402 .thumb_set CAN1_RX1_IRQHandler,Default_Handler
404 .weak CAN1_SCE_IRQHandler
405 .thumb_set CAN1_SCE_IRQHandler,Default_Handler
407 .weak EXTI9_5_IRQHandler
408 .thumb_set EXTI9_5_IRQHandler,Default_Handler
410 .weak TIM1_BRK_TIM9_IRQHandler
411 .thumb_set TIM1_BRK_TIM9_IRQHandler,Default_Handler
413 .weak TIM1_UP_TIM10_IRQHandler
414 .thumb_set TIM1_UP_TIM10_IRQHandler,Default_Handler
416 .weak TIM1_TRG_COM_TIM11_IRQHandler
417 .thumb_set TIM1_TRG_COM_TIM11_IRQHandler,Default_Handler
419 .weak TIM1_CC_IRQHandler
420 .thumb_set TIM1_CC_IRQHandler,Default_Handler
422 .weak TIM2_IRQHandler
423 .thumb_set TIM2_IRQHandler,Default_Handler
425 .weak TIM3_IRQHandler
426 .thumb_set TIM3_IRQHandler,Default_Handler
428 .weak TIM4_IRQHandler
429 .thumb_set TIM4_IRQHandler,Default_Handler
431 .weak I2C1_EV_IRQHandler
432 .thumb_set I2C1_EV_IRQHandler,Default_Handler
434 .weak I2C1_ER_IRQHandler
435 .thumb_set I2C1_ER_IRQHandler,Default_Handler
437 .weak I2C2_EV_IRQHandler
438 .thumb_set I2C2_EV_IRQHandler,Default_Handler
440 .weak I2C2_ER_IRQHandler
441 .thumb_set I2C2_ER_IRQHandler,Default_Handler
443 .weak SPI1_IRQHandler
444 .thumb_set SPI1_IRQHandler,Default_Handler
446 .weak SPI2_IRQHandler
447 .thumb_set SPI2_IRQHandler,Default_Handler
449 .weak USART1_IRQHandler
450 .thumb_set USART1_IRQHandler,Default_Handler
452 .weak USART2_IRQHandler
453 .thumb_set USART2_IRQHandler,Default_Handler
455 .weak USART3_IRQHandler
456 .thumb_set USART3_IRQHandler,Default_Handler
458 .weak EXTI15_10_IRQHandler
459 .thumb_set EXTI15_10_IRQHandler,Default_Handler
461 .weak RTC_Alarm_IRQHandler
462 .thumb_set RTC_Alarm_IRQHandler,Default_Handler
464 .weak OTG_FS_WKUP_IRQHandler
465 .thumb_set OTG_FS_WKUP_IRQHandler,Default_Handler
467 .weak TIM8_BRK_TIM12_IRQHandler
468 .thumb_set TIM8_BRK_TIM12_IRQHandler,Default_Handler
470 .weak TIM8_UP_TIM13_IRQHandler
471 .thumb_set TIM8_UP_TIM13_IRQHandler,Default_Handler
473 .weak TIM8_TRG_COM_TIM14_IRQHandler
474 .thumb_set TIM8_TRG_COM_TIM14_IRQHandler,Default_Handler
476 .weak TIM8_CC_IRQHandler
477 .thumb_set TIM8_CC_IRQHandler,Default_Handler
479 .weak DMA1_Stream7_IRQHandler
480 .thumb_set DMA1_Stream7_IRQHandler,Default_Handler
483 .thumb_set FMC_IRQHandler,Default_Handler
485 .weak SDMMC1_IRQHandler
486 .thumb_set SDMMC1_IRQHandler,Default_Handler
488 .weak TIM5_IRQHandler
489 .thumb_set TIM5_IRQHandler,Default_Handler
491 .weak SPI3_IRQHandler
492 .thumb_set SPI3_IRQHandler,Default_Handler
494 .weak UART4_IRQHandler
495 .thumb_set UART4_IRQHandler,Default_Handler
497 .weak UART5_IRQHandler
498 .thumb_set UART5_IRQHandler,Default_Handler
500 .weak TIM6_DAC_IRQHandler
501 .thumb_set TIM6_DAC_IRQHandler,Default_Handler
503 .weak TIM7_IRQHandler
504 .thumb_set TIM7_IRQHandler,Default_Handler
506 .weak DMA2_Stream0_IRQHandler
507 .thumb_set DMA2_Stream0_IRQHandler,Default_Handler
509 .weak DMA2_Stream1_IRQHandler
510 .thumb_set DMA2_Stream1_IRQHandler,Default_Handler
512 .weak DMA2_Stream2_IRQHandler
513 .thumb_set DMA2_Stream2_IRQHandler,Default_Handler
515 .weak DMA2_Stream3_IRQHandler
516 .thumb_set DMA2_Stream3_IRQHandler,Default_Handler
518 .weak DMA2_Stream4_IRQHandler
519 .thumb_set DMA2_Stream4_IRQHandler,Default_Handler
521 .weak DMA2_Stream4_IRQHandler
522 .thumb_set DMA2_Stream4_IRQHandler,Default_Handler
525 .thumb_set ETH_IRQHandler,Default_Handler
527 .weak ETH_WKUP_IRQHandler
528 .thumb_set ETH_WKUP_IRQHandler,Default_Handler
530 .weak CAN2_TX_IRQHandler
531 .thumb_set CAN2_TX_IRQHandler,Default_Handler
533 .weak CAN2_RX0_IRQHandler
534 .thumb_set CAN2_RX0_IRQHandler,Default_Handler
536 .weak CAN2_RX1_IRQHandler
537 .thumb_set CAN2_RX1_IRQHandler,Default_Handler
539 .weak CAN2_SCE_IRQHandler
540 .thumb_set CAN2_SCE_IRQHandler,Default_Handler
542 .weak OTG_FS_IRQHandler
543 .thumb_set OTG_FS_IRQHandler,Default_Handler
545 .weak DMA2_Stream5_IRQHandler
546 .thumb_set DMA2_Stream5_IRQHandler,Default_Handler
548 .weak DMA2_Stream6_IRQHandler
549 .thumb_set DMA2_Stream6_IRQHandler,Default_Handler
551 .weak DMA2_Stream7_IRQHandler
552 .thumb_set DMA2_Stream7_IRQHandler,Default_Handler
554 .weak USART6_IRQHandler
555 .thumb_set USART6_IRQHandler,Default_Handler
557 .weak I2C3_EV_IRQHandler
558 .thumb_set I2C3_EV_IRQHandler,Default_Handler
560 .weak I2C3_ER_IRQHandler
561 .thumb_set I2C3_ER_IRQHandler,Default_Handler
563 .weak OTG_HS_EP1_OUT_IRQHandler
564 .thumb_set OTG_HS_EP1_OUT_IRQHandler,Default_Handler
566 .weak OTG_HS_EP1_IN_IRQHandler
567 .thumb_set OTG_HS_EP1_IN_IRQHandler,Default_Handler
569 .weak OTG_HS_WKUP_IRQHandler
570 .thumb_set OTG_HS_WKUP_IRQHandler,Default_Handler
572 .weak OTG_HS_IRQHandler
573 .thumb_set OTG_HS_IRQHandler,Default_Handler
575 .weak DCMI_IRQHandler
576 .thumb_set DCMI_IRQHandler,Default_Handler
579 .thumb_set RNG_IRQHandler,Default_Handler
582 .thumb_set FPU_IRQHandler,Default_Handler
584 .weak UART7_IRQHandler
585 .thumb_set UART7_IRQHandler,Default_Handler
587 .weak UART8_IRQHandler
588 .thumb_set UART8_IRQHandler,Default_Handler
590 .weak SPI4_IRQHandler
591 .thumb_set SPI4_IRQHandler,Default_Handler
593 .weak SPI5_IRQHandler
594 .thumb_set SPI5_IRQHandler,Default_Handler
596 .weak SPI6_IRQHandler
597 .thumb_set SPI6_IRQHandler,Default_Handler
599 .weak SAI1_IRQHandler
600 .thumb_set SAI1_IRQHandler,Default_Handler
602 .weak LTDC_IRQHandler
603 .thumb_set LTDC_IRQHandler,Default_Handler
605 .weak LTDC_ER_IRQHandler
606 .thumb_set LTDC_ER_IRQHandler,Default_Handler
608 .weak DMA2D_IRQHandler
609 .thumb_set DMA2D_IRQHandler,Default_Handler
611 .weak SAI2_IRQHandler
612 .thumb_set SAI2_IRQHandler,Default_Handler
614 .weak QUADSPI_IRQHandler
615 .thumb_set QUADSPI_IRQHandler,Default_Handler
617 .weak LPTIM1_IRQHandler
618 .thumb_set LPTIM1_IRQHandler,Default_Handler
621 .thumb_set CEC_IRQHandler,Default_Handler
623 .weak I2C4_EV_IRQHandler
624 .thumb_set I2C4_EV_IRQHandler,Default_Handler
626 .weak I2C4_ER_IRQHandler
627 .thumb_set I2C4_ER_IRQHandler,Default_Handler
629 .weak SPDIF_RX_IRQHandler
630 .thumb_set SPDIF_RX_IRQHandler,Default_Handler
632 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/