1. Introduction to Watchdog:
The watchdog of the X1 development board is implemented by the SuperIO chip. After the operating system starts, the watchdog is turned off by default. Software is required to turn on the watchdog and timed dog feeding. Once the watchdog is turned on, the watchdog counter starts to automatically count. It is necessary to complete the dog feeding command before the watchdog counting time overflows, otherwise it will cause the watchdog to interrupt and cause the system to reset.
Watchdog application: After starting the watchdog, if the operating system crashes and the dog feeding program fails to feed the dog on time, it will cause the system to reset and restart;
This design benefits the system from being stuck and unusable in the event of a major malfunction, and can quickly reset and restart the system to enter a working state again
It is commonly used in industry to reduce overall system failure time
2. Watchdog control software download:
The following is an example of using Ubuntu 22.04. x desktop amd64 version for operation
2.1 Watchdog operation hardware service program source code:
linux Watchdog program src
Compile and run watchdog operating hardware service programs
Download and decompress before compiling
#Enter the Watchdog Operating Hardware Service Program Directory
jb@X1:~$ cd wdog
#Compilation
jb@X1:~$ make
#Execution
jb@X1:~$ sudo ./wdogsrvd
Note: The wdogsrvd watchdog operation hardware service program needs to be kept running for a long time. The following configuration UI interface also uses the watchdog operation hardware service program to actually control the watchdog.
2.2 Configure the Watchdog UI program source code (compiled with QT5):
Linux Watchdog Control UI Program - QT
For information on how to compile programs with QT5, you can refer to:
http://wiki.youyeetoo.cn/zh/x1/linux/qt-build
Starting from the fourth chapter, refer to: Open the sample project in QT5 and how to compile and run the project.
2.3 After compiling and running with QT5, follow the following steps to run:
#Enter the directory of QT compiled watchdog UI programs
jb@X1:~$ cd wdogui/build-WDogUI-Desktop-Debug
#Execute watchdog UI program
jb@X1:~$ sudo ./WDogUI
The operation interface is shown in the figure:
Configure watchdog control mode
Enable Watchdog: Whether to enable the watchdog
Automatic dog feeding: Whether to feed the dog regularly, be sure to turn it on, otherwise the system will restart after a timeout
Watchdog timeout timing type: Time by seconds, Time by minute
Time value setting: Time Value
Note: When selecting the watchdog timeout timing type to be timed in seconds, be sure to wait for at least 2 seconds