- Supports remote firmware upgrades on the network side. Use HTTP protocol to download OTA firmware from the server, and then write it to the OTA partition. After the device is restarted, the bootloader will decompress the OTA partition firmware copy it to the app running partition, and load the new app partition firmware.
- ota rbl firmware supports compression and encryption, and OTA firmware production uses the rt_ota_packaging_tool tool.
Introduction to the OTA upgrade process #
2.1. Prepare upgrade files
Enter the SDK directory and execute the following command to generate OTA firmware
/tools/rtt_ota/rt_ota_packaging_tool_cli-x64 -f out/beken7231_bsp.bin -v 1.0.1 -o out/bk7238_ota.bin -p app -c lzma -s aes -k 0123456789ABCDEF0123456789ABCDEF -i 0123456789ABCDEF
2.2. Download the upgrade file
- The corresponding download manager in the Application application downloads the upgrade file to the OTA partition of Flash.
- If there is no HTTP server, you can first set up a local HTTP Server environment to verify the function of http_ota, and download MyWebServer3621.exe or other local http server tools by yourself.
- Take MyWebServer3621.exe as an example: Click the Browse button, select the path to store the OTA firmware file generated in step 2.1, and click Start
- The url is http://your_computer_ip/bk7238_ota.bin. After entering it in the browser, it can be downloaded to bk7238_ota.bin, indicating that the environment is successfully established.
- The module is connected to the same router as the computer, and the connection is performed through CLI.
Connect to the Router
sta ssid password
Figure 2 MyWebServer3621.exe interface
After downloading the upgrade file, BK7238 will automatically restart the system and execute the bootloader program.
2.4. Update firmware
The bootloader program detects that there is an upgrade file in the OTA partition, performs the firmware decompression and update action, and checks the integrity and legality of the firmware.
After the firmware is updated and verified successfully, the Bootloader will guide the execution of the Application program, and the upgrade is completed.
3. OTA upgrade failure analysis #
- Problem 1: After the OTA download is completed and restarted, it is not normally upgraded to the target program. First, ensure that the starting address and length of the OTA partition in the bootload partition table correspond to the starting address of the OTA partition in the code partition table.
- Problem 2: The OTA download was not completed. First, confirm whether the module RF parameters have been calibrated and check whether the network environment is normal.