cancel
Showing results for 
Search instead for 
Did you mean: 

Any indicator for why STM32 leaves SLEEP / STOP Mode?

LThal
Associate II

I'm using the STM32L152. At certain points in my code I go into STOP mode. It seems to come out immediately. I'm not sure what interrupt or event is causing this. Is there any indication somewhere what event caused the processor to change modes? Thanks.

3 REPLIES 3
Uwe Bonnes
Principal II

Did you have a look at:

The reset source can be identified by checking the reset flags in the control/status register,

RCC_CSR (see Section 6.3.14).

?

Jack Peacock_2
Senior III

Since any interrupt will wake the core from SLEEP mode you can look at the SCB->ICSR register in the Cortex core peripheral set. It will report the active interrupt request as an index into the vector table. Should work for STOP also if you use interrupts instead of events.

Jack Peacock

Peter Mather
Associate III

Almost certainly systick

use   HAL_SuspendTick(); HAL_ResumeTick(); around the sleep period