Radarcape:Watchdog

From Beast Wiki
Revision as of 03:59, 7 July 2016 by imported>Dl4mea
Jump to navigation Jump to search
For Experts The tasks described in this manual require advanced knowledge of Unix/Linux.

Hardware Watchdog Overview

Starting with the 2nd production Batch, the Radarcape is equipped with a MAX6371 hardware watchdog. The watchdogs shall reboot the Radarcape in the case that the software hangs. This is especially important if the Radarcape is operated at remote locations or without a human operator available for a manual reboot.

The watchdog listens on GIPO_60 of the BeagleBone board for a toggling signal. If GIPO_60 has not been toggled within 1 minute, the BeagleBone board is being reset via the SYS_RESET pin. GIPO_60 must be toggled by software at least once every minute otherwise the Radarcape reboots. Toggling of GIPO_60 is usually being done by the Radarcape softawre (rcd). The very first timeout after power-on is 2 minutes, which leaves plenty of time for even reflashing the whole eMMC card.

Manual Hardware Watchdog Toggling

In certain situations it becomes necessary to temporarily stop or even de-install the Radarcape daemon. It then is necessary to toggle GIPO_60 by other ways to hinder the hardware watchdog from rebooting the Radarcape. This can be achived using the following script:

#!/bin/bash

echo *** Configure Watchdog retrigger pin & toggle first time

# Setup GIPO multiplexer (old firmware releases only)
if [ -e "/sys/kernel/debug/omap_mux/gpmc_ben1" ]
then
  echo 07 > /sys/kernel/debug/omap_mux/gpmc_ben1
fi

# Export GIPO_60 to /sys filesystem
echo 60 > /sys/class/gpio/export

# Set GIPO_60 direction to output 
echo out > /sys/class/gpio/gpio60/direction

# Toggle the pin until the user presses CTRL+C
echo 'Hit CTRL+C to exit'
while 1;
do
  echo 1 > /sys/class/gpio/gpio60/value
  sleep 15
  echo 0 > /sys/class/gpio/gpio60/value
  sleep 15
done

The toggling loop can also be typed as one-liner:

while :; do echo 1 > /sys/class/gpio/gpio60/value; sleep 15; echo 0 > /sys/class/gpio/gpio60/value; echo 'Hit CTRL+C to exit'; sleep 15; done


FAQ

F: The file /sys/kernel/debug/omap_mux/gpmc_ben1 does not exist on my Radarcape?
A: This file exists only on old Radarcape firmware. If it does not exist, ignore it and continue with the next command.

F: The message write error: Device or resource busy appears when I execute echo 60 > /sys/class/gpio/export. What shall I do?
A: In this case GIPO_60 has already be exported to the /sys file system. You can unexport it by typing echo 60 > /sys/class/gpio/unexport?