class WDT – watchdog timer¶
The WDT is used to restart the system when the application crashes and ends up into a non recoverable state. Once started it cannot be stopped or reconfigured in any way. After enabling, the application must “feed” the watchdog periodically to prevent it from expiring and resetting the system.
Available on STM32 OpenMV cams (M4 / M7 / H7 / H7 Plus / Pure Thermal / N6) and the OpenMV Cam RT1062. Not exposed on the OpenMV Cam AE3 (alif port).
Example usage:
from machine import WDT
wdt = WDT(timeout=2000) # enable it with a timeout of 2s
wdt.feed()
Constructors¶
- class machine.WDT(id: int = 0, timeout: int = 5000)¶
Create a WDT object and start it.
timeoutis given in milliseconds. Once started the watchdog cannot be stopped; usetimeout_ms()to change the window at runtime.Methods¶