2025-07-15 11:36 AM
I am trying to get shutdown and wakeup working using the blue top switch on the Nucleo-L433RC-P board.
I have set GPIO pin PC13 to SYS_WKUP2...
Below is my code...
HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN2);
while (1) {
status = HAL_GPIO_ReadPin(GPIOC, PWR_SWITCH_Pin);
if(status)
{
HAL_PWR_DisableWakeUpPin(PWR_WAKEUP_PIN2);
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU);
HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN2);
HAL_Delay(1000);
HAL_PWREx_EnterSHUTDOWNMode();
}
}
When I press the button, it goes into shutdown correctly.
However, as soon as its shutdown it wakes back up again (even though the button has not been pressed).
Why is this happening and how do I resolve it ?
2025-07-15 11:47 AM
Did you suspend the SysTick? Here are some tips: Tips for using STM32 low-power modes - STMicroelectronics Community
hth
KnarfB
2025-07-15 11:54 AM
No I dont suspend the SysTick.
In the link you sent, it only mentions suspending the SysTick for sleep and stop modes, not for shutdown which I am using....
"For sleep and stop modes, you want to suspend the SysTick system timer before entering the low power mode"
2025-07-15 11:59 AM