HMI-Board OTA Upgrade Reference

6 min readMar 31, 2025

Hardware Platform

The HMI Board is a cost-effective graphical evaluation kit launched jointly by RT-Thread and Renesas, designed to replace the traditional HMI + main control board hardware. This integrated solution enables full capabilities for HMI, IoT, and control with just one piece of hardware. Leveraging Renesas’ high-performance RA6M3 chip and the RT-Thread software ecosystem, the HMI Board not only boasts robust hardware performance but also a rich software ecosystem, empowering developers to quickly create GUI-driven intelligent hardware products.

OTA Boot Example Tutorial

Overview

First, you need to flash the OTA upgrade Boot project. By running the current example project, you can learn how to use the OTA feature to upgrade the firmware on the development board. This example uses the qboot software package to complete the upgrade process. After flashing this project, you can experience the OTA upgrade functionality with the accompanying APP example, or follow the tutorial below to create your own upgradable APP.

Below are the steps to create the OTA Boot project using RT-Thread Studio (please ensure that the HMI-Board SDK is installed in the SDK Manager beforehand

User Instructions

Once the program is successfully downloaded, the system will automatically run and print system information. Connect the development board’s corresponding serial port to your PC, and open the corresponding serial port (115200–8–1-N) in a terminal tool. After resetting the device, you should see the RT-Thread output information. Enter the ‘help’ command to see a list of supported commands in the system.

\ | /- RT - Thread Operating System/ | \ 5.0.1 build Oct 20 2023 18:29:172006 - 2022 Copyright by RT-Thread teammsh >Qboot startup ...Qboot version : V1.0.5 2020.10.05[D/FAL] (fal_flash_init:47) Flash device | onchip_flash_hp0 | addr:0x00000000 | len: 0x00010000 | blk_size: 0x00002000 |initialized finish.[D/FAL] (fal_flash_init:47) Flash device | onchip_flash_hp1 | addr:0x00010000 | len: 0x001f0000 | blk_size: 0x00008000 |initialized finish.[I/FAL] ==================== FAL partition table ====================[I/FAL] | name | flash_dev | offset | length |[I/FAL] -------------------------------------------------------------[I/FAL] | boot | onchip_flash_hp0 | 0x00000000 | 0x00010000 |[I/FAL] | app | onchip_flash_hp1 | 0x00000000 | 0x000f8000 |[I/FAL] | download | onchip_flash_hp1 | 0x000f8000 | 0x001f0000 |[I/FAL] =============================================================[I/FAL] RT-Thread Flash Abstraction Layer initialize success.Press [Enter] key into shell in 1 s :[E/Qboot] Qboot firmware check fail. firmware infomation check fail.Jump to application running ...

After the Boot project is running, it will wait for 1 second for user input. If any key is pressed, it will remain in the Boot; otherwise, it will automatically transition to the APP project.

Mechanism Principle

The Boot project utilizes the FAL component to manage the partitioning of the on-chip Flash memory. The partition table will be printed when the program starts, as shown in the logs above. From the partition table, we can see that the on-chip Flash is divided into three partitions: boot, app, and download. The specific addresses are as follows:

Boot Firmware: This partition stores the boot firmware, which is the storage space for the current BOOT project. Its size is 64KB, and the address range is: 0x00000000 -> 0x0000FFFF.

App Firmware: This partition stores the user firmware, with the address range: 0x00010000 -> 0x00108000.

Download Partition: This partition is used to store the firmware to be upgraded. After downloading the upgrade firmware in the app, it is written to this region, and the boot will automatically complete the upgrade process. Its address range is: 0x00108000 -> 0x00200000.

Upgrading Process

APP Project Development Method

Creating an APP mainly involves several steps:

1. Modify the Linker Script: Adjust the firmware address to ensure it aligns with the start of the app partition.

2. Add the FAL Component: Integrate the FAL component to manage the file system.

3. Retrieve Current Partition Status: Implement methods to get the status of the current partitions.

4. Download Firmware: Download the firmware and update it to the download partition.

For specific implementation, you can refer to the app projects provided in the SDK.

OTA Method

The OTA process involves packaging the bin files of the app project to generate the upgrade files, which are then distributed to the target devices for upgrading.

Packaging the Firmware:

After the app project is successfully compiled, an rtthread.hex file will be generated in the Debug directory. We need to extract two bin files from this hex file. To do this, we utilize the hex2bin tool provided in the tool directory of the app project (available at https://github.com/Guozhanxin/hex2bin). This tool can separate the two bin files from the rtthread.hex file, where the one ending with 0x10000 corresponds to the firmware of the app partition, which is the firmware we need to upgrade.

$ hex2bin.exe rtthread.hex=> rtthread_0x10000.bin=> rtthread_0x100a150.bin

In the packages/qboot-vxxx/tools directory of the boot project, there is a tool called QBootPackager for packaging firmware. Unzip the software and double-click to open and use it.

Download the packaged firmware to the download partition on the flash, and then restart the device. The boot will automatically complete the firmware upgrade. This step can be performed using the Ymodem download tool in the app project.

OTA APP Example Tutorial Overview

● The following is an explanation of the OTA upgrade APP project. By running this example project, you can learn how to utilize the OTA feature to upgrade the firmware on the development board.

Note: This example requires the boot example to function correctly. Below are the steps to create the OTA APP project using RT-Thread Studio (please ensure that the HMI-Board SDK is installed in the SDK Manager beforehand):

User Instructions

After successfully downloading the program, the system will automatically run and display system information. Connect the corresponding serial port of the development board to your PC, and open the corresponding serial port (115200–8–1-N) in a terminal tool. After resetting the device, you should see the RT-Thread output information. Enter the help command to view the supported commands in the system.

[E/Qboot] Qboot verify fail. firmware infomation check fail.[E/Qboot] Qboot firmware update fail. destination partition verify fail.Erasing download partition ...Qboot delete firmware success.Jump to application running ...\ | /- RT - Thread Operating System/ | \ 5.0.1 build Oct 27 2023 15:13:382006 - 2022 Copyright by RT-Thread teamHello RT-Thread at app![D/FAL] (fal_flash_init:47) Flash device | onchip_flash_hp0 | addr:0x00000000 | len: 0x00010000 | blk_size: 0x00002000 |initialized finish.[D/FAL] (fal_flash_init:47) Flash device | onchip_flash_hp1 | addr:0x00010000 | len: 0x001f0000 | blk_size: 0x00008000 |initialized finish.[D/FAL] (fal_partition_init:211) Find the partition table on 'onchip_flash_hp0'offset @0x0000b374.[I/FAL] ==================== FAL partition table ====================[I/FAL] | name | flash_dev | offset | length |[I/FAL] -------------------------------------------------------------[I/FAL] | boot | onchip_flash_hp0 | 0x00000000 | 0x00010000 |[I/FAL] | app | onchip_flash_hp1 | 0x00000000 | 0x000f8000 |[I/FAL] | download | onchip_flash_hp1 | 0x000f8000 | 0x001f0000 |[I/FAL] =============================================================[I/FAL] RT-Thread Flash Abstraction Layer initialize success.msh >

This project comes with the ymodem_ota command, which can be used with terminal tools that support the Ymodem protocol to send the upgrade package to the system. Note: Tools that support the Ymodem protocol include Xshell, WindTerm, etc. Mobaxterm and PuTTY do not support it!

Once the boot process is initiated, it will automatically detect the upgrade firmware in the download partition and update it to the app partition, completing the upgrade.

1. If you see the log message “Qboot verify fail. Firmware information check fail,” you can ignore it as long as the OTA functionality is working correctly.

--

--

RT-Thread IoT OS
RT-Thread IoT OS

Written by RT-Thread IoT OS

An Open-Source Community-Powered Real-Time Operating System (RTOS) Project! Let’s develop, DIY, create, share, and explore this new IoT World together!

No responses yet