Difference between revisions of "Watchdog"

From ArmadeusWiki
Jump to: navigation, search
(Usage)
(Usage)
 
(18 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{Under_Construction}}
 
 
'''!! This page is under construction and Watchdog driver is still not integrated in current software version !!'''
 
 
 
On this page, you will find usefull informations to configure and use the Watchdog of your APF boards.
 
On this page, you will find usefull informations to configure and use the Watchdog of your APF boards.
 +
For the time being there is no watchdog support on the [[APF9328]]. Help is welcome to integrate the watchdog on this board.
  
 
== Configuration ==
 
== Configuration ==
 
First be sure to have the Watchdog Linux driver activated:
 
First be sure to have the Watchdog Linux driver activated:
 
<pre class="host">
 
<pre class="host">
  $ make linux26-menuconfig
+
  $ make linux-menuconfig
 
</pre>
 
</pre>
  
 
<pre class="config">
 
<pre class="config">
 
[*] Watchdog Timer Support  --->
 
[*] Watchdog Timer Support  --->
     <MIMX Watchdog
+
     <*IMX2+  Watchdog
 
</pre>
 
</pre>
  
Line 21: Line 18:
  
 
== Installation ==
 
== Installation ==
If you choose to include driver in Linux kernel then reflash your kernel image.<br>
+
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.
+
 
 +
Otherwise either copy the generated module through NFS to your board or reflash your rootfs.
  
 
== Usage ==
 
== Usage ==
Load the module (here with a 5 secs timeout):
+
* If driver is statically linked to Linux, you can choose timeout value at boot time with:
 
<pre class="apf">
 
<pre class="apf">
# modprobe watchdog timeout=5
+
BIOS> setenv extrabootargs imx2-wdt.timeout=5
 
</pre>
 
</pre>
  
You can now access the watchdog through ''/dev/watchdog'' device file:
+
* Load the module if the watchdog is compiled as a module:
* 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 [[APF9328]]/[[APF27]]/[[APF28]]/[[APF51]]/[[OPOS6UL]] the watchdog driver is compiled within the kernel and do not need to be loaded at runtime.}}
{{Note|On APF27 watchdog is then unstoppable and will reset your board if you don't service it}}
+
<pre class="apf">
 +
# modprobe imx2-wdt timeout=5
 +
</pre>
  
* there is a small daemon useful to periodically trig the watchdog (here every 3 seconds):
+
You can now access the watchdog through ''/dev/watchdog'' or ''/dev/watchdog0'' device file (depending on your board, ''/dev/watchdog'' might be the 1 minute software Linux watchdog):
 +
* 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}}
 +
* there is a small daemon useful to periodically trig the watchdog and reset or reboot your 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 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
+
  # kill -19 PID    (where PID is the one of watchdog process and -19 == SIGSTOP signal)
 
</pre>
 
</pre>
  
 
== Links ==
 
== Links ==
*
+
* https://www.kernel.org/doc/Documentation/watchdog/watchdog-api.txt
 +
 
 +
[[Category:Watchdog]]

Latest revision as of 13:52, 26 January 2018

On this page, you will find usefull informations to configure and use the Watchdog of your APF boards. For the time being there is no watchdog support on the APF9328. Help is welcome to integrate the watchdog on this board.

Configuration

First be sure to have the Watchdog Linux driver activated:

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

Installation

If you choose to include driver in Linux kernel then reflash your kernel image.

Otherwise either copy the generated module through NFS to your board or reflash your rootfs.

Usage

  • If driver is statically linked to Linux, you can choose timeout value at boot time with:
BIOS> setenv extrabootargs imx2-wdt.timeout=5
  • Load the module if the watchdog is compiled as a module:
Note Note: On APF9328/APF27/APF28/APF51/OPOS6UL the watchdog driver is compiled within the kernel and do not need to be loaded at runtime.
 # modprobe imx2-wdt timeout=5

You can now access the watchdog through /dev/watchdog or /dev/watchdog0 device file (depending on your board, /dev/watchdog might be the 1 minute software Linux watchdog):

  • 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 your 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:

 # kill -19 PID     (where PID is the one of watchdog process and -19 == SIGSTOP signal)

Links