Why do we have to clear Deep Sleep bit after wake up?
- 4 replies
- 3107 views
Hi everyone,
Is anyone can explain the SLEEPDEEP bit from SCB->SCR with more information than the pm0214 stm32 cortex-m4 reference manual?
Controls whether the processor uses sleep or deep sleep as its low power mode: 0=Sleep, 1=Deep Sleep
What i want to know exactly is why do we need to reset this bit when waking up?
If you refer to the image attached, taken from HAL_PWREx_EnterSTOP2Mode, first line after __WFE(),is to clear back the deep sleep bit.
What is the effect to clear that bit?
For your information. it seems to be very important on STM32WLE4CB because it fixed a mcu deadlock/crash issue i had recently. I had a __NOP() following the __WFE() instead of the deepsleep bit clearing.
Any information you got regarding this will be very helpful to understand.
Best Regards
