2 years, 6 months ago.

Watchdog and Low Power Modes?

Hi all,

On the STM32 processors, it's possible to activate a watchdog by setting a few prescaler values and writing out a 'start' command. My understanding from the reference manuals is that once you start this watchdog (and keep 'kicking' it) there is no way to subsequently stop it other than by continuously kicking it. It only 'stops' once the watchdog timer expires and a the system is reset.

The question then is this. The watchdog kicking typically happens over short timescales in code. If you want to put a processor into a low power mode for a duration longer than the typical 'kicking' spacing, this becomes problematic. It means your processor resets whilst it is in that low power mode.

So I'm wondering if anyone might recommend a strategy? Is it a case that I have to keep waking up, kicking, then go back to sleep? Could I use a lowpowertimeout to function as a watchdog (but this seems do defeat the purpose of having an independent watchdog since if code crashes I'm not sure the handling of that lowpowertimeout would work)? Another method might be to use the SD card we have ... we could write a file telling the system how long to sleep for, wait for the system reset when the watchdog expires, read the file back, and enter into a power down mode before restarting the watchdog again?

Any ideas would be appreciated!

1 Answer

2 years, 6 months ago.

Hi James, Watchdog is not supported by mbed-os mainline. How are you using it? and with which particular part?

The behavior of the WD in a low power mode is dependent on the capabilities and configuration of the particular hardware you are using. You may have to explore the datasheet of your device for this.

Thanks, Naveen

Accepted Answer