cancel
Showing results for 
Search instead for 
Did you mean: 

Wake up immediately after shutdown in STM32L451

Yoshi1
Associate III

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,​

1 ACCEPTED SOLUTION

Accepted Solutions
Yoshi1
Associate III

I solved it myself.

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

Best regards,​

View solution in original post

2 REPLIES 2
Yoshi1
Associate III

I solved it myself.

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

Best regards,​

Hello @則幸 �?�岡​ ,

Really glad to know you overcame this problem.

Thank you for the update you provided.

Thanks

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen