On all platforms, the default is for the watchdog to continue running during sleep mode.
On the Boron, B Series SoM, Tracker, Argon, and E404X (nRF52840), the
WatchdogCap::SLEEP_RUNNING defaults to on, which is to say the watchdog continues to run while in sleep. It can, however, be explictly cleared so the watchdog will be paused while in sleep mode.
On the P2 and Photon 2 (RTL872x), the watchdog contiues to run in sleep mode. However, you could manually stop it before sleep mode.
For best compatibility across devices, we recommend that you set a watchdog timeout longer than your sleep period, plus an allowance for the time it takes to go to sleep, and wake up from sleep, which could add 30 seconds to a minute. This also provides extra safety in case the device does not wake up at the expected time, as the watchdog will reset the system in this case. This could happen if you have a bug in your logic for how long to sleep, for example.
// Getting capabiltiies WatchdogInfo info; Watchdog.getInfo(info); // Get the capabilities that are always enabled WatchdogCaps mandatoryCaps = info.mandatoryCapabilities(); // Get the capabilities that can be turned off WatchdogCaps optionalCaps = info.capabilities();
The capabilities vary depending on the platform:
||Mandatory||Default||Reset device on watchdog timeout expired|
||Optional||Generate an interrupt on expired|
||Optional||Generate an interrupt on expired without resetting the device|
||Optional||Can be re-configured after started|
||Optional||Can be stopped after started|
||Default||1||Watchdog runs while in sleep mode|
||Optional||Mandatory||Can be paused in debug mode|
|Maximum Timeout||131071 s||8190 s|
1On the RTL872x platform, the watchdog cannot be automatically stopped in sleep mode.