Skip to main content
Associate
August 27, 2025
Solved

Resuming Execution from the Same Code Line after Sleep Mode

  • August 27, 2025
  • 1 reply
  • 198 views

Hello,

The target MCU is STM32L151ZETx (LQFP144), and the main clock frequency is 32 MHz.

Normally, the system operates in Run mode, but I plan to use Sleep mode or Low Power Sleep mode when the supply current decreases.

My question is: when entering Sleep mode or Low Power Sleep mode and then returning to Run mode, is it possible to resume execution from the exact code line (or position) where it was before entering Sleep mode, without requiring clock setup or any additional operation?

Thank you.

Best answer by TDK

Both Sleep and LP Sleep will wake up on the next line of code after you send them to sleep. LP Sleep has system clock requirements. If you always run at those levels, no need to reconfigure clock after wake up.

See "5.3.5 Sleep mode" in the Reference Manual.

1 reply

TDK
TDKBest answer
Super User
August 27, 2025

Both Sleep and LP Sleep will wake up on the next line of code after you send them to sleep. LP Sleep has system clock requirements. If you always run at those levels, no need to reconfigure clock after wake up.

See "5.3.5 Sleep mode" in the Reference Manual.

"If you feel a post has answered your question, please click ""Accept as Solution""."
AnJungAuthor
Associate
August 27, 2025

Thank you, your answer was very helpful.