2025-04-14 12:39 AM - last edited on 2025-04-14 1:48 AM by Andrew Neil
Split from:
as this is a new question.
Hello @STTwo-32 as the wake up pin associated with stm32L496 is SYSWKUP2 can i use this and on clicking the B1 (i.e. on board button) kindly let me know will the system gets woken up, also i cannot able to make my system to sleep mode even after using the HAL_EnableSLEEPmode(); function, i also tried using __RCC_HAL_DISABLE_A_PORT(not sure if it exactly matches with HAL macros) for disabling clock individually to every port of the board still it is not going to sleep mode.
2025-07-18 7:30 AM
Hello @Abhiram_12,
Before going to sleep mode, ensure that the WUF2 flag in the power status register is cleared
You can also check this Wiki that covers all low power modes entry/exit using an STM32L4: Getting started with PWR
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2025-07-18 6:11 PM
In Sleep mode, any interrupt will wake it up. That includes the SysTick.
void EnterSleepMode(void)
{
HAL_SuspendTick();
HAL_PWR_EnterSLEEPMode(PWR_LOWPOWERREGULATOR_ON, PWR_SLEEPENTRY_WFI);
HAL_ResumeTick();
}