Wdt (Watch Dog Timer) - Korenix JetBox 8100 User Manual

Embedded linux
Hide thumbs Also See for JetBox 8100:
Table of Contents

Advertisement

5.5 WDT (Watch Dog Timer)

A Watchdog Timer (WDT) is a hardware circuit that can reset the computer
system in case of a software fault. You probably knew that already.
The Watchdog Driver has one basic role: to talk to the card and send
signals to it so it doesn't reset your computer, at least during normal
operation.
The ioctl API:
1. Pinging the watchdog using an ioctl:
WDIOC_KEEPALIVE:,
This ioctl does exactly the same thing as a write to the watchdog device, so
the main loop in the above program could be replaced with:
while (1) {
}
the argument to the ioctl is ignored.
2. Setting and getting the timeout:
To modify the watchdog timeout on the fly with the SETTIMEOUT ioctl,
driver has the WDIOF_SETTIMEOUT flag set in their option field. The
argument is an integer representing the timeout in seconds. The driver
returns the real timeout used in the same variable, and this timeout might
differ from the requested one due to limitation of the hardware.
int timeout = 45;
ioctl(fd, WDIOC_SETTIMEOUT, &timeout);
printf("The timeout was set to %d seconds\n", timeout);
Starting with the Linux 2.4.18 kernel, it is possible to query the
current timeout using the GETTIMEOUT ioctl.
34
ioctl(fd, WDIOC_KEEPALIVE, 0);
sleep(10);
JetBox 8100 User Manaual_Linux_1.1

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Jetbox 8100-lJetbox 8100-lm

Table of Contents