Difference between revisions of "Watchdog"

From ArmadeusWiki
Jump to: navigation, search
m (Configuration)
m (Usage)
Line 21: Line 21:
  
 
== Usage ==
 
== Usage ==
Load the module (here with a 5 secs timeout):
+
* Load the module (here with a 5 secs timeout):
 
<pre class="apf">
 
<pre class="apf">
 
  # modprobe imx2-wdt timeout=5
 
  # modprobe imx2-wdt timeout=5
 
</pre>
 
</pre>
  
{{Note|On APF51 the watchdog driver is compiled within the kernel and do not need to be loaded at runtime.}}
+
{{Note|On [[APF51]] the watchdog driver is compiled within the kernel and do not need to be loaded at runtime.}}
 
You can now access the watchdog through ''/dev/watchdog'' device file:
 
You can now access the watchdog through ''/dev/watchdog'' device file:
 
* to activate it, just open the file, then you will have to write to this file regularly or your system will be reseted.
 
* to activate it, just open the file, then you will have to write to this file regularly or your system will be reseted.
{{Note|On APF27 and apf51 the watchdog is then unstoppable and will reset your board if you don't service it}}
+
{{Note|On [[APF27]] and [[APF51]] the watchdog is then unstoppable and will reset your board if you don't service it}}
  
* there is a small daemon useful to periodically trig the watchdog and reset or reboot the apf board on timeout (here reset after 3 seconds and reboot after 5s):
+
* there is a small daemon useful to periodically trig the watchdog and reset or reboot the apf board on timeout (here reset watchdog every 3 seconds and ask to reboot after 5s if not serviced):
 
<pre class="apf">
 
<pre class="apf">
 
  # watchdog -T 5 -t 3 /dev/watchdog
 
  # watchdog -T 5 -t 3 /dev/watchdog
 
</pre>
 
</pre>
if your system hangs, the daemon can't trig the watchdog and your system is reseted. To quickly check that you can do a:
+
If your system hangs, the daemon can't trig the watchdog and your system is reseted. To quickly check that you can do a:
 
<pre class="apf">
 
<pre class="apf">
 
  # killall watchdog
 
  # killall watchdog

Revision as of 22:12, 5 July 2011

On this page, you will find usefull informations to configure and use the Watchdog of your APF boards.

Configuration

First be sure to have the Watchdog Linux driver is activated:

 $ make linux26-menuconfig
[*] Watchdog Timer Support  --->
    <M>   IMX2+  Watchdog
 $ make

Installation

If you choose to include driver in Linux kernel then reflash your kernel image.
Else either copy the generated module through NFS to your board or reflash your rootfs.

Usage

  • Load the module (here with a 5 secs timeout):
 # modprobe imx2-wdt timeout=5
Note Note: On APF51 the watchdog driver is compiled within the kernel and do not need to be loaded at runtime.

You can now access the watchdog through /dev/watchdog device file:

  • to activate it, just open the file, then you will have to write to this file regularly or your system will be reseted.
Note Note: On APF27 and APF51 the watchdog is then unstoppable and will reset your board if you don't service it


  • there is a small daemon useful to periodically trig the watchdog and reset or reboot the apf board on timeout (here reset watchdog every 3 seconds and ask to reboot after 5s if not serviced):
 # watchdog -T 5 -t 3 /dev/watchdog

If your system hangs, the daemon can't trig the watchdog and your system is reseted. To quickly check that you can do a:

 # killall watchdog

Links