Copyright 2017. All rights reserved. Advantech Co. Ltd.
Page 33
3.5.2
Watchdog on SuperIO
HWM watchdog could be accessed by Linux io port 0x2E/0x2F. Advantech provides sample
code to demonstrate watchdog function on SuperIO. This sample code is written in C
language, wdt5523.c and wdt5523.h.
Please note that ungraceful shutdown might damage your file system, do not do it in a
service online system.
Executing following command to acquire utility usage:
#
5523wdt -h
Test Watch dog function for NAMB-5523.
5523wdt [time_count [time_type]]
[time_count] Timeout value, 1 =< time_count <=255.
[time_type] Timeout type, 's' : second; 'm' : minute.
usage:
5523wdt -h ;Help.
5523wdt ;DEFAULT Setting : 8 seconds timeout.
5523wdt 10 s ;Setting : 10 seconds timeout.
5523wdt 5 m ;Setting : 5 minutes timeout.
Enter following command and the system will reboot after 10 seconds:
#
5523wdt 10 s
3.6
Software Defined Button
A software defined button (F6 in Figure 4) is provided on the FWA-T011-4CA1S. BIOS is
programmed well to monitor button event trigger. The
acpid
service (ACPI event daemon) is
used to handle the corresponding action of this button event. When user press software
controlled button, the button event will be triggered and the corresponding action will be
executed.
In our example, the event/action relation to interpret this button event is defined in
/etc/acpi/events/usrdefbtn
:
(We have config in our QuickStart Image, user can use it with ease)
event=button[/]sleep
action=/etc/acpi/usrdefbtn.sh
User can specify any desired action in /etc/acpi/usrdefbtn.sh, such as reboot the system or
trigger another application. In our example, a new file in the /tmp directory will be created
as the button is pressed:
(We have add usrdefbtn.sh in our QuickStart Image, user can use it with ease)
#!/bin/sh
# Demo for user define button