BK7238 OTA Updates Made Easy: Implementation Guide

BK7238 OTA Updates Made Easy: Implementation Guide

Overview #

  • 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 firmware supports compression and encryption, and OTA firmware production uses the rt_ota_packaging_tool tool.

Introduction to the OTA upgrade process #

ota_work

Figure 1 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

Download firmware

http_ota http://your_computer_ip/bk7238_ota.bin

MyWebServer3621

Figure 2 MyWebServer3621.exe interface

2.3. Restart the Bootloader

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.

2.5.Execute Application

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.

Now you can purchase BK7238 modules from here

Cionlabs

Cionlabs is formed by a group of experts with extensive domain knowledge coming from the leading technology and consulting firms around the globe with the aim to deliver The Best in the industry. We have the capability to develop comprehensive solutions to tackle the industry challenges, create value, and improve profitability and sustainability for our customers.

CONTACT US

Go to Top