We tried to trigger a watchdog hard reset for test purpose, but nothing happened after we opened /dev/watchdog0
by command:
echo 1 | sudo tee /dev/watchdog0
and by c code using ioctl:
include <stdio.h>
include <fcntl.h> // for watchdog timer
include <unistd.h> // needed only if close() is used to close watchdog timer
include <sys/ioctl.h> // for watchdog timer
include <linux/watchdog.h> // for watchdog timerint main() {
int fd, ret;
int timeout = 0;/* open WDT0 device (WDT0 enables itself automatically) */
fd = open(“/dev/watchdog0”, O_RDWR);
if (fd<0) {
fprintf(stderr, “Open watchdog device failed!\n”);
return -1;
}/* WDT0 is counting now,check the default timeout value */
ret = ioctl(fd, WDIOC_GETTIMEOUT, &timeout);
if(ret) {
fprintf(stderr, “Get watchdog timeout value failed!\n”);
return -1;
}
fprintf(stdout, “Watchdog timeout value: %d\n”, timeout);/* set new timeout value 60s /
/ Note the value should be within [5, 1000] */
timeout = 20;
ret = ioctl(fd, WDIOC_SETTIMEOUT, &timeout);
if(ret) {
fprintf(stderr, “Set watchdog timeout value failed!\n”);
return -1;
}
fprintf(stdout, “New watchdog timeout value: %d\n”, timeout);/*Kick WDT0, this should be running periodically */
ret = ioctl(fd, WDIOC_KEEPALIVE, NULL);
if(ret) {
fprintf(stderr, “Kick watchdog failed!\n”);
return -1;
}
sleep(1);/* close WDT0 device */
close(fd);
if (ret<0) {
fprintf(stderr, “Failed to close watchdog device.”);
return -1;
}return 0;
}
The c code above successfully set the timeout to a new value(102 to 20):
Jan 31 10:19:23 tegra-ubuntu sudo[3417]: nvidia : TTY=pts/0 ; PWD=/home/nvidia ; USER=root ; COMMAND=./wdt
Jan 31 10:19:23 tegra-ubuntu kernel: tegra_wdt_t18x 2190000.watchdog: Watchdog(0): wdt timeout set to 20 sec
Jan 31 10:19:39 tegra-ubuntu kernel: watchdog: watchdog0: watchdog did not stop!
kernel message suggest the tegra_wdt_t18x start successfully but tegra_hv_wdt is not working:
Jan 29 08:42:46 tegra-ubuntu kernel: tegra_wdt_t18x 2190000.watchdog: shutdown timeout disabled
Jan 29 08:42:46 tegra-ubuntu kernel: tegra_wdt_t18x 2190000.watchdog: Tegra WDT init timeout = 120 sec
Jan 29 08:42:46 tegra-ubuntu kernel: tegra_wdt_t18x 2190000.watchdog: Registered successfully
Jan 29 08:42:48 tegra-ubuntu kernel: tegra_hv_wdt tegra_hv_wdt: failed to find ivc property
Jan 29 08:42:48 tegra-ubuntu kernel: tegra_hv_wdt tegra_hv_wdt: failed to parse device tree
However, after waiting for the timeout, nothing happened, system reset was not triggered.
Is there another process/service/drive kicking the watchdog at the same time? Or maybe other VMs are also kicking the same watchdog?
Is there another way to trigger the hard reset?
Please provide the following info (tick the boxes after creating this topic):
Software Version
DRIVE OS 6.0.6
DRIVE OS 6.0.5
DRIVE OS 6.0.4 (rev. 1)
DRIVE OS 6.0.4 SDK
other
Target Operating System
Linux
QNX
other
Hardware Platform
DRIVE AGX Orin Developer Kit (940-63710-0010-D00)
DRIVE AGX Orin Developer Kit (940-63710-0010-C00)
DRIVE AGX Orin Developer Kit (not sure its number)
other
SDK Manager Version
1.9.2.10884
other
Host Machine Version
native Ubuntu Linux 20.04 Host installed with SDK Manager
native Ubuntu Linux 20.04 Host installed with DRIVE OS Docker Containers
native Ubuntu Linux 18.04 Host installed with DRIVE OS Docker Containers
other