This article is shared from the China Mobile OneOS WeChat public account " OneOS Remote Upgrade Capability Practical Demonstration ", author OneOS.
OTA is usually divided into three ways: full, compressed and differential upgrade
Full upgrade: the most common upgrade method, the upgrade package is large, consumes a large amount of traffic, and takes a long time to upgrade;
Compression upgrade: the more common upgrade method, after compression is generally about 70% of the entire package, consumes a large amount of traffic, and takes a long time to decompress and upgrade , the storage resource requirements are high, and the memory requirements are high;
differential upgrade: also called incremental upgrade or patch upgrade, requires algorithm and tool support, the upgrade package is the smallest, consumes less traffic, high upgrade efficiency, and occupies moderate memory and storage resources.
Differential upgrade and full upgrade comparison test
---Lab test data
Process introduction
Key words
Wired network connection, bootloader, upgrade platform, online differential package making, touch screen and GUI graphics operation
- Make two different OneOS firmware versions, version 1.0 and version 1.1
- Make differential packages online and deploy to upgrade platforms
- Burn the bootloader and version 1.0 to the development board (using STM32F769 Disco), check the upgrade after booting
- Manually confirm the upgrade, download the differential firmware package, manually confirm to restart the device, and enter the bootloader to upgrade
- After the upgrade is complete, start the machine and report the upgrade information to the server. You can view the upgrade log on the server side of the upgrade platform.
STM32F769 Disco Development Board
Implementation process
1) Bootloader download and burning
Obtain the bootloader firmware of the currently supported development board on OneOS gitee and use ST-LINK Utility to burn it to the development board.
Reference URL: https://gitee.com/cmcc-oneos/bootloader/
2) Make differential packages online
To configure the project in menuconfig, you need to open the (eth, lwip, gui, ota) configuration, open the f769 keil project, compile and generate the oneos.bin file, modify the version number, and generate the (1.0, 1.1) version respectively.
Log in to the China Mobile OTA upgrade platform:
Reference URL: https://os.iot.10086.cn/otaplatform/ProjectHome
Generate a differential package (1.0->1.1 differential) by generating two versions of the firmware package
After the build is complete, deploy to the platform so that the upgrade is detected.
3) Device download, restart, upgrade
After deploying the upgrade package, plug in the network cable to start the device, and an upgrade prompt will pop up.
Select Yes to start downloading the differential package. After the download is complete, the device-side GUI will prompt to restart
Select Yes to start the upgrade on the device side
4) Code implementation
Overall design: It is divided into 3 large modules, UI, differential package download and report upgrade results. The functions of each module are divided as follows:
Result presentation
1) View the log on the device side
- The download package received and verified successfully
- Reboot the bootloader to erase the upgrade
- After restarting, report the result successfully
2) View the upgrade log on the upgrade platform
- Version deployed successfully
- Platform upgrade statistics
OneOS is a lightweight operating system launched by China Mobile for the Internet of Things. It features tailorable, cross-platform, low power consumption, and high security. It supports mainstream CPUs such as ARM Cortex-M/R/A, MIPS, and RISC-V. The architecture is compatible with POSIX, CMSIS and other standard interfaces, supports Micropython language development, and provides graphical development tools, which can effectively improve development efficiency and reduce development costs, helping customers develop stable, reliable, safe and easy-to-use IoT applications. Official website address: https://os.iot.10086.cn/
OneOS software address: http://www.oschina.net/p/cmcc-oneos
OneOS project address: https://gitee.com/cmcc-oneos/ OneOS
OneOS technical exchange group: 158631242