I wrote a simple program to start the watchdog in user space, following this post.
I’d like to stop the watchdog when the application ends. According to this link, I need to write V to the watchdog file before closing it.
For some reason, when I try to do it, the watchdog does not stop and the board reboots. Based on the code available on the link above, the Jetson Xavier NX supports the magic close char.
Try below command
Tegra WDT
Disable
echo 1 > /sys/kernel/debug/tegra_wdt/disable_wdt_reset
Enable
echo 0 > /sys/kernel/debug/tegra_wdt/disable_wdt_reset
PMIC
Normal state –
Disable
echo disable > /sys/devices/platform/7000d000.i2c/i2c-4/4-003c/max77620-wdt.5/watchdog_normal_state
Enable
echo enable > /sys/devices/platform/7000d000.i2c/i2c-4/4-003c/max77620-wdt.5/watchdog_normal_state
LP0 –
Disable
echo disable > /sys/devices/platform/7000d000.i2c/i2c-4/4-003c/max77620-wdt.5/watchdog_suspend_state
Enable
echo enable > /sys/devices/platform/7000d000.i2c/i2c-4/4-003c/max77620-wdt.5/watchdog_suspend_state
These folders /sys/kernel/debug/tegra_wdt/ and /sys/devices/platform/7000d000.i2c/ do not seem to be there.
Check this for Xavier NX
echo 1 > /sys/kernel/debug/30c0000.watchdog/disable_dbg_reset
echo 1 > /sys/kernel/debug/30c0000.watchdog/disable_por_reset
I am trying the NX watchdog function. I cannot access the debug directory. Anyone can tall me why and how to fix it?
/sys/kernel$ sudo echo 1 >/sys/kernel/debug/30c0000.watchdog/disable_dbg_reset
-bash: /sys/kernel/debug/30c0000.watchdog/disable_dbg_reset: Permission denied
Thanks.
The debug sysfs looks like not working for current release.
Have below step to disable it.
Disable the CONFIG_WATCHDOG_NOWAYOUT in …/kernel/kernel-4.9/arch/arm64/configs/tegra_defconfig to build the kernel Image and replace it.
Then reference to below code to implement WDIOC_SETOPTIONS to disable it.
https://code.woboq.org/linux/linux/tools/testing/selftests/watchdog/watchdog-test.c.html