Skip to main content
Yoshi1
Associate II
March 2, 2022
Solved

Wake up immediately after shutdown in STM32L451

  • March 2, 2022
  • 1 reply
  • 1005 views

HAL_PWR_EnterSTANDBYMode() will still wait properly, but HAL_PWREx_EnterSHUTDOWNMode() will immediately return to RUN mode.

What do you think is the cause of immediate wakeup?

As shown below, the only code difference is whether to enable HAL_PWREx_EnterSHUTDOWNMode () or HAL_PWR_EnterSTANDBYMode ().

 __HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU);
 __HAL_PWR_CLEAR_FLAG(PWR_FLAG_SB);
 __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(&hrtc, RTC_FLAG_WUTF);
 while(1)
 {
 HAL_PWREx_EnterSHUTDOWNMode();
// HAL_PWR_EnterSTANDBYMode();
 }

Best regards,​

This topic has been closed for replies.
Best answer by Yoshi1

I solved it myself.

The cause was that nRST_SHDW was unchecked in the option byte.

Best regards,​

1 reply

Yoshi1
Yoshi1AuthorBest answer
Associate II
March 3, 2022

I solved it myself.

The cause was that nRST_SHDW was unchecked in the option byte.

Best regards,​

Technical Moderator
March 3, 2022

Hello @則幸 �?�岡​ ,

Really glad to know you overcame this problem.

Thank you for the update you provided.

Thanks

Imen

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks