Real-time core application design suggestions
Real-time (RT) core applications run on bare metal or with a real-time operating system (RTOS) on the real-time cores. Many of the design recommendations for HL-core applications also apply to designing RT-core applications. This topic discusses further design suggestions to consider when designing RT-core applications.
- Use a watchdog timer: We recommend that you enable and implement the MT3620 watchdog timer so that you can detect deadlock and implement proper recovery logic. For details, see Use a watchdog timer in an RTApp. This could also be an important point where the RT application can signal the HL-core application (for example, through the inter-core mailbox) that something has gone wrong so that appropriate action can be taken by either application, such as resetting the device. This can be done in the following ways:
- Restart the device by calling the
PowerManagement_ForceSystemReboot
function from the HL-core application. See Levels of restarting on a device. - Bypassing the HL-core APIs by performing a hardware reset through a dedicated GPIO with the MT3620's power management pins (PMU_EN, EXT_PMU_EN, or SYSRST_N). For more information on PMU_EN and EXT_PMU_EN, see Power Down considerations. Hardware reset with SYSRST_N typically involves designing the device schematics with up to three (one per each core) dedicated reset GPIOs, connected through diodes and RC filters to the device's SYSRST_N pin. Performing a hardware reset allows independent action from any of the HL-core and RT-core applications if the design requires deterministic recovery from any application running on any core.
- Restart the device by calling the
Note
Give very careful consideration to using GPIOs to reset the device from an RT-core application, as an unintended effect of programming or design of that application (for example, continuously resetting the device) could prevent the device from receiving operating system and application updates.
- Implement inter-core communications in projects that combine HL-core and RT-core applications: Even if not explicitly needed, it is always recommended that you implement a minimal communication exchange between the HL-core and RT-core applications. For more information, see Communicate with a real-time capable application. Besides obvious data exchange when inter-core communication is explicitly designed as part of the overall application architecture, it's useful and important that the two parties are synced with respect to each other's status so that better overall device status can be managed by each other (see the Inter-core communication sample).
For additional reference information about developing RT-core applications, including drivers and samples for using MT3620 peripherals and features, see:
- MediaTek MT3620 documentation
- MediaTek MT3620 M4 Driver & Real-Time Application Sample Code
- Drivers for Azure Sphere MT3620 realtime cores (CM4) by Codethink Labs - These drivers have been developed using easy-to-use interfaces (APIs) which closely mimic those available for the HL-core applications.
- Samples for Azure Sphere MT3620 real-time cores (CM4) by Codethink Labs