IMX WDT: Difference between revisions

From Variscite Wiki
(Created page with "<!-- Set release according to "release" parameter in URL and use RELEASE_SUMO_V1.0_VAR-SOM-MX6 as default --> {{#vardefine:RELEASE_PARAM|{{#urlget:release}}}} <!-- --> {{#lst:...")
 
(Add support for Yocto Debian)
 
(8 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<!-- Set release according to "release" parameter in URL and use RELEASE_SUMO_V1.0_VAR-SOM-MX6 as default
<!-- Set release according to "release" parameter in URL and use RELEASE_SUMO_V1.0_VAR-SOM-MX6 as default
--> {{#vardefine:RELEASE_PARAM|{{#urlget:release}}}} <!--
--> {{INIT_RELEASE_PARAM|RELEASE_SUMO_V1.0_VAR-SOM-MX6}}<!--
--> {{#lst:Android_Platform_Customization|{{#var:RELEASE_PARAM|RELEASE_N7.1.1_1.0.0_VAR-SOM-MX6}}}} <!--
--> {{#lst:Android_Platform_Customization|{{#var:RELEASE_PARAM}}}} <!--
--> {{#lst:Yocto_Platform_Customization|{{#var:RELEASE_PARAM|RELEASE_SUMO_V1.0_VAR-SOM-MX6}}}} <!--
--> {{#lst:Yocto_Platform_Customization|{{#var:RELEASE_PARAM}}}} <!--
--> {{PageHeader|{{#var:HARDWARE_NAME}} watchdog}} {{DocImage|category1=Yocto|category2=Android}}[[Category:Debian]][[Category:DART-6UL]][[Category:VAR-SOM-MX7]][[Category:VAR-SOM-MX6]]__toc__
--> {{#lst:B2QT_Platform_Customization|{{#var:RELEASE_PARAM}}}} <!--
--> {{#lst:Debian_Platform_Customization|{{#var:RELEASE_PARAM}}}} <!--
--> {{#ifexpr:{{#rpos:{{#var:SOC}}|mx8q}}<0|
{{#vardefine:WDT_CONFIG|CONFIG_IMX2_WDT}}
{{#vardefine:WDT_DESCR|IMX2+ Watchdog}}
|
{{#vardefine:WDT_CONFIG|CONFIG_IMX_SC_WDT}}
{{#vardefine:WDT_DESCR|IMX SC Watchdog}}
}} <!--
--> {{PageHeader|{{#var:HARDWARE_NAME}} watchdog}} {{DocImage|category1=Yocto|category2=Debian}} [[category:{{#var:HARDWARE_NAME}}]] __toc__


= Kernel configuration=
= Kernel configuration=
The internal watchdog is enabled by default in the kernel configuration.
The internal watchdog is enabled by default in the kernel configuration.


To verify that the i.MX watchdog driver (CONFIG_IMX2_WDT) is enabled in your kernel configuration:
To verify that the i.MX watchdog driver ({{#var:WDT_CONFIG}}) is enabled in your kernel configuration:
* In menuconfig: Device Drivers -> Watchdog Timer Support -> <*> IMX2+ Watchdog<br>
* In menuconfig: Device Drivers -> Watchdog Timer Support -> <*> {{#var:WDT_DESCR}}<br>


= Using a command line =
= Using a command line =
Watchdog will be activated as soon as /dev/watchdog is opened and will reboot unless the watchdog is pinged within timeout (128 is the preconfigured value).
Watchdog will be activated as soon as /dev/watchdog is opened and will reboot unless the watchdog is pinged within timeout (128 is the preconfigured value).


  $ echo "1" > /dev/watchdog0
  # echo "1" > /dev/watchdog0


Within 128 seconds the board will reset.
Within 128 seconds the board will reset.


= Compile watchdog test application =
= Compile a watchdog test application =
There's a watchdog testing utility C code example in the kernel source tree: tools/testing/selftests/watchdog-test.c (in older kernels: Documentation/watchdog/src/watchdog-test.c).
There's a watchdog testing utility C code example in the kernel source tree: tools/testing/selftests/watchdog-test.c (in older kernels: Documentation/watchdog/src/watchdog-test.c).


To cross compile it use the following command:


To cross compile it:<br>
Install the toolchain and source the environment setup script, by following the {{Varlink2|Yocto Toolchain installation|{{#var:RELEASE_LINK}}}} guide, then run:
  $ $CC ./tools/testing/selftests/watchdog-test.c -o ./watchdog-test
  $ $CC ./tools/testing/selftests/watchdog-test.c -o ./watchdog-test

Latest revision as of 13:45, 19 April 2024

Warning: This page is designed to be used with a 'release' URL parameter.

This page is using the default release RELEASE_SUMO_V1.0_VAR-SOM-MX6.
To view this page for a specific Variscite SoM and software release, please follow these steps:

  1. Visit variwiki.com
  2. Select your SoM
  3. Select the software release
VAR-SOM-MX6 watchdog

Kernel configuration

The internal watchdog is enabled by default in the kernel configuration.

To verify that the i.MX watchdog driver (CONFIG_IMX2_WDT) is enabled in your kernel configuration:

  • In menuconfig: Device Drivers -> Watchdog Timer Support -> <*> IMX2+ Watchdog

Using a command line

Watchdog will be activated as soon as /dev/watchdog is opened and will reboot unless the watchdog is pinged within timeout (128 is the preconfigured value).

# echo "1" > /dev/watchdog0

Within 128 seconds the board will reset.

Compile a watchdog test application

There's a watchdog testing utility C code example in the kernel source tree: tools/testing/selftests/watchdog-test.c (in older kernels: Documentation/watchdog/src/watchdog-test.c).


To cross compile it:
Install the toolchain and source the environment setup script, by following the Yocto Toolchain installation guide, then run:

$ $CC ./tools/testing/selftests/watchdog-test.c -o ./watchdog-test