The MCA implements a watchdog timer in its firmware. Any internal CPU watchdog timer on the ConnectCore 8X 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 8X 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_cc8x: mca@63 {
[...]
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 8X.
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 8X 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 SPL dub-2020.04-r6.1 (Sep 19 2023 - 07:15:55 +0000)
Normal Boot
Trying to boot from MMC1
Primary set selected
Load image from MMC/SD 0x59c00
U-Boot dub-2020.04-r6.1 (Sep 19 2023 - 07:15:55 +0000)
CPU: NXP i.MX8QXP RevC A35 at 1200 MHz at 33C
DRAM: 2 GiB
MCA: HW_VER=1 FW_VER=1.01
WDT: Started with servicing (128s timeout)
MMC: FSL_SDHC: 0, FSL_SDHC: 1
In: serial
Out: serial
Err: serial
Model: Digi International ConnectCore 8X SBC Pro Board.
ConnectCore 8X SOM variant 0x02: 2 GiB LPDDR4, Wi-Fi, Bluetooth, MCA, Crypto-auth
Board version 3, ID 135
Boot: MMC0
BuildInfo:
- SCFW 6638c032, SECO-FW c9de51c0, IMX-MKIMAGE 3bfcfccb, ATF e4b2dbf
- U-Boot dub-2020.04-r6.1
flash target is MMC:0
Net: eth0: ethernet@5b040000 [PRIME], eth1: ethernet@5b050000
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. |