Here's what happens after the processor is reset:
- General-purpose registers have unknown values in them
- Stack pointer register is loaded with the value of the Initial SP value register located at 0x0000 (Vector Table)
- Link register will have 0xFFFFFFFF
- Program counter is loaded with the value of the Reset register located at 0x0004 (Vector Table)
- In the case of STM32F4, Reset register contains the address of the Reset_Handler which is defined in startup_stm32f40xx.s
- Reset_Handler performs microcontroller system setup, configures the system clock, eventually branches to __main (entry point of a program) in the C library.
- Vector Table is mapped to address 0 at reset (can be relocated in this range: 0x00000080 - 0x3FFFFF80)
Summary of registers and their roles in the procedure call standard (AAPCS).
No comments:
Post a Comment