cancel
Showing results for 
Search instead for 
Did you mean: 

How to handle watchdog in low power modes standby and shutdown (STM32L433)

freeflyer
Senior III

I tried to use the internal watchdog IWDG and WWDG) on an STM32L433

It worked fine until the device went into low power modes, standby and shutdown.

Because the watchdogs still runs during low power modes, but as the prcoessor is not running the watchdog times out and keeps resetting the processor.

So then I looked at using an external watchdog (STWD100) which can be disabled when in low power mode.  I wrote a post about the topic here...

https://community.st.com/t5/others-stm32-mcus-related/how-to-interface-external-watchdog-stwd100-with-stm32/m-p/879006#M9433

But a comment was made that "If you can enable and disable the watchdog, wild-running code can as well, and you cannot really rely on the watchdog"

So how should a watchdog (internal or external) be handled in low power modes ?

Surely you dont want to keep waking the processor every few milliseconds just to reset the watchdog timer, as the defies the point of being in low power mode to save battery power ?

I was told that the watchdog timer can be frozen in standby, but this does not solve the problem when in shutdown.

3 REPLIES 3
Gyessine
ST Employee

Hello @freeflyer 
As a first step and before considering an external watchdog
I want to ensure something here:
>Because the watchdogs still run during low power modes, but as the processor is not running the watchdog times out and keeps resetting the processor.

  • To handle the watchdog in standby mode

did you try to use IWDG_STDBY option byte.
It should make you able to freeze the watchdog in the specific low power mode.

Gyessine_0-1771402877730.png

You can modify it using STM32CubeProgrammer.

Gyessine_1-1771402950568.png

  • To handle the watchdog in shutdown mode

In shutdown mode, The PLL, the HSI16, the MSI, the LSI and the HSE oscillators are also switched off. Only LSE remains active, so you need to clock it from LSE. So, if you don't want IWDG to run in Shutdown, ensure you don’t start it before entering Shutdown.

BR
Gyessine



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.

Thanks Gyessine

I am aware of the IWDG_STDBY option byte but have not looked it, because it only solves the problem in standby, it does not solve the problem when in shutdown.  So a fix for standby is of no use if there is no fix for shutdown.

I am only using the LSE as the clock source to run the STM32.

I was told that there is no way to stop the watchdog once it has been enabled, so how would I prevent it from starting before entering shutdown ?

 

 

TDK
Super User

In shutdown mode, the LSI clock is stopped, so IWDG will also be stopped. I suspect it won't let you enter shutdown mode with IWDG enabled but haven't tried.

If you feel a post has answered your question, please click "Accept as Solution".