Use a watchdog timer in an RTApp

Important

This is the Azure Sphere (Legacy) documentation. Azure Sphere (Legacy) is retiring on 27 September 2027, and users must migrate to Azure Sphere (Integrated) by this time. Use the Version selector located above the TOC to view the Azure Sphere (Integrated) documentation.

The MT3620 supports a watchdog timer for each of the real-time cores. These watchdog timers are available to real-time capable applications (RTApps).

If your real-time application scenarios require use of watchdog timers, keep the following in mind:

  • There is no specific Azure Sphere OS or SDK support for the real-time core watchdog timers.

  • The watchdog timers can be programmed directly via the registers that control their operation or by using MediaTek drivers. See the watchdog timer sample application.

For register base addresses, interrupt numbers, clock rate, sampling frequency, and other details about the MT3620, see the MT3620 Datasheet and the MT3620 M4 User Manual; if questions remain, you can request details from Avnet by emailing Azure.Sphere@avnet.com.

Effects of watchdog reset

When the watchdog timer raises a reset event, the real-time core is vectored to the entry point of the app. The RTApp is responsible for re-initializing memory, stack, and any peripherals as required to correctly resume operation. The Azure Sphere OS does not affect the contents of the memory, nor does it re-initialize peripherals on the real-time core during the reset operation.

The watchdog reset does not trigger any notifications, events, or alerts to other real-time cores, to the Azure Sphere OS, or to any high-level applications that are currently running. The effect of the watchdog reset is strictly local to the real-time core processor that is reset.

The watchdog timer sample application

MediaTek provides drivers and sample code for MT3620 real-time applications on GitHub.