Synthetic target watchdog device, Name, Overview – Comtrol eCos User Manual
Page 811: Installation

Synthetic Target Watchdog Device
Name
Synthetic Target Watchdog Device
— Emulate watchdog hardware in the synthetic target
Overview
Some target hardware comes equipped with a watchdog timer. Application code can start this timer and after a
certain period of time, typically a second, the watchdog will trigger. Usually this causes the hardware to reboot.
The application can prevent this by regularly resetting the watchdog. An automatic reboot can be very useful when
deploying hardware in the field: a hardware glitch could cause the unit to hang; or the software could receive an
unexpected sequence of inputs, never seen in the laboratory, causing the system to lock up. Often the hardware is
still functional, and a reboot sorts out the problem with only a brief interruption in service.
The synthetic target watchdog package emulates watchdog hardware. During system initialization watchdog device
will be instantiated, and the
watchdog.tcl
script will be loaded by the I/O auxiliary. When the eCos application
starts the watchdog device, the
watchdog.tcl
script will start checking the state of the eCos application at one
second intervals. A watchdog reset call simply involves a message to the I/O auxiliary. If the
watchdog.tcl
script
detects that a second has
without a reset then it will send a
SIGPWR
signal to the eCos application, causing
the latter to terminate. If gdb is being used to run the application, the user will get a chance to investigate what is
happening. This behaviour is different from real hardware in that there is no automatic reboot, but the synthetic
target is used only for development purposes, not deployment in the field: if a reboot is desired then this can be
achieved very easily by using gdb commands to run another instance of the application.
Installation
Before a synthetic target eCos application can use a watchdog device it is necessary to build and install host-side
support. The relevant code resides in the
host
subdirectory of the synthetic target watchdog package, and building
it involves the standard configure, make and make install steps. The implementation of the watchdog support
does not require any executables, just a Tcl script
watchdog.tcl
and some support files, so the make step is a
no-op.
There are two main ways of building the host-side software. It is possible to build both the generic host-side
software and all package-specific host-side software, including the watchdog support, in a single build tree. This
involves using the configure script at the toplevel of the eCos repository. For more information on this, see the
README.host
file at the top of the repository. Note that if you have an existing build tree which does not include
the synthetic target watchdog support then it will be necessary to rerun the toplevel configure script: the search for
appropriate packages happens at configure time.
The alternative is to build just the host-side for this package. This requires a separate build directory, building
directly in the source tree is disallowed. The configure options are much the same as for a build from the toplevel,
and the
README.host
file can be consulted for more details. It is essential that the watchdog support be configured
with the same
--prefix
option as other eCos host-side software, especially the I/O auxiliary provided by the
architectural synthetic target HAL package, otherwise the I/O auxiliary will be unable to locate the watchdog
support.
707