Radarcape:Watchdog: Difference between revisions

From Beast Wiki
Jump to navigation Jump to search
imported>Beastadmin
No edit summary
imported>Beastadmin
No edit summary
 
(2 intermediate revisions by one other user not shown)
Line 8: Line 8:
=Hardware Watchdog Overview=
=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.
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 AM3335 internal watchdog is not sufficient for such cases as it can only become activated after Linux has booted, so early faults would not be covered then.
 
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 daemon (rcd).
 
'''Caution:'''<br>
GIPO_60 must be toggled by software at least once every minute otherwise the Radarcape reboots! This can be problematic if you operate the Radarcape at a remote location without direct hardware access.


The watchdog listens on GPIO_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. GPIO_60 must be toggled by software at least once every minute otherwise the Radarcape reboots. Toggling of GPIO_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==
==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 from rebooting the Radarcape. This can be achived using the following script:
In certain situations it becomes necessary to temporarily stop or even de-install the Radarcape daemon. It then is necessary to toggle GPIO_60 by other ways to hinder the hardware watchdog from rebooting the Radarcape. This can be achived using the following script:


<source lang="bash">
<source lang="bash">
Line 25: Line 21:
echo *** Configure Watchdog retrigger pin & toggle first time
echo *** Configure Watchdog retrigger pin & toggle first time


# Setup GIPO multiplexer (old firmware releases only)
# Setup GPIO multiplexer (old firmware releases only)
if [ -e "/sys/kernel/debug/omap_mux/gpmc_ben1" ]
if [ -e "/sys/kernel/debug/omap_mux/gpmc_ben1" ]
then
then
Line 31: Line 27:
fi
fi


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


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


Line 58: Line 54:


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

Latest revision as of 17:40, 22 July 2016

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 AM3335 internal watchdog is not sufficient for such cases as it can only become activated after Linux has booted, so early faults would not be covered then.

The watchdog listens on GPIO_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. GPIO_60 must be toggled by software at least once every minute otherwise the Radarcape reboots. Toggling of GPIO_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 GPIO_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 GPIO 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 GPIO_60 to /sys filesystem
echo 60 > /sys/class/gpio/export

# Set GPIO_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 GPIO_60 has already be exported to the /sys file system. You can unexport it by typing echo 60 > /sys/class/gpio/unexport?