This is the documentation for the latest (main) development branch. If you are looking for the documentation of previous releases, use the drop-down menu on the left and select the desired version.

OTA_OPS

Overview

This application is a comprehensive example of using the WM IoT SDK with the wm_ota_ops API interface for device firmware upgrade functionality. It demonstrates how to handle OTA updates, including initializing OTA operations, reading firmware image data, writing data to the device’s OTA partition, and restarting the device after completion. Based on the wm_ota_ops API interface, various upgrade solutions can be implemented and connected to multiple IoT platforms. Here is the overall OTA architecture:

OTA Architecture

Requirements

  1. main/src/atcmd_ota.img is the upgrade firmware embedded in the code, sourced from the OTA upgrade firmware generated by compiling examples/atcmd. If you need to modify it to other firmware, you can refer to Build System - Embedding Files in Code

  2. The partition table used in this project must include the app_ota partition. For the partition table, please refer to Partition Table Mechanism

Building and Flashing

Example Location: examples\ota\ota_ops

For operations such as compiling and burning, please refer to: Quick Start Guide

Running Result

Upon successful execution, it will output the following logs

[I] (2) main: ver: 2.0.0rc2 build at Sep 11 2024 00:45:45
....................................................................................................
[I] (2856) example: This example succeeds in running.
[I] (2856) ota_ops: ota reboot, please wait for the restart...
start unxz, please wait...
...........................................
unxz succeed
[E] (2) nvs: scan item crc err in 0,status=fc,key=wm_sta_mac,do GC
[I] (108) main: ver: 2.0.0rc2 build at Sep 10 2024 17:54:07
[I] (308) atcmd: set default wifi config
[I] (368) atcmd: set default tcpip config
[I] (432) atcmd: atcmd init finished.