FOTA Update
Last updated
Last updated
FOTA stands for Firmware Over the Air, allowing you to update the on-board sketch binary using Wi-Fi.
The LHTTPUpdate library allows you to download a FOTA binary from a given HTTP URL, and apply it to LinkIt 7697.
Upgrade your LinkIt 7697 Arduino BSP to v0.10.5 or later version.
Select LinkIt 7697 from Tools > Board menu.
Open Examples > LHTTPUpdate > LHTTPUpdate
Change the ssid and pass according to your Wi-Fi AP setting:
Click Upload to upload the sketch to LinkIt 7697
After upload, open the Serial Monitor
You should see the following message:
This means the example is now downloading the new binary from the URL
Press RST button to reboot and replace on-board binary with the downloaded sketch binary(fota_example.bin)
It may take sometime for the update process to complete. After complete, the board starts blinking - and the on-board sketch binary is now updated.
The FOTA binary is a processed sketch binary. It is compressed and checksum to ensure that corruptions can be detected during the update process.
During the update() method, the FOTA binary is written in to the FOTA region of the on-board flash. The on-board flash layout is shown below:
After finish downloading the FOTA binary, the update() method flags the FOTA region as ready to update.
After the system reboots, the bootloader detects new binaries in the FOTA region, uncompress and verifies it, and write the new binary to the CM4 firmware region.
And completes the FOTA operation.
As we mentioned, the FOTA binary is a processed sketch binary. You can follow these steps to generate the FOTA binary:
Export your sketch binary by selecting Sketch > Export Compiled Binary from the IDE menu.
Follow the instruction of the FOTA ROM Package to process the sketch binary. We show the instructions of the Windows version below.
We denote the FOTA ROM Package root folder as $FOTA_ROOT.
Copy $FOTA_ROOT\_ini\template\mt7697\FOTARomPacker.ini to _ini
Modify $FOTA_ROOT\_ini\FOTARomPacker.ini
Modify the File attribute.
Do not change the Start_Address, Partiion_Size and Is_Compressed option. These settings must match the flash layout of LinkIt 7697.
Copy the sketch binary to $FOTA_ROOT\_Load\mt7697
Execute the script gen_image.bat
The generated FOTA binary is located in the _Output folder
After generating the FOTA binary, you can then host the binary in a HTTP server and use LHTTPUpdate.update() to download and apply the FOTA binary.
The sketch downloads the "FOTA binary" from , using the following call:
Download the FOTA ROM Package tool from .