OTA Introduction
OTA (Over-the-Air) is a method for delivering firmware updates to remote devices using a network connection. Although the name implies a wireless connection, updates received over a wired connection (such as Ethernet) are still commonly referred to as OTA updates.
Zephyr supports multiple OTA upgrade schemes, as shown in the following table:
Example |
Path |
|---|---|
|
|
|
|
|
|
|
Among them, SMP Server provides a complete OTA solution, combining MCUboot bootloader with MCUmgr device management framework to achieve secure and reliable firmware upgrades. The OTA upgrade process will be introduced based on this example.
Key Components
Implementing a secure OTA update primarily relies on the collaboration of three core components:
MCUboot: An open-source, secure bootloader. It is responsible for verifying the integrity and authenticity of application firmware during device boot, and managing firmware switching and update processes in Flash storage areas.
SMP Server: A Simple Management Protocol service built into your application. It is responsible for receiving and processing various commands from external management tool MCUmgr, including firmware upload, status query, etc.
MCUmgr: A client management tool running on your development host. You can use it to send commands to the SMP Server on the device side through various methods such as UART/BT/UDP, thereby triggering and controlling the entire OTA process.
Module Hierarchy Diagram
Implementing secure OTA involves the following Zephyr submodules, with their hierarchical relationship shown in the diagram:
Upgrade Process
Using the above Key Components, a typical upgrade flow diagram is shown below:
Note
The diagram illustrates the Swap_using_offset and Swap_using_move upgrade methods.
For specific command usage, please refer to Upgrade Process, and for firmware format, please refer to MCUboot App Firmware.