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.
Example
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:
char ssid[] = "yourapssid"; // your WPA2 network SSID (AP name)
char pass[] = "yourpassword"; // your WPA2 network password
Click Upload to upload the sketch to LinkIt 7697
After upload, open the Serial Monitor
You should see the following message:
HTTPUpdate example begins.
Attempting to connect to SSID: yourssid
Connected to wifi
Begin downloading new firmware
Press RST key to reboot to updated firmware version.
After reboot, it may take a while to update the firmware.
The USR LED lights up during the update process.
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 FOTAbinary, the update() method flags the FOTAregion 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.
How to Generate FOTA Binary
As we mentioned, the FOTA binary is a processed sketch binary. You can follow these steps to generate the FOTA binary: