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 MP25 has:

  • Three watchdogs available on the STM32MP system-on-chip

Features

The features of the STM32MP25 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 options STM Independent Watchdog (CONFIG_STM32_WATCHDOG) and ARM Secure Monitor Call based watchdog support (CONFIG_ARM_SMC_WATCHDOG)

These options are enabled as built-in on the ConnectCore MP25 Development Kit kernel configuration file.

Kernel driver

The watchdog drivers for the STM32MP are located at drivers/watchdog/stm32_iwdg.c and Documentation/devicetree/bindings/watchdog/arm-smc-wdt.yaml.

Device tree bindings and customization

The STM32MP watchdog timers are defined in the common STM32MP device tree file:

Common STM32MP25 device tree
iwdg2: watchdog@5a002000 {
	compatible = "st,stm32mp1-iwdg";
	reg = <0x5a002000 0x400>;
	clocks = <&rcc IWDG2>, <&scmi_clk CK_SCMI_LSI>;
	clock-names = "pclk", "lsi";
	status = "disabled";
};
...

arm_wdt: watchdog {
	compatible = "arm,smc-wdt";
	arm,smc-id = <0xb200005a>;
	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 MP25.

Go to GitHub to see the application instructions and source code.

See Watchdog API for more information about the watchdog APIx.