Dynamic APP Loading Techniques for Microcontrollers

Dynamic APP Loading Techniques for Microcontrollers

Dynamic APP loading techniques for microcontrollers are similar to applications on mobile phones and computers, allowing programs to be loaded from various sources such as SD cards, NAND, NOR, eMMC, etc., into execution spaces like SRAM, SDRAM, QSPI Flash, and internal Flash. Moreover, if MPU support is available, it can isolate APPs; if an APP crashes, the system remains unaffected. This video tutorial will explain the basic techniques, while the next tutorial will cover advanced techniques. Tencent Video

Bilibili Video

This video is mainly divided into the following contents:1. Application scenarios and advantages/disadvantages (1) When only part of the program, protocol, or functionality needs to be updated, dynamic APPs can be used, resulting in minimal code updates. (2) When the internal resources of the chip are insufficient, only the necessary functionality APP can be loaded as needed. (3) Based on a batch of APIs registered by the user in the main program, various mini-programs can be implemented, no longer limited to the programs already downloaded in Flash, similar to installing APPs on mobile phones and computers. (4) The hardware resource requirements are the same as using ThreadX independently to achieve the corresponding functionality, with no additional resource requirements.

2. Differences between dynamic APP loading and BOOT + APP loading The main difference is that after the BOOT program jumps to the APP, the BOOT is no longer used, while in dynamic APP loading, all programs run continuously, and the APP can call various APIs from the main program.

3. Implementation principles (1) The principle of dynamic loading manager in the main program; as long as resources are sufficient, an unlimited number of APPs can be loaded.

(2) Dynamic APP project design.

(3) Methods for dynamic APP to call main program APIs.

4. Practical explanation A main program and two dynamically loaded APP programs have been created.

Example download:

Link: https://pan.baidu.com/s/1I6JJwKWKXHy0wR1QWeqcKw  Extraction code: ksek

Reference materials:1. Official documentation:

https://docs.microsoft.com/zh-cn/azure/rtos/threadx-modules/chapter1

2. MDK’s C library startup process and initialization, namely the entire execution process of the __main function

https://www.armbbs.cn/forum.php?mod=viewthread&tid=111658

Leave a Comment

×