cancel
Showing results for 
Search instead for 
Did you mean: 

STM32WB standby mode error

veryneo
Associate II

When I enter standby mode using HAL_PWR_EnterSTANDBYMode(), the program is expected to halt at __WFI() until awakened, after which it should restart from the beginning. The function is shown as followed.Snipaste_2025-03-21_14-58-56.jpg

 

However, in my case, after executing __WFI(), the program immediately jump out from __WFI(), proceeds to execute subsequent statements. Debugging shows that the C1SBFflag in the PWR_EXTSCR register is not set, indicating the MCU failed to enter standby mode. This issue occurs specifically when disconnecting a peripheral (indirectly connected via a slave chip).

I check the SLEEPDEEP bit in SCR register and LMPS bits in PWR_CR1 register, all bits is set to 1 when program stopped at the breakpoint of CLEAR_BIT(SCB->SCR, ((uint32_t)SCB_SCR_SLEEPDEEP_Msk));shown in the picture
.

I also check the WUF flags in PWR_SR1, no bit set to 1.

 

I would like to inquire about the possible reasons that might prevent an MCU from entering standby mode normally.

THX!!!

1 REPLY 1
FilipKremen
ST Employee

Hello,

would it be possible to share the project?

 

Best regards,

Filip Kremen