cancel
Showing results for 
Search instead for 
Did you mean: 

Can you please explalin about the steps involved from getting powered on to calling user main function of a general STM32 MCU? Thanks in advance.

VRapa
Associate II
 
1 REPLY 1

The processor reads the first word from the Vector Table at a given address (usually 0x0000'0000, into which in most STM32 usually the FLASH is remapped from 0x0800'0000) and stores it into SP (R14); then it reads the second word and stores it into PC (R15) which means a jump to that address, i.e. program execution starts there.

That's all.

Now toolchains usually supply a method to have the vector table filled by both the interrupt vectors and the execution start address, usually through a startup file, which is often an assembler file (i.e. its name is usually something like startup_stm32XXXX.s). That then also contains the startup code, which initializes the global and static variables required by the C standard, sometimes also performs clocks setup and some other peripherals setup e.g. for external memories, and then jumps to main().

JW