Skip to main content
Associate
Mar 24, 2025 5:22 AM UTC
Solved

STM32WB standby mode error

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!!!

This topic has been closed for replies.
veryneoBest answer
Associate
Mar 28, 2025 1:05 AM UTC

I have identified the issue. A configurable event input's pending bit has been set.

2 replies

FilipKremen
ST Employee
Mar 24, 2025 11:57 AM UTC

Hello,

would it be possible to share the project?

 

Best regards,

Filip Kremen

veryneoAuthorBest answer
Associate
Mar 28, 2025 1:05 AM UTC

I have identified the issue. A configurable event input's pending bit has been set.