Loading...
 
Skip to main content

System Workbench for STM32


stack pointer initialization

Sometimes SP may not be pointing to the end of the stack on bootup. So the instruction "ldr sp, =_estack" /* set stack pointer */ will forcefully set the SP to end of the stack. I found this behavior in STM32F103VEt MCU whose code was generated by using CubeMx. The expected stack pointer register value on startup was "0x20005000" but the value found in the SP was "0x200001FC".
 
Collapse/expand modules below