Solved
Wake up immediately after shutdown in STM32L451
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,