The watchdog timer, set to specific time intervals, handles gross system misbehavior. The watchdog timer can be enabled or disabled depending on the operating condition. Once the watchdog timer is activated, it must be serviced by software on a periodic basis. If servicing does not take place in time, the watchdog times out and issues a system reset.
The ConnectCore MP13 has:
-
Two watchdogs available on the STM32MP system-on-chip
Features
The features of the STM32MP13 watchdog include:
-
Device tree-configurable timeout, in seconds
-
Option to disable the watchdog timer count during low power mode
-
Inability to stop watchdog once started
Kernel configuration
You can manage the STM32MP watchdog driver support through the kernel configuration option STM Independent Watchdog (CONFIG_STM32_WATCHDOG
).
This option is enabled as built-in on the ConnectCore MP13 Development Kit kernel configuration file.
Kernel driver
The watchdog driver for the STM32MP is located at drivers/watchdog/stm32_iwdg.c
.
Device tree bindings and customization
The watchdog device tree binding is documented at Documentation/devicetree/bindings/watchdog/st,stm32-iwdg.yaml
.
The STM32MP watchdog timers are defined in the common STM32MP device tree file:
iwdg2: watchdog@5a002000 {
compatible = "st,stm32mp1-iwdg";
reg = <0x5a002000 0x400>;
clocks = <&rcc IWDG2>, <&scmi_clk CK_SCMI_LSI>;
clock-names = "pclk", "lsi";
status = "disabled";
};
Using the watchdog
The watchdog is accessible via the file descriptor /dev/watchdog0
.
For information about the watchdog API, see the Linux kernel documentation at Documentation/watchdog/watchdog-api.rst
.
Sample application
An example application called apix-watchdog-example
is included in the dey-examples-digiapix recipe (part of dey-examples package) of the meta-digi layer.
This application uses the Digi APIx library to enable a watchdog device on the ConnectCore MP13.
Go to GitHub to see the application instructions and source code.
See Watchdog API for more information about the watchdog APIx.