The MCA implements a watchdog timer in its firmware. Any internal CPU watchdog timer on the ConnectCore 6UL is disabled by default because the MCA is responsible for the power/reset initialization of the SOM as a whole.
Features
You can configure the following MCA watchdog features:
-
Set the timeout to a value between 1 and 255 seconds.
-
Initiate interrupt or system reset.
-
Initiate full-system reset (including the MCA itself) or CPU-only reset.
Kernel configuration
You can manage the MCA watchdog driver support through the following kernel configuration option:
-
Digi ConnectCore SOMs Micro Controller Assist Watchdog (
CONFIG_MCA_WATCHDOG
)
This option is enabled as built-in on the default ConnectCore 6UL kernel configuration file.
Kernel driver
The MCA watchdog driver is located at:
File | Description |
---|---|
MCA watchdog driver |
Device tree bindings and customization
The MCA watchdog device tree binding is documented at Documentation/devicetree/bindings/watchdog/digi,mca-wdt.txt
.
Watchdog inside the MCA
mca_cc6ul: mca@7e {
[...]
wdt {
compatible = "digi,mca-wdt";
digi,full-reset;
};
};
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
.
When a device enters suspend mode, the watchdog timer is suspended as well. The timer resumes when the device resumes operation. |
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 6UL.
Go to GitHub to see the application instructions and source code.
See Watchdog API for more information about the watchdog APIx.
Enabling the watchdog in U-Boot
In a typical use case, a user space application or service starts the watchdog. However, if the system hangs before reaching this point, the watchdog is not able to reset the device. To avoid this situation, you may want to start the watchdog as early as possible, such as at the bootloader stage. Since the default U-Boot cannot start the watchdog, you must change the configuration and recompile U-Boot to add this functionality. To enable the MCA watchdog in U-Boot, add the following configuration options in the defconfig file that corresponds to your ConnectCore 6UL variant (see U-Boot files by variant):
CONFIG_WDT=y
CONFIG_WDT_MCA=y
U-Boot not only enables but also starts the watchdog when compiled with these entries. |
The default timeout for MCA watchdog is 128000 milliseconds. You can override that value by setting the following entry to a timeout in ms on the defconfig file:
CONFIG_WATCHDOG_TIMEOUT_MSECS=50000
Recompile U-Boot with the new configuration options, then program it on the device.
See Program images from U-Boot for more information.
The new U-Boot banner displays a new WDT
line showing the watchdog started with the configured timeout:
U-Boot dub-2020.04-r6.1 (Sep 19 2023 - 07:12:31 +0000)
CPU: i.MX6UL rev1.2 528 MHz (running at 396 MHz)
CPU: Industrial temperature grade (-40C to 105C) at 32C
Reset cause: POR
I2C: ready
DRAM: 256 MiB
MCA: HW_VER=1 FW_VER=1.19
WDT: Started with servicing (128s timeout)
PMIC: PFUZE3000 DEV_ID=0x30 REV_ID=0x11
NAND: 256 MiB
MMC: FSL_SDHC: 0
In: serial
Out: serial
Err: serial
Model: Digi International ConnectCore 6UL SBC.
ConnectCore 6UL SOM variant 0x06: Industrial Ultralite 528MHz, 256MB NAND, 256MB DDR3, -40/+85C, Wireless, Bluetooth
Board version 3, ID 135
Boot device: NAND
Net: FEC0 [PRIME]
Fastboot: Normal
Normal Boot
Hit any key to stop autoboot: 0
=>
Your application must refresh the MCA watchdog as soon as Linux starts; otherwise the system reboots after the configured timeout. See Using the watchdog. |