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

Golioth

External repository

Eclipse hawkBit

zephyr/samples/subsys/mgmt/hawkbit/

UpdateHub

zephyr/samples/subsys/mgmt/updatehub/

SMP Server

zephyr/samples/subsys/mgmt/mcumgr/smp_svr/

Lightweight M2M (LWM2M)

zephyr/samples/net/lwm2m_client/

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:

../../_images/zephyr_ota_subsystem.svg

Upgrade Process

Using the above Key Components, a typical upgrade flow diagram is shown below:

../../_images/zephyr_ota_upgrade_flow.svg

Note