watchdog In short, watchdog is a mechanism to ensure the normal operation of the system or to exit from a dead loop, deadlock, etc.
Watchdogs are divided into hardware watchdogs and software watchdogs. The hardware watchdog uses a timer circuit, the timing output is connected to the reset end of the circuit, and the program clears the timer within a certain time range (commonly known as "feeding the dog"), so when the program is working normally, the timer can never overflow, so it cannot generate a reset signal. If the program fails and the watchdog is not reset within the timer period, the watchdog timer overflows to generate a reset signal and restart the system. The principle of the software watchdog is the same, but the timer on the hardware circuit is replaced with the processor's internal timer, which can simplify the hardware circuit design, but it is not as reliable as the hardware timer, such as the failure of the system's internal timer itself cannot be detected.
There are two types of software watchdogs, normal soft dogs for detecting soft lockups (based on clock interrupts), and NMI dogs for detecting hard lockups (based on NMI interrupts).
Note 1: The clock interrupt priority is less than the NMI interrupt Note 2: Lockup refers to a certain section of kernel code occupying the CPU. Lockup can cause the entire system to become unresponsive. Soft lockup and hard lockup, the only difference between them is that hard lockup occurs when the CPU shield is interrupted. ———————————————— Copyright Notice: This article is an original article by CSDN blogger "Hober_yao", in accordance with the CC 4.0 BY-SA copyright agreement, please attach the original source link and this statement for reprinting. Original link:https://blog.csdn.net/yhb1047818384/article/details/70833825 |