Advantech UBC-220 User Manual page 48

Risc iot box computer powered by freescale i.mx6 dual lite processor arm cortex a9 architecture
Table of Contents

Advertisement

if (sleep_sec <= 0) {
sleep_sec = 1;
printf("correct 0 or negative sleep time to %d seconds\n",
sleep_sec);
}
test = atoi(argv[3]);
printf("Starting wdt_driver (timeout: %d, sleep: %d, test:
timeout, sleep_sec, (test == 0) ? "ioctl" : "write");
fd = open("/dev/watchdog", O_WRONLY);
if (fd == -1) {
perror("watchdog");
exit(1);
}
printf("Trying to set timeout value=%d seconds\n", timeout);
ioctl(fd, WDIOC_SETTIMEOUT, &timeout);
printf("The actual timeout was set to %d seconds\n",
ioctl(fd, WDIOC_GETTIMEOUT, &timeout);
printf("Now reading back -- The timeout is %d seconds\n",
while (1) {
printf("WDT Time out counter:%d\n",count);
if ((test !=0) && (test ==count)) {
printf("Ping Watchdog (reset wdt)\n");
ioctl(fd, WDIOC_KEEPALIVE, 0);
test=0;
count=0;
}
sleep(sleep_sec);
count+=sleep_sec;
}
return 0;
}
void help_info(void)
{
printf("Usage: wdt_driver_test <timeout> <sleep>
printf("
printf("
printf("
}
If you would like to change the WDT time, please modify:
ioctl(fd, WDIOC_SETTIMEOUT, &timeout).
UBC-220 User Manual
%s)\n",
timeout);
timeout);
<trigger>\n");
timeout: value in seconds to cause wdt timeout/
reset\n");
sleep: value in seconds to display wdt
timeout\n");
trigger: value in seconds to ping the wdt\n");
40

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ubc-220dl-mda1e

Table of Contents