MT7687 API Reference  LinkIt SDK v4
FOTA

This section introduces the FOTA interface APIs including terms and acronyms, supported features, software architecture, details on how to use this interface, FOTA function groups, enums, structures and functions. More...

Overview

This section introduces the FOTA interface APIs including terms and acronyms, supported features, software architecture, details on how to use this interface, FOTA function groups, enums, structures and functions.

This interface writes into a pre-defined register flag. The bootloader enters the update process based on the value written in the flag. The return error code indicates if the flag is written successfully or not. After the update is complete, the UA automatically resets the register flag. Note, it is recommended to call the reboot API after calling the FOTA interface, because fota_trigger_update() does not contain reboot functionality. There is no dedicated FOTA read or write SDK API, it is suggested to use HAL flash SDK API to write data to specified address of flash. Regarding to the FOTA update flow & usage, please refer to the Firmware Update Developers Guide located under [sdk_root]/doc folder.

Terms and acronyms

Terms Details
FOTA Firmware Over-The-Air (FOTA) is a Mobile Software Management technology in which the operating firmware of a mobile device is wirelessly upgraded and updated by its manufacturer. Please refer to FOTA in Techopedia.
UA Update Agent performs the actual FOTA update on devices. It operates as stand-alone application in bootloader and replaces the old firmware with the new one.
TFTP Trivial File Transfer Protocol (TFTP) is a simple, lockstep, File Transfer Protocol which allows a client to get from or put a file onto a remote host. One of its primary uses is in the early stages of nodes booting from a local area network. For an introduction to TFTP, please refer to TFTP in Wikipedia.

Software Architecture of FOTA

MediaTek MT7687 provides command line to operate FOTA functionality. It also offers a reference example with details on how to download using Wi-Fi, enable TFTP client on the MT7687 target device and setup a TFTP server to share a FOTA package file. Then MT7687 device completes the downloads with the specified input command.

fota_mt7687_arch.png

Functions

fota_ret_t fota_trigger_update (void)
 Provide the register flag for the bootloader to check whether to enter FOTA update process or not. More...
 

Modules

 Enums
 

Function Documentation

fota_ret_t fota_trigger_update ( void  )

Provide the register flag for the bootloader to check whether to enter FOTA update process or not.

Returns
FOTA_TRIGGER_SUCCESS/FOTA_TRIGGER_FAIL.
Note
Call the reboot API after using this function.
1 //Trigger a FOTA update.
2 fota_ret_t ret;
3 ret = fota_trigger_update();
4 if (ret < FOTA_TRIGGER_SUCCESS)
5 {
6  // Failed to write the register flag, error handling.
7 }
8 // Call the reboot API, hal_wdt_software_reset().