FOTA AT commands¶
The following commands list contains AT commands related to firmware-over-the-air updates (FOTA) requests.
#XFOTA command sends various types of FOTA requests, based on specific operation codes.
The set command allows you to send a FOTA request.
<op>parameter can accept one of the following values:
0- Cancel FOTA (during download only).
1- Start FOTA for application update.
2- Start FOTA for modem delta update.
6- Read application image size and version (optional for application FOTA).
7- Read modem scratch space size and offset (optional for modem FOTA).
8- Erase mcuboot secondary slot (optional for application FOTA).
9- Erase modem scratch space (optional for modem FOTA).
<file url>parameter is a string. It represents the full HTTP or HTTPS path of the target image to download.
<sec_tag>parameter is an integer. It indicates to the modem the credential of the security tag used for establishing a secure connection for downloading the image. It is associated with the certificate or PSK. Specifying the
<sec_tag>is mandatory when using HTTPS.
<pdn_id>parameter is an integer. It represents the Packet Data Network (PDN) ID that can be used instead of the default PDN for downloading.
#XFOTA: <primary_partition_id>,<MCUBOOT_version>,<img_size>,<img_version> #XFOTA: <secondary_partition_id>,<MCUBOOT_version>,<img_size>,<img_version>
<secondary_partition_id>integers give the partition ID.
<MCUBOOT_version>major version integer. Value 1 corresponds to MCUboot versions 1.x.y.
<img_size>integer gives the size of the application image in this partition in bytes.
<img_version>string gives the version of the application image as “<major>.<minor>.<revision>+<build_number>”.
<size>integer gives the size of the modem DFU area in bytes.
<offset>integer gives the offset of the firmware image in the modem DFU area.
Read image size and version at#xfota=6 #XFOTA: 3,1,295288,"0.0.0+0" #XFOTA: 7,1,294376,"0.0.0+0" OK Application download and activate AT#XFOTA=1,"http://remote.host/fota/slm_app_update.bin" OK #XFOTA: 1,0,0 ... #XFOTA: 1,4,0 AT#XRESET Erase previous image after FOTA AT#XFOTA=8 OK Read modem scratch space size and offset at#xfota=7 #XFOTA: 368640,0 OK Erase modem scratch space before FOTA AT#XFOTA=9 OK Modem download and activate AT#XFOTA=2,"http://remote.host/fota/mfw_nrf9160_update_from_1.3.0_to_1.3.0-FOTA-TEST.bin" OK #XFOTA: 1,0,0 ... #XFOTA: 1,4,0 AT#XRESET
<fota_stage>value is an integer and can assume one of the following values:
2- Download, erase pending (modem FOTA only)
3- Download, erased (modem FOTA only)
4- Downloaded, to be activated
<fota_status>value is an integer and can assume one of the following values:
3- Reverted (application FOTA only)
<fota_info>value is an integer. Its value can have different meanings based on the values assumed by
<fota_status>. See the following table:
Percentage of the download
0- Downloading is cancelled before completion
The error codes can be the following:
1- Download failed
2- Update image rejected (for example modem firmware version error)
3- Update image mismatch (for example
<file_url>points to a modem image)
For modem FOTA, the error codes can be the following:
0x4400001u- The modem encountered a fatal internal error during firmware update.
0x4400002u- The modem encountered a fatal hardware error during firmware update.
0x4400003u- Modem firmware update failed, due to an authentication error.
0x4400004u- Modem firmware update failed, due to UUID mismatch.