FWA-2112 User Manual
4
5.
For normal usage, ‘interval’ should be shorter than the ‘watchdog-timeout’ so
that the watchdog daemon will feed /dev/watchdog before the hardware reset.
In such case, user can configure file /etc/watchdog.conf as below.
6.
To test the functionality of watchdog hardware, we need to force a hardware
reset by setting ‘interval’ longer than the ‘watchdog-timeout.’ Firstly, copy the file
/etc/watchdog.conf to ~/watchdog_test.conf, then add two lines to the file ~/
watchdog_test.conf.
7.
Enter following command and the system will reboot after 5 seconds. (Please
note that this is not a graceful shutdown and might be detrimental to your file
system.)
1.2.2
Watchdog on HWM
SuperIO watchdog could be accessed by Linux I/O port 0x2E/0x2F. Advantech pro
-
vides sample code to demonstrate watchdog function on SuperIO. This sample code
is written in C language, nct5523.c, nct5523.h. Most important watchdog instructions
are in function nct5523.c.
Linux I/O port for SuperIO is singleton, thus sample code uses semaphore to prevent
access confliction.
User can modify sample code to accomplish specific needs. A normal using example
is shown below and a test to force the hardware reset. Please note that ungraceful
shutdown might damage your file system, do not do it in a service online system.
1.
Install group development tools package for compiling.
2.
Enter the folder wdt_nct5523 and compile by following commands.
3.
Enter following command to acquire utility usage.
watchdog-timeout = 60
interval = 30
cp /etc/watchdog.conf ~/watchdog_test.conf
watchdog-timeout = 10
interval = 30
# sudo watchdog -f -c ~/watchdog_test.conf
# sudo yum groupinstall "Development Tools"
# sudo make
# sudo ./wdt_nct5523 -h
Test Watch dog function for nct5523
Version: v0.04
Usage:
wdt_nct5523 [time_count] [time_type]
[time_count]:
Timeout value, 0 =< time_count <= 255.
If the tiemout value is 0 then stop watchdog timer
[time_type]:
's' : second;