Adding External Watchdog

Forums Devices OSD335x-SM Adding External Watchdog

Viewing 1 reply thread
  • Author
    Posts
    • #10078
      April Tescheapriltesche
      Participant

      We have configured an external watchdog circuit on our board. Using the watchdog after linux has finished booting is trivial; we just enable the watchdog and then toggle a gpio every 30 seconds. Our question is whether we can use the watchdog to monitor the boot process as well.

      In other words, if the watchdog is enabled immediately on power-up, is it possible to configure the boot process to pet the watchdog until booting is complete, then have our application take over the watchdog after that.

      Based on (very limited) information we were able to find on the internet, we think it should be possible as follows. We modified our dts file (see attached) to include the following:

      watchdog: watchdog {
      compatible=”linux,wdt-gpio”;
      gpios=<&gpio3 17 GPIO_ACTIVE_LOW>;
      hw_algo=”toggle”;
      hw_margin_ms=<1600>;
      };

      We think that should toggle gpio3[17] every 1.6 seconds until either:
      – something goes wrong with the boot process, leading to the watchdog timer expiring and the board resetting
      – the boot process completes and an application opens /dev/watchdog

      Once an application opens /dev/watchdog, it is responsible for writing to that file whenever it wants to toggle gpio3[17]. If it stops, the watchdog expires and the board is reset.

      However, when we boot the board with the corresponding dtb file we don’t see any activity on the gpio. We are using ‘Debian 9.9 2019-08-03 4GB SD IoT’ from beagelboard.org which has /dev/watchdog, so we think the kernel is properly configured to support watchdogs.

      So, is there something wrong with our configuration, or are we completely misguided in what we are trying to do?

    • #10239
      Erik Welsh
      Keymaster

      We apologize for the delay in responding to this question.  Were you able to get this resolved or is this still an issue?

      To give some background on this, there is a hardware watchdog timer within the AM335x core.  That hardware watchdog timer is what comes up in /dev/watchdog.  You can see a tutorial on how to use it here:  https://www.onlogic.com/company/io-hub/tutorial-using-beaglebone-black-watchdog-timer/

      Now, to get the GPIO watchdog timer working within Linux, there are two things:  First, you need to make sure that the gpio_wdt module is enabled and is part of the kernel.  We would suggest, that you take a look at https://www.digikey.com/eewiki/display/linuxonarm/BeagleBone+Black and follow the instructions on building the kernel to see what modules are enabled.  If you search for “WATCHDOG” in the kernel config, you should be able to see what is enabled.

      Additionally, there could be a pinmuxing issue in that the pin is not configured as a GPIO.  Please take a look at your device tree and see if pin gpio3 17 is used/configured anywhere else.

      Please let us know if you have any additional questions.

       

       

       

       

Viewing 1 reply thread
  • You must be logged in to reply to this topic.