2022-07-07 03:27 AM
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.
2022-07-07 06:21 AM
You miss try read en.STM32L4_System_Power.pdf page 20 explain sleep use.
2022-07-07 06:59 AM
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
2022-07-07 07:08 AM
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.
2022-07-07 07:22 AM
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!