Radarcape:Watchdog

From Beast Wiki
Revision as of 18:06, 6 July 2016 by imported>Beastadmin
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 hardware watchdog shall ensure that the Radarcape recovers if the system software hangs. This is especially important if the Radarcape is operated at remote locations.

The watchdog listens on GIPO_60 of the BeagleBone board for a toggling signal. If no toggling of the port happend, the BeagleBone board is being reset via the SYS_RESET pin. Therefore, 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 daemon (rcd).

Manual Hardware Watchdog Toggling

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

#!/bin/bash

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

# Setup GIPO multiplexer
echo 07 > /sys/kernel/debug/omap_mux/gpmc_ben1

# 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 10
  echo 0 > /sys/class/gpio/gpio60/value
  sleep 20
done

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

while :; do echo 1 > /sys/class/gpio/gpio60/value; sleep 10; echo 0 > /sys/class/gpio/gpio60/value; echo 'Hit CTRL+C to exit'; sleep 20; 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?