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

drivers/watchdog/mca_wdt.c

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

ConnectCore 8X device tree
mca_cc8x: mca@63 {

	...

	watchdog {
		compatible = "digi,mca-cc8x-wdt";
		digi,full-reset;
	};
};

Using the watchdog

You can access the watchdog from your Android application. See Watchdog API for more information about the watchdog APIx.

When a device enters suspend mode, the watchdog timer is suspended as well. The timer resumes when the device resumes operation.

Sample application

The Watchdog Sample Application demonstrates the usage of the Watchdog API. The sample allows you to interact with the watchdog service by registering the application either to the system or the application watchdog services and report application failure at any time.

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

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 Android 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-r2.2 (Jan 18 2021 - 15:54:04 +0000)
Normal Boot
Trying to boot from MMC1
Primary set selected
Load image from MMC/SD 0x5f400


U-Boot dub-2020.04-r2.2 (Jan 18 2021 - 15:54:04 +0000)

CPU:   NXP i.MX8QXP RevB A35 at 1200 MHz at 25C
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 56682d58, SECO-FW 0e4b9cee, IMX-MKIMAGE 8da5cd23, ATF c949a88
  - U-Boot dub-2020.04-r2.2

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.