Skip to main content
Associate
Aug 27, 2025 12:56 AM UTC
Solved

Resuming Execution from the Same Code Line after Sleep Mode

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.

This topic has been closed for replies.
TDK
TDKBest answer
Aug 27, 2025 2:11 AM UTC

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""."

2 replies

TDK
TDKBest answer
Aug 27, 2025 2:11 AM UTC

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
Aug 27, 2025 2:50 AM UTC

Thank you, your answer was very helpful.