STM32启动流程

1、上电执行启动文件startup_stm32f303xc.s

(1)Set the initial SP

(2)Set the initial PC == Reset_Handler

(3)Set the vector table entries with the exceptions ISR address

(4)Branches to __main in the C library (which eventually calls main()).


After Reset the CortexM4 processor is in Thread mode, priority is Privileged, and the Stack is set to Main.





; Reset handler
Reset_Handler    PROC
                 EXPORT  Reset_Handler             [WEAK]
IMPORT  SystemInit
IMPORT  __main


                 LDR     R0, =SystemInit
                 BLX     R0
                 LDR     R0, =__main
                 BX      R0
                 ENDP

你可能感兴趣的:(STM32学习,启动程序)