Unable to stop watchdog

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
          echo 1 > /sys/kernel/debug/tegra_wdt/disable_wdt_reset
          echo 0 > /sys/kernel/debug/tegra_wdt/disable_wdt_reset
    Normal state –
           echo disable > /sys/devices/platform/7000d000.i2c/i2c-4/4-003c/max77620-wdt.5/watchdog_normal_state
           echo enable > /sys/devices/platform/7000d000.i2c/i2c-4/4-003c/max77620-wdt.5/watchdog_normal_state
     LP0 –
             echo disable > /sys/devices/platform/7000d000.i2c/i2c-4/4-003c/max77620-wdt.5/watchdog_suspend_state
             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


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.