cancel
Showing results for 
Search instead for 
Did you mean: 

Why are basic peripherals not working in sleep mode?

RAnan.3
Associate III

Hi I am using stm32l452RC for my project. When I put the MCU to sleep using  HAL_PWR_EnterSLEEPMode(PWR_MAINREGULATOR_ON, PWR_SLEEPENTRY_WFI)

all my general purpose timers are not running. I use  HAL_SuspendTick() before making the MCU go into sleep mode. To wakeup and comeback form sleep mode I use a push button whose action will be to resume systick again......I use  HAL_ResumeTick() for resuming systick.

My first question is Why do my peripherals dont work when I enter slee mode

Second question is ,Is it necessary to sto and resume systick in the course of sleep operation? Can someone answer ASAP.

4 REPLIES 4
MM..1
Chief II

You miss try read en.STM32L4_System_Power.pdf page 20 explain sleep use.

Simon.T
ST Employee

Hello @RAnan.3​,

Concerning the second question. The systick will provide an interupt each ms. So you always need to stop the systick before entering in a low power mode (especially for SLEEP mode and STOP mode), Unless this the MCU will wakeup after 1ms.

BR,

Simon

Hey thanks, How do I make a MCU to wakeup to an particular peripheral's interrupt only(say GPIO_EXTI) ignoring interrupts from other peripherals like systick and UART.

The whole point of SLEEP and STOP modes is to minimise power consumption.

Therefore, if you don't want a peripheral to wake the CPU, just disable that peripheral!