what do you mean by software? Watchdog is nothing else. It’s a software agent. If your entire system crashes, and you are not able to login via SSH anymore, I doubt Watchdog will do anything.
Should be a software that “send” a message to the hardware.
If the hardware, which is not OS related, doesn’t hear that signal, will understand that the system is stuck and then should reboot the system.
If this work, should be a killer feature for any owner of Raspberry Pi.
Imagine those that use the device in places not easy to reach or, in our case, as server of a distant location, hardware is still power-on, Internet (the router) is still working but the OS crashes.
ok I was not aware that the RPi4 has such a hardware watchdog build in within the SOC
Basically your described way should be correct
To check the watchdog, you can use
wdctl
And to force a kernel crash
sudo sh -c "echo c > /proc/sysrq-trigger"
The question is whether this will ‘fix’ your problem, as we don’t know why the system is crashing, and you don’t know what the status will be afterwards. Perhaps only some services have been shut down, rather than the entire system? That would mean it might still be functioning to some extent.