Advantech ROM-5420 User Manual page 40

Risc-based smarc module with freescale i.mx6 arm cortex a9 processor
Table of Contents

Advertisement

if (sleep_sec <= 0) {
}
test = atoi(argv[3]);
printf("Starting wdt_driver (timeout: %d, sleep: %d, test: %s)\n",
fd = open("/dev/watchdog", O_WRONLY);
if (fd == -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", timeout);
ioctl(fd, WDIOC_GETTIMEOUT, &timeout);
printf("Now reading back -- The timeout is %d seconds\n", timeout);
while (1) {
}
return 0;
}
void help_info(void)
{
printf("Usage: wdt_driver_test <timeout> <sleep> <trigger>\n");
printf("
printf("
printf("
}
If you would like to change the WDT time, please modify:
ioctl(fd, WDIOC_SETTIMEOUT, &timeout).
ROM-5420 User Manual
sleep_sec = 1;
printf("correct 0 or negative sleep time to %d seconds\n",
sleep_sec);
timeout, sleep_sec, (test == 0) ? "ioctl" : "write");
perror("watchdog");
exit(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;
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");
32

Advertisement

Table of Contents
loading

This manual is also suitable for:

Rom-5420cd-mda1e

Table of Contents