cancel
Showing results for 
Search instead for 
Did you mean: 

/dev/watchdog is always busy.

ASuar.1
Associate III

I am using the STM32MP15-DK2 dev board and with a modified device tree to enable some peripherals. I would like to use /dev/watchdog to reset if ever my application hangs. But whenever I try to open the device I get

Error opening watchdog device: Device or resource busy

I have the watchdog functions commented out in /etc/systemd/system.conf

#RuntimeWatchdogSec=0
#RebootWatchdogSec=10min
#ShutdownWatchdogSec=10min
#KExecWatchdogSec=0
#WatchdogDevice=

and all the info i get from fuser is

root@stm32mp1:/etc/systemd# fuser /dev/watchdog
1

I can't figure out what is causing the error. Does has anyone dealt with this problem before?

Thanks

3 REPLIES 3
Olivier GALLIEN
ST Employee

Hi @ASuar.1​ 

Sounds like a known issue in version V1.2 .. do you confirm it's the one you are actually using ?

Olivier

Olivier GALLIEN
In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
ASuar.1
Associate III

I believe so. In the end I just decided to use systemd to monitor my application.

I created the following service:

[Unit]
Description=application
After=multi-user.target
StartLimitIntervalSec=5min
StartLimitBurst=4
StartLimitAction=reboot-force
 
[Service]
Type=notify
ExecStart=/opt/my_app
Restart=on-failure
WatchdogSec=30s
 
[Install]
WantedBy=multi-user.target

and call sd_notify(0, "WATCHDOG=1") from my application. It works well enough and even reboots my the processor if to many failures occur.

JeanPhilippeR
ST Employee

Hi @ASuar.1​ 

please note that from OpenSTLinux v2.0.0 Dunfell, the watchdog config for systemd is in /lib/systemd/system.conf.d/01-watchdog.conf

BR

Jean-Philippe