cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L496 Sleep & Wakeup

Abhiram_12
Associate II

Split from:

https://community.st.com/t5/stm32-mcus-products/is-is-possible-to-wakeup-the-stm32l496-with-an-external/td-p/741267

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. 

Abhiram_12_0-1744616362065.pngAbhiram_12_1-1744616380305.png

 

2 REPLIES 2
Sarra.S
ST Employee

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.

Karl Yamashita
Principal

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();
}

 

If you FIFO doesn't work, then it's called GIGO.
TimerCallback tutorial! | UART and DMA Idle with multiple UART instances tutorial!

If you find my solution useful, please click the Accept as Solution so others see the solution.