Disabling Watchdog

Post here first, or if you can't find a relevant section!
Post Reply
geologic
Posts: 10
Joined: Thu Dec 15, 2022 10:12 am
Answers: 1

Disabling Watchdog

Post by geologic »

Hi

I'm using STM32 core on a Nucleo64 board. The board is most of the time sleeping and sometimes it wakes from sleep to grab some sensors data and send it to a server.
I want to implement a watchdog only on the "wake" part of the code, and i tried the IWatchdog library. the problem is when i go to sleep i want to disable watchdog, and IWatchdog library does not seem to allow that.

1) is it possible do disable/enable watchdog on IWatchdog library?
2) do you know other watchdog library who allow that?

Thanks
dannyf
Posts: 446
Joined: Sat Jul 04, 2020 7:46 pm

Re: Disabling Watchdog

Post by dannyf »

by its very nature, a watchdog needs to be fed regularly. So a software-disable-able? watchdog is counter-intuitive.

you can fake a "watchdog" of your own with one of the timer interrupts.
User avatar
fpiSTM
Posts: 1723
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: Disabling Watchdog

Post by fpiSTM »

As stated in the README.md of the library:
https://github.com/stm32duino/Arduino_C ... /README.md
WARNING: Once started the IWDG timer can not be stopped. If you are planning to debug the live system, the watchdog timer may cause the system to be reset while you are stopped in the debugger. Also consider the iwatchdog timer implications if you are designing a system which puts the CPU in sleep mode.
If you do sleep mode, you have to wake up periodically to reload the IWDG, that's all.
geologic
Posts: 10
Joined: Thu Dec 15, 2022 10:12 am
Answers: 1

Re: Disabling Watchdog

Post by geologic »

I'm doing a batery operated project, i'm saving all uA i can... now i have to wake like every 20 seconds just to kick the watchdog ass... Too bad... :(

Thank's guys for your help.
User avatar
fpiSTM
Posts: 1723
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: Disabling Watchdog

Post by fpiSTM »

Then do not use the iwdg.
Post Reply

Return to “General discussion”