cancel
Showing results for 
Search instead for 
Did you mean: 

Resuming Execution from the Same Code Line after Sleep Mode

AnJung
Visitor

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.

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Super User

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

View solution in original post

2 REPLIES 2
TDK
Super User

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

Thank you, your answer was very helpful.