Skip to main content
Associate
March 24, 2025
Solved

STM32WB standby mode error

  • March 24, 2025
  • 1 reply
  • 617 views

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

Best answer by veryneo

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

1 reply

FilipKremen
ST Employee
March 24, 2025

Hello,

would it be possible to share the project?

 

Best regards,

Filip Kremen

veryneoAuthorBest answer
Associate
March 28, 2025

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