Skip to main content
RAnan.3
Associate III
July 7, 2022
Question

Why are basic peripherals not working in sleep mode?

  • July 7, 2022
  • 2 replies
  • 987 views

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.

This topic has been closed for replies.

2 replies

MM..1
Chief III
July 7, 2022

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

Simon.T
ST Employee
July 7, 2022

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

RAnan.3
RAnan.3Author
Associate III
July 7, 2022

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.

Andrew Neil
Super User
July 7, 2022

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!

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.