2025-11-20 7:24 AM
Good day,
I have a simple custom board with a STM32WL31 that needs to cyclically enter DEEPSTOP mode and then wake by means of RTC internal wakeup. It seems the device enters DEEPSTOP, but does not wake from it.
Basic setup:
I can confirm RTC runs, RTC interrupt occurs every 1s, and HAL_PWR_EnterSLEEPMode() behaves correctly.
However, when I enter DEEPSTOP with the sequence below, then the code never gets to HAL_ResumeTick() (reset after a few seconds by IWDT):
PWR_DEEPSTOPTypeDef sConfigDEEPSTOP;
sConfigDEEPSTOP.deepStopMode = PWR_DEEPSTOP_WITH_SLOW_CLOCK_ON;
HAL_PWR_ConfigDEEPSTOP(&sConfigDEEPSTOP);
HAL_SuspendTick();
HAL_PWR_EnterDEEPSTOPMode();
HAL_ResumeTick();
Below is a reg dump of possible relevant registers just before calling SET_BIT(SCB->SCR, SCB_SCR_SLEEPDEEP_Msk) in HAL_PWR_EnterDEEPSTOPMode().
PWR_CR1=0x00000114
PWR_CR2=0x00000120
PWR_IEWU=0x00000002
PWR_IWUP=0x00000002
PWR_IWUF=0x00000000
PWR_SR2=0x0000F3F0
PWR_CR5=0x00006514
PWR_DBGR=0x00000000
PWR_EXTSRR=0x00000000
RCC_CR=0x00001430
RCC_CFGR=0x00008000
RTC_CR=0x00005504
RTC_ISR=0x00000023
RTC_WUTR=0x00000001
Kindly advise any fixes or suggestions - thank you.