cancel
Showing results for 
Search instead for 
Did you mean: 

IWDG waking up STM32 from sleep mode

milanvujovic
Associate II
Posted on October 27, 2015 at 13:33

I have implemented IWDG and when entering sleep mode IWDG wakes up STM and resets the device. 

Can i disable IWDG and how?

5 REPLIES 5
AvaTar
Lead
Posted on October 27, 2015 at 14:03

By not enabling IWDG ?

Watchdog units are purposely designed to be unstoppable once started. Otherwise, erratic code - the problem watchdogs are supposed to catch - could stop them, too.

Or, if you need either WDG or sleep mode (but not both at the same time), set a marker in RAM or some unaffected register, let the IWDG reset happen, and skip the watchdog setup during initialization, before going into sleep mode.

milanvujovic
Associate II
Posted on October 27, 2015 at 14:16

I enable watchdog at start, but when i enter sleep mode IWDG wake up the STM32 and i can't use it in sleep mode. 

I wonder if there is possibility to turn off IWDG before sleep.

So you telling that there is no way to use IWDG and sleep at the same time?

I'm thinking of replacing IWDG with virtual WDG with systick. What is your opinion about that?

AvaTar
Lead
Posted on October 27, 2015 at 16:20

I wonder if there is possibility to turn off IWDG before sleep.

 

Unfortunately, the reference manual doesn't say it explicitely, but if you check the respective chapter, there is no mention of ''disabling''. For the reasons mentioned, stopping a running watchdog is not ''designed in''.

So you telling that there is no way to use IWDG and sleep at the same time?

 

Thinking about it, wanting sleep mode AND a watchdog running are somehow contradicting requirements.

If you need both (in an alternating fashion), you will need to let the IWDG reset happen one time, to be able to reconfigure your application without IWDG, and then go to sleep again.

After waking up from sleep, you can choose to (re-)enable the IWDG at any time - with the afore-mentioned consequences.

milanvujovic
Associate II
Posted on October 27, 2015 at 19:01

I know that implementation of sleep and IWDG is contradicting, but my application request both of them. 

Thank you very much for your help and time.

Max
ST Employee
Posted on August 29, 2017 at 08:06

Depending on the STM32 you are using you may have options to disable the watchdogs in STOP and STANDBY mode from the option bytes configuration.

There is no such option for SLEEP mode.

Can you use STOP mode instead of SLEEP?

If you must use sleep, you will need to wake-up regularly to kick the dog...