Skip to main content
Visitor II
October 30, 2020
Question

/dev/watchdog is always busy.

  • October 30, 2020
  • 3 replies
  • 2391 views

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

    This topic has been closed for replies.

    3 replies

    Technical Moderator
    November 5, 2020

    Hi @ASuar.1​ 

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

    Olivier

    ASuar.1Author
    Visitor II
    November 5, 2020

    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.

    ST Employee
    November 5, 2020

    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