Recently, a group of friends in the chat asked a question about whether the watchdog can work in low power mode:

This sparked discussions among various experts:

All MCUs have a watchdog function, which is used to monitor and resolve system failures caused by software faults, preventing the system from becoming unresponsive due to runaway programs or infinite loops. So, can the watchdog work in low power mode?
I was confused about this issue ten years ago because the MCU at my previous company did not have the watchdog functioning in low power mode, yet a customer explicitly mentioned the need for this feature. During a departmental weekly meeting, when we discussed this issue, an experienced colleague “educated” us, as he believed it was unreasonable to raise such a question.
He explained that when the MCU enters low power mode, the CPU is already in sleep mode, and the program is no longer running, so the concept of ‘runaway program’ does not exist. From this perspective, it is indeed unnecessary for the watchdog to work in low power mode.
The customer who raised this requirement ten years ago explained that they were concerned that the MCU might not wake up in low power mode, hence the need for the watchdog to function. This reasoning seemed even more unreasonable to my senior colleague, who argued that the MCU cannot fail to wake up in low power mode; if it does, it indicates a significant defect in the MCU, making it unusable. He also cited an example where a certain brand’s air conditioning remote control used an MCU with annual usage in the tens of millions, and they had never encountered a situation where the MCU failed to wake up. This argument sounded reasonable, suggesting that there was no need for the watchdog to work in low power mode.
However, why do many MCUs still have this feature? For example, the GD32A503 mentioned by a friend in the group.

After entering low power mode, the watchdog’s role is no longer to prevent “runaway programs”; its purpose becomes to “ensure the system can wake up from low power mode on time” and prevent “sleep death”.
After the system enters low power mode, it typically relies on some wake-up source to resume operation, such as:
-
External IO interrupts: button presses, changes in sensor signals.
-
Other peripheral interrupts: such as receiving data via serial port.
-
Internal timers: RTC or low-power timers.
If the code configuring the wake-up source has a bug, or if the wake-up source itself fails to generate a signal due to hardware issues (such as oscillator failure or sensor malfunction), the system may never wake up, akin to “sleep death”. For battery-powered IoT devices, this means the device becomes “bricked”, and users can only restore it by removing the battery.
Many low-power application scenarios require devices to wake up periodically even without external events, such as collecting data every ten minutes and uploading it. If the scheduled RTC wake-up fails for some reason, the watchdog timeout reset can provide an opportunity for recovery.
Therefore, I believe that having this feature in MCUs is still practically valuable!
MCUs typically use the watchdog normally, and once enabled, it usually cannot be turned off. For MCUs that can operate the watchdog in low power mode, how can we correctly use both the watchdog and low power mode simultaneously?
In this regard, we can categorize them based on whether the MCU supports automatic pause counting of the watchdog in low power mode:
1) Watchdog does not support automatic pause counting in low power mode
For such MCUs, like the GD32A503 mentioned above, since the watchdog continues counting after entering low power mode, it will trigger a reset when the timeout period is reached. This situation is often not what we expect (for example, entering low power mode is triggered by a button press, but the wake-up time is uncertain). However, we must use the watchdog, so we can only periodically wake up the MCU using an additional timer to feed the watchdog. Of course, if the business logic itself requires periodic wake-up (such as scheduled data collection), then we only need to feed the watchdog normally after waking up.
2) Watchdog supports automatic pause counting in low power mode
MCUs of this type are designed more reasonably, such as the STM32L476. If you do not need the watchdog to count in low power mode, you can choose to pause the watchdog counting before entering low power mode (not completely turning off the watchdog), and after waking up, the watchdog counts normally, working only in RUN mode. This approach is much more flexible and avoids unnecessary resets.


For MCUs where the watchdog cannot work in low power mode, as long as the MCU itself wakes up reliably and the relevant wake-up sources are functioning normally, there are actually no issues in practical applications.
Therefore, whether the MCU watchdog can work in low power mode depends on whether the MCU itself supports this feature.
Follow us:
Scan the code to join the embedded development group:
