cancel
Showing results for 
Search instead for 
Did you mean: 

stm32wb55 avoid exit from sleep mode with TIM2 is active

AFede.1
Associate

Hello everybody, I am working with a stm32wb55 and in my application I need to send the microcontroller to sleep for 5 second, wake up, perform some actions and go back to sleep.

I send the micro to sleeomode using the function  HAL_PWR_EnterSLEEPMode and then I use the RTC wakeup to exit the sleep mode.

However, I also need to trigger an external watchdog every 200ms, and to do this I set TIM2 to generate an interrupt every 200ms and send a pulse to the external watchdog.

The problem is that, due to the interrupt generated by TIM2, the system exits sleepmode every 200ms and I want to avoid that. ideally, I would like to send the micro to sleep and keep the TIM2 active without waking the system up.

Is there any way to do that?

Thank you.

1 REPLY 1
Remy ISSALYS
ST Employee

Hello,

Are you using the timer server and the low power manager as in STM32CubeWB example like in BLE_HeartRate? If you have an interrupt every 200 ms, the system will wake-up every 200 ms. Instead of using TIM2 to refresh the watchdog, maybe you can refresh it when you are in idle state or inside a task with a minor priority.

Best Regards