Cellular Module Firmware Update

Cellular Module Firmware Update Using EasyFlash, FOAT and Firmware Install command Application Note Abstract Description of how to update the firmwar...
Author: Alexandra Hodge
8 downloads 2 Views 2MB Size
Cellular Module Firmware Update Using EasyFlash, FOAT and Firmware Install command Application Note

Abstract Description of how to update the firmware on u-blox cellular modules using EasyFlash, FOAT (over AT commands), and the Firmware Install command.

www.u-blox.com UBX-13001845 - R13

Cellular Module Firmware Update - Application Note

Document Information Title

Cellular Module Firmware Update

Subtitle

Using EasyFlash, FOAT and Firmware Install command

Document type

Application Note

Document number

UBX-13001845

Revision, date

R13

Document status

Early Production Information

04-Apr-2016

Document status explanation Objective Specification

Document contains target values. Revised and supplementary data will be published later.

Advance Information

Document contains data based on early testing. Revised and supplementary data will be published later.

Early Production Information

Document contains data from product verification. Revised and supplementary data may be published later.

Production Information

Document contains the final product specification.

This document applies to the following products: Product name LEON-G SARA-G SARA-U LISA-U TOBY-L2 MPCI-L2

u-blox reserves all rights to this document and the information contained herein. Products, names, logos and designs described herein may in whole or in part be subject to intellectual property rights. Reproduction, use, modification or disclosure to third parties of this document or any part thereof without the express permission of u-blox is strictly prohibited. The information contained herein is provided “as is” and u-blox assumes no liability for the use of the information. No warranty, either express or implied, is given, including but not limited, with respect to the accuracy, correctness, reliability and fitness for a particular purpose of the information. This document may be revised by u-blox at any time. For most recent documents, please visit www.u-blox.com. Copyright © 2014, u-blox AG

UBX-13001845 - R13 Page 2 of 39

Cellular Module Firmware Update - Application Note

Contents Contents.............................................................................................................................. 3 1

Introduction .................................................................................................................. 5

2

FW update .................................................................................................................... 6

3

EasyFlash ....................................................................................................................... 7 3.1 3.2 3.3

4

FW download over UART or UART AUX ................................................................................................ 7 FW download over USB (LISA-U and SARA-U series only) .................................................................... 10 FW download over USB (TOBY-L2 / MPCI-L2 series only) .................................................................... 13

FOAT – Firmware update Over AT commands ......................................................... 15 4.1 AT command description for TOBY-L2 series ...................................................................................... 15 4.1.1 Defined values ............................................................................................................................. 15 4.1.2 Error result codes ........................................................................................................................ 17 4.2 AT command description for LEON-G/SARA-G/LISA-U/SARA-U series.................................................. 17 4.2.1 Defined values ............................................................................................................................. 20 4.2.2 Error result codes ........................................................................................................................ 21 4.2.3 FW update procedure on LISA-U2 series ...................................................................................... 21

5

Firmware install (+UFWINSTALL)............................................................................... 23 5.1 Introduction........................................................................................................................................ 23 5.2 AT command syntax for LISA-U2 ........................................................................................................ 23 5.2.1 Defined values ............................................................................................................................. 24 5.3 AT command syntax for TOBY-L2 ....................................................................................................... 25 5.3.1 Defined Values ............................................................................................................................ 25 5.4 Firmware Install specifications ............................................................................................................. 26 5.4.1 Generation of the “update file” .................................................................................................. 26 5.4.2 Recovery mechanism ................................................................................................................... 26 5.4.3 Installation performance .............................................................................................................. 26 5.4.4 Limitations................................................................................................................................... 26

Appendix .......................................................................................................................... 27 A List of acronyms ......................................................................................................... 27 B

Firmware Install error result codes ........................................................................... 28 B.1 B.2

C

Error result codes for LISA-U2 ............................................................................................................. 28 Error result codes for TOBY-L2 / MPCI-L2 ............................................................................................ 29

FOTA demo application in m-center ......................................................................... 30 C.1 C.2

FOTA: firmware downloading procedure ............................................................................................ 31 FOTA: firmware upgrading procedure................................................................................................. 31

D FOAT/FWUPDATE on a linux system ......................................................................... 32 UBX-13001845 - R13

Early Production Information

Contents Page 3 of 39

Cellular Module Firmware Update - Application Note D.1 D.2

Minicom ............................................................................................................................................. 32 Sx command....................................................................................................................................... 36

Related documents .......................................................................................................... 38 Revision history ................................................................................................................ 38 Contact .............................................................................................................................. 39

UBX-13001845 - R13

Early Production Information

Contents Page 4 of 39

Cellular Module Firmware Update - Application Note

1 Introduction This document briefly describes the firmware update mechanism for u-blox cellular modules. Cellular firmware comprises three parts:  The module image  The module parameters  The module file system, which contains data that can be stored by the user (such as SMS/text messages) To completely update the firmware it is necessary to download at least the module image and parameters; the module file system is optional. The three images are resident in dedicated areas of the flash memory. It is possible to update the firmware to a newer version or to revert to an older one. The firmware installation procedure updates only the module image. LEON-G series firmware can be reverted to an older firmware version only using the EasyFlash tool.

Interface EasyFlash

FOAT

FWINSTALL

LEON-G series

SARA-G series

SARA-U series

LISA-U series

LISA-U200 FOTA / LISA-U201 FOTA

MPCI-L2 series

TOBY-L2 series

UART















UART AUX















USB















UART















UART AUX















USB















SPI















UART













USB













2

1



2

2



Table 1: Firmware update procedures and interfaces used on u-blox cellular modules

The +CGMR AT command allows the user to verify the module modem version: Command

Response

Description

AT+CGMR

11.40 OK

11.40 is an example of a modem version.

1 2

Not supported by TOBY-L200-00S / TOBY-L210-00S Not supported by MPCI-L2 "00" and "60" product versions and by TOBY-L2 "00", "50" and "60" product versions

UBX-13001845 - R13

Early Production Information

Introduction Page 5 of 39

Cellular Module Firmware Update - Application Note

2 FW update This section introduces the different methods available to update the firmware of the cellular module. For each method it is shown what will change in the cellular module with respect to the previous FW version. Table 2 shows the different categories that may be affected by a firmware update. Category

Description

Firmware

Firmware of the module

NVM

All parameters described in appendix B.2 of u-blox AT command manual [1]

Profiles

All parameters described in appendix B.1 of u-blox AT command manual [1]

FS (File System)

Place where the user can store his own files

Calibration data

Data not belonging to previous categories

Table 2: Categories involved in FW update

The following methods are available for the FW update:   

EasyFlash tool FOAT, firmware update over AT +UFWINSTALL “Firmware” category is not present in Table 3, because it is updated in all the methods: EasyFlash, +UFWUPD [with 0 and 2], +UFWINSTALL.

Table 3 lists the cellular products, and for each one, the three firmware update methods. Each method lists the categories that are changed after the firmware update (i.e., reset to the factory-programmed values). If a category is not listed, it means that it is not changed after the update procedure. For example, for LEON-G using the FOAT (+UFWUPD) method with =0, it will not change the NVM, profiles and FS, while with with =1 it will not change the NVM and profiles, but will change the FS. Product

EasyFlash

FOAT (+UFWUPD) =[0..2]

+UFWINSTALL

LEON-G

NVM, profiles, FS

0: 1: FS

Not available

SARA-G

NVM, profiles, FS

0: NVM, profiles 1: FS

Not available

LISA-U1

NVM, profiles, FS

0: NVM, profiles 1: NVM, profiles, FS 2: NVM, profiles, FS

Not available

LISA-U2

NVM, profiles, FS

0: NVM, profiles 1: NVM, profiles, FS 2: NVM, profiles, FS

Not available

LISA-U200-82S

NVM, profiles, FS

0: NVM, profiles 1: NVM, profiles, FS 2: NVM, profiles, FS

NVM, profiles

LISA-U200-83S

NVM, profiles, FS

0: NVM, profiles 1: NVM, profiles, FS 2: NVM, profiles, FS

NVM, profiles

LISA-U201-83S

NVM, profiles, FS

0: NVM, profiles 1: NVM, profiles, FS 2: NVM, profiles, FS

NVM, profiles

MPCI-L201-01S

NVM, profiles, FS

NVM, profiles, FS

NVM, profiles, FS

MPCI-L2

NVM, profiles, FS

NVM, profiles, FS

NVM, profiles, FS

TOBY-L201-01S

NVM, profiles, FS

NVM, profiles, FS

NVM, profiles, FS

TOBY-L2

NVM, profiles, FS

NVM, profiles, FS

NVM, profiles, FS

Table 3: Applicable products and categories that will change when performing a FW update

UBX-13001845 - R13

Early Production Information

FW update Page 6 of 39

Cellular Module Firmware Update - Application Note

3 EasyFlash See Table 1 for the list of modules and interfaces supporting EasyFlash. A proper setup file, e.g. Setup_EasyFlash_.exe, is used to install the executable file and the needed components. EasyFlash has been tested on these operating systems: Windows XP, Windows Vista (32/64 bit), Windows 7 (32/64 bit), Windows 8 (32/64 bit), Windows 8.1 (32/64 bit) (32/64 bit) The EasyFlash tool requires a file in DOF format, which includes the firmware components (module image, module parameters, module file system) that are needed to perform a FW update. The FW update using EasyFlash requires a PC or Notebook. The EasyFlash executable file and the .DOF file (containing the firmware version to update) must be stored in the same folder in the PC or Notebook. Only one .DOF file should be in the folder. For LEON-G and SARA-G3 series, the .ROF file of the current firmware used by the module must be stored in the same folder where the EasyFlash executable file and the firmware version (in DOF file format) are located. The .ROF file is a downloadable file that makes it possible to revert to an older FW release. It is only required for reverting to older FW for LEON-G and SARA-G3, and is not required for LISA-U, SARA-U and TOBY-L2. Before reverting to a previous firmware version, store only one .ROF file and one .DOF file in the same folder together with the EasyFlash tool executable file. Each cellular product family has a unique EasyFlash version (i.e. LEON-G EasyFlash cannot be used for LISA-U / SARA-G3 series modules and vice versa): 

LEON-G series: EasyFlash2G_v..exe



LISA-U, SARA-G3 and SARA-U series: EasyFlash_.exe

 TOBY-L2 / MPCI-L2 series: EasyFlash_.exe where and indicate the tool version. Always use the latest available tool version.

3.1 FW download over UART or UART AUX To update the module firmware using EasyFlash over UART or UART AUX interface, follow these steps: 1. Power on the module. 2. Connect the PC or notebook to the UART or UART AUX interface of the module by means of proper voltage translators (e.g. USB to UART converters) or by means of proper configuration of the connected application processor in pass-through mode. See the corresponding EVK user guide for the correct jumpers and slides configuration for the FW update. 3. Run the EasyFlash tool.

UBX-13001845 - R13

Early Production Information

EasyFlash Page 7 of 39

Cellular Module Firmware Update - Application Note 4. Select the COM port where the module is connected and the baud rate (921600 b/s is suggested if supported by the used external parts).

5. Click the EasyFlash “Start” button.

6. Keep the module RESET_N input low for a proper time period when performing a module reset.

UBX-13001845 - R13

Early Production Information

EasyFlash Page 8 of 39

Cellular Module Firmware Update - Application Note 7. The download starts.

8. The firmware update is completed!

9. Close EasyFlash and reset the module.

UBX-13001845 - R13

Early Production Information

EasyFlash Page 9 of 39

Cellular Module Firmware Update - Application Note

3.2 FW download over USB (LISA-U and SARA-U series only) Firmware download using EasyFlash over the USB is similar to that for UART or UART AUX, following these steps: Install the FlashUSB drivers before flashing over USB. If the drivers are not installed the download does not start. The drivers are provided with the EasyFlash installation package and the user can choose whether or not to perform installation. 1. Power on the module. 2. Connect the PC or notebook to the USB interface of the module. See the corresponding EVK user guide for the correct jumpers and slides configuration for the FW update. 3. Run the EasyFlash tool. 4. Click on the “USB port” button (COM port and baud rate are not applicable when using USB).

UBX-13001845 - R13

Early Production Information

EasyFlash Page 10 of 39

Cellular Module Firmware Update - Application Note 5. Click the EasyFlash “Start” button.

6. Keep the module RESET_N input low for a proper time period when performing a module reset. 7. The download starts.

UBX-13001845 - R13

Early Production Information

EasyFlash Page 11 of 39

Cellular Module Firmware Update - Application Note 8. The firmware update is completed!

9. Close EasyFlash tool and reset the module to start.

UBX-13001845 - R13

Early Production Information

EasyFlash Page 12 of 39

Cellular Module Firmware Update - Application Note

3.3 FW download over USB (TOBY-L2 / MPCI-L2 series only) Firmware download using EasyFlash over the USB is similar to that for UART or UART AUX. Install the TOBY-L2 USB drivers before flashing over USB. If the drivers are not installed, the download does not start. To download firmware with EasyFlash, follow these steps: 1. Power on the module. 2. Connect the PC or notebook to the module USB interface. 3. Run the EasyFlash tool.

4. Click the EasyFlash “Start” button and wait for packet decompression (yellow progress bar)

5. Keep the module RESET_N input low for a proper time period when performing a module reset. UBX-13001845 - R13

Early Production Information

EasyFlash Page 13 of 39

Cellular Module Firmware Update - Application Note 6. The download starts.

7. The firmware update is completed!

8. Close EasyFlash tool and reset the module to start.

UBX-13001845 - R13

Early Production Information

EasyFlash Page 14 of 39

Cellular Module Firmware Update - Application Note

4 FOAT – Firmware update Over AT commands See Table 1 for the list of modules and interfaces supporting FOAT. The firmware update can be carried out via the AT interface of the module (see the table reported in section 1) through the +UFWUPD AT command and Xmodem (or Xmodem-1k protocol) protocol. After having downloaded the "FOAT update" file delivered by u-blox , the Xmodem protocol will update the module. The Xmodem protocol handles the errors (data corruption, data loss etc.) internally during the update phase. When a firmware update is triggered, the host processor can choose either the Xmodem-1k protocol (1024 bytes packets) or Xmodem protocol (128 bytes packets). The command syntax differs depending on the module series. See the corresponding section for the detailed description.

4.1 AT command description for TOBY-L2 series On TOBY-L2 series, the FW update over AT commands is performed by means of a BIN file officially released by u-blox. To start the process the corresponding md5 signature is needed. Using either the Xmodem or the Xmodem-1k protocol the firmware and file system are updated. Use the proper released file for Xmodem (128) and Xmodem-1k (1024) with the corresponding md5 signature. Type

Syntax

Response

Example

Set

AT+UFWUPD=

+UFWUPD: ONGOING CCC…

AT+UFWUPD=a07a5534201b2e42dd2d 964920e57319

OK

+UFWUPD: ONGOING

UFWUPD REBOOT

CCC… OK UFWUPD REBOOT

4.1.1 Defined values Parameter

Type

Description



Number



32 hex number

The parameter is not mandatory for TOBY-L200-00S / TOBY-L200-50S / TOBY-L210-00S / TOBY-L210-50S / TOBY-L210-60S product versions. The AT command can be issued over the USB or the UART (if supported) interface of the module. On receiving the AT+UFWUPD command, the module: 

Starts the Xmodem-1k protocol and waits for data on the channel where the command has been sent.



Sends the waiting characters to the host terminal via the AT interface: up to ten “C” (0x43) characters and up to ten (0x15) characters. Each character is sent with a 10 s timeout after the last one. The total timeout is 200 s. This is the time during which the host terminal must send TX data.

UBX-13001845 - R13

Early Production Information

FOAT – Firmware update Over AT commands Page 15 of 39

Cellular Module Firmware Update - Application Note

If data is sent while the “C” character is coming, the protocol uses the CRC method to detect transmission errors, otherwise the standard CHECKSUM method is used. Then it is possible to download the new module image via the Xmodem-1k protocol using a standard terminal program without flow control (e.g. with a PC environment HyperTerminal with these settings: Frame format 8N1, HW flow control active, baud rate configurable, power saving disabled).Intra-character timeout is 1 s, (after receiving first valid data from the host). Maximum errors allowed (timeout, bad data) is 10, after that Xmodem exit with this string: ERROR1 On TOBY-L2 "00", "01", "50" and "60" product versions and MPCI-L2 "00" and "60" product versions if 10 errors are provided, the Xmodem exits with these strings: "too many errors; giving up" ERROR1 Once the update file has been downloaded, if the parameter is provided correctly (32 hex digits), then the MD5 check is performed. If the parameter is provided incorrectly (less digits, more digits, or at least one non-hex digit), then the download will not be started, the module will exit from Firmware Update Mode, and the current firmware will be started. A proper error result code will be issued on the same channel where the command has been sent. When a firmware update is triggered, the host processor can choose either the Xmodem-1k protocol (1024 bytes packets) or Xmodem protocol (128 bytes packets). The module sends an character (0x04) via the terminal for notifying the end of the download.   

At the end of the download procedure, the module reboots and starts the update process, which will take about 1 minute. No messages are issued on the terminal during this phase. When the module reboots, the USB will be detached, and attached again at the next boot in Firmware Update Mode (with the same USB CDC–ACM enumeration of operative mode). The USB port will be ready within 60 s after reboot. The user must connect again with the USB CDC–ACM port. At the end of the update process the module reboots again with the new firmware installed and the NVM and profile parameters set to factory-programmed values. The Xmodem protocol handles the errors (data corruption, data loss etc.) internally during the update phase. In case of power loss during the update phase, at the next module wake-up a fault is detected and the module remains in Firmware Update Mode expecting the upload to restart from Xmodem handshake. If the FW download ends with an ERROR1 condition, the module exits from Firmware Update Mode and returns to normal mode since the FW is still unchanged and usable (FW not corrupted by previous download process) If the module does not receive any data from the host terminal after the tenth s, then the module will exit from Firmware Update Mode and return to normal mode. Since the FW is unchanged and still usable, ERROR1 is issued from the module to indicate: FW not corrupted by previous update process.

On the USB interface this performance is provided:   

Speed: ~500 kB/s Time to download update.zip: ~6 minutes Time to perform the update: ~1 minute

UBX-13001845 - R13

Early Production Information

FOAT – Firmware update Over AT commands Page 16 of 39

Cellular Module Firmware Update - Application Note

4.1.2 Error result codes Response

Description

ERROR1 too many errors; giving up

General error. The operation has been interrupted before starting to write in flash, the current FW is unchanged; the module exits Firmware Update Mode and starts the current FW

bad block ones compl

Block number error

unexpected block no, #num, expecting #num1

Unexpected block number

crc error, expected num, got num1

Crc error

checksum error, expected num, got num1

Checksum error

md5 not matching, update failed

Download has been done correctly but the md5 calculated from the downloaded file does not match the one provided in the command.

ERROR1

The module exits Firmware Update Mode and starts the current FW

short md5, update failed

md5 provided in the command is shorter than expected.

ERROR1

Download is not started. The module exits Firmware Update Mode and starts the current FW

long md5, update failed

md5 provided in the command is longer than expected.

ERROR1

Download is not started. The module exits Firmware Update Mode and starts the current FW

md5 with no hex digits, update failed

md5 provided in the command has at least one non-hex digit.

ERROR1

Download is not started. The module exits Firmware Update Mode and starts the current FW

missing md5, update failed ERROR1

md5 ins missing from provided AT command. The update is not started. The module exits Firmware Update Mode and starts the actual FW

4.2 AT command description for LEON-G/SARA-G/LISA-U/SARA-U series Depending on the firmware update type to perform, a file in .FLS or in .DFFS format is needed. 

The file in .FLS format includes all the needed parts for the FW, NVM and profile update



The file in .DFFS format includes all the needed parts for the File System update LEON-G, SARA-G3, SARA-U2 and LISA-U2 series (except for LISA-U2x0-x1S and previous versions) allow updating the File System using only the file in DFFS format. It is not possible to update the firmware using a peripheral where the multiplexer is enabled.

On receiving the AT+UFWUPD command, the module: 

Resets, restarts and switches to Firmware Update Mode



Configures the serial port at the new baud rate (if any)



In case of FOAT over USB, the module will be detached after sending the command (because of reset), and attached again at the next boot in Firmware Update Mode (with the same USB CDC–ACM enumeration of operative mode). USB port will be ready within 5 s after the command issued. User must connect again with the USB CDC–ACM port.



Sends the IRC +UFWUPD: ONGOING command to the host terminal via the AT interface, followed by up to three “C” (0x43) characters and up to ten (0x15) characters. The first three “C” characters are sent with a 3 s timeout after the last one, next characters are sent with a 10 s timeout after the last one. The total timeout is 109 s. This is the timeout within which the host terminal must send TX data

UBX-13001845 - R13

Early Production Information

FOAT – Firmware update Over AT commands Page 17 of 39

Cellular Module Firmware Update - Application Note

If data is sent while the “C” character is coming, the protocol uses the CRC method to detect transmission errors, otherwise the standard CHECKSUM method is used. Then it is possible to download the new module image via the Xmodem protocol using a standard terminal program at the selected baud rate without flow control (e.g. HyperTerminal with these settings: frame format 8N1, HW flow control active, baud rate configurable, power saving disabled). At the end of the procedure, the final response is sent at the baud rate set for the FW update. When the FOAT procedure is completed, the baud rate is set to the current loaded profile of the new FW version. Both IRC and any further final responses are sent at the new baud rate. Only a syntax error in the AT+UFWUPD command triggers an error result code at the original baud rate. LEON-G series requires Xmodem packets to be sent within 50 ms. SARA-G3 series requires Xmodem packets to be sent within 100 ms. LISA-U and SARA-U series require flow control active on the UART interface. If the flow control is disabled, the RTS line must be held to ON state. Table 4 provides an example of the Firmware update Over AT commands procedure. DTE

Cellular module

Description

AT+UFWUPD=0,460800

+UFWUPD: ONGOING

Cellular module response sent at 460800 b/s

CCC

Sent at 460800 b/s: up to 10

Code image using Xmodem 1k protocol sent (at 460800 b/s) to the u-blox cellular module OK

Cellular module response sent at 460800 b/s: the download is complete and the reboot follows. The module is updated to the new FW versions and it is ready to receive further commands.

Table 4: Firmware Over AT commands procedure

UBX-13001845 - R13

Early Production Information

FOAT – Firmware update Over AT commands Page 18 of 39

Cellular Module Firmware Update - Application Note

LEON-G modules send a character (0x18) after 8 MB of data instead of waiting for the character (0x04) from the sender. The character can be interpreted as an ABORT from the module side. LISA-U / SARA-U and SARA-G3 series modules send an character (0x04) via the terminal for notifying the end of the download. On LISA-U / SARA-U series, the response is issued if it reaches the timeout after receiving the first character. Issue a new AT+UFWUPD command for a new FOAT session. In case of power loss during the update, at the next module wake-up a fault is detected and the module remains in Firmware Update Mode, expecting the upload to restart from Xmodem handshake. If the FW download ends with an ERROR condition, the module remains in Firmware Update Mode, expecting the upload to restart from Xmodem handshake (all ERROR condition except ERROR1, described in section 4.2.2). If the module does not receive any data from the host terminal after ten s, then the module will exit from Firmware Update Mode and return to normal mode. Since the FW is unchanged and still usable, ERROR1 is issued from the module to indicate: FW not corrupted by previous update process. If is set to 2, make sure the file contains both the firmware and File System images.

UBX-13001845 - R13

Early Production Information

FOAT – Firmware update Over AT commands Page 19 of 39

Cellular Module Firmware Update - Application Note

Type

Syntax

Response

Example

Set

AT+UFWUPD=[,]

+UFWUPD: ONGOING (sent at new baud rate, if specified)

AT+UFWUPD=0

+UFWUPD: (list of supported s),(list of supported s)

+UFWUPD: (0-2),(57600,115200,23040 0,460800,921600)

OK

OK

Test

AT+UFWUPD=?

IRC

+UFWUPD: ONGOING

+UFWUPD: ONGOING

Table 5: AT+UFWUPD command syntax

4.2.1 Defined values Parameter

Type

Description



Number

Download type



Number



0: firmware image update



1: File system image update



2: firmware and file system image update

Baud rate in b/s 

115200 (default value)



230400



460800



921600

Table 6: AT+UFWUPD parameter description

=1 is not supported by SARA-G300 / SARA-G310 modules. =2 is supported only by LISA-U2 “00”, “01” product versions.

UBX-13001845 - R13

Early Production Information

FOAT – Firmware update Over AT commands Page 20 of 39

Cellular Module Firmware Update - Application Note

4.2.2 Error result codes These icons indicate the products to which the error result codes apply: 

LEON-G



LISA-U



SARA-G



SARA-U

: LEON-G series : LISA-U series : SARA-G series : SARA-U series

Response ERROR1

Product LEON-G

Description LISA-U

SARA-G

The operation has been interrupted before starting to write in flash. The current FW is unchanged and the module exits Firmware Update Mode and starts the current FW.

LISA-U

SARA-G

The operation has been interrupted during FW updating (after starting to write in flash). The current firmware is corrupted and the module remains in Firmware Update Mode.

SARA-U ERROR2

LEON-G SARA-U

ERROR3 ERROR4 ERROR5 ERROR6 FLS header decoding failed

The signature check fails.

LEON-G LEON-G

The module has received an unexpected EOT because not all the expected bytes have been received.

SARA-G

The boot does not support the selected baud rate.

LEON-G

Invalid AT command sent during boot.

LEON-G LEON-G

LISA-U

SARA-G

An error occurs during decoding of file header.

SARA-U Buffer Data Overrun Timeout

LEON-G

SARA-G

LEON-G

LISA-U

Data is sent too slowly.

SARA-G

SARA-U

A

No data is coming. The +UFWUPD command must be re-sent (if the image has not been corrupted by previous update procedures, otherwise update autonomously restarts).

Table 7: AT+UFWUPD error codes

ERROR2 is not sent in LISA-U / SARA-U when an OET has interrupted the firmware update process.

4.2.3 FW update procedure on LISA-U2 series On LISA-U2x0-x1S version it is not possible to use =2 to simultaneously download both firmware image and the flash file system. Follow this procedure to update the firmware version from LISA-U2x0-x1S to LISA-U2x0-x2S versions:

UBX-13001845 - R13

Early Production Information

FOAT – Firmware update Over AT commands Page 21 of 39

Cellular Module Firmware Update - Application Note

DTE

Cellular module

Description

AT+UFWUPD=0

+UFWUPD: ONGOING

Firmware image update

AT+UFWUPD=1

+UFWUPD: ONGOING

Flash File System image update After the firmware image update, the module boots and it will be available to the user after the time needed for the file system formatting (maximum 2 minutes).

Follow this procedure to revert the firmware version from LISA-U2x0-x2S to LISA-U2x0-x1S: DTE

Cellular module

Description

AT+UFWUPD=2

+UFWUPD: ONGOING

Firmware and Flash File System image update

UBX-13001845 - R13

Early Production Information

FOAT – Firmware update Over AT commands Page 22 of 39

Cellular Module Firmware Update - Application Note

5 Firmware install (+UFWINSTALL) 5.1 Introduction See Table 1 for the list of modules and interfaces supporting the firmware install feature. The firmware installation procedure triggers the firmware update installation via AT command, starting from an update file stored in module file system. The +UFWINSTALL command handles the firmware installation procedure. This command could be used as the final part of implementation of FOTA procedure. The update file must be stored in the module file system before starting the firmware update installation procedure. Otherwise an error result code is issued. The procedure to store the update file in the module file system is up to the user via OTA/FTP, or using the +UDWNFILE AT command. The firmware update can be triggered using the following interfaces: 

UART with configurable baud rate (only one port is available)



USB with configurable USB instance

The “OK” final result code notifies that the module correctly received the FW update request and the update process will start immediately thereafter. During the update process, the module cannot be used to make calls, even emergency calls. The update process is fault tolerant, even if the battery is suddenly removed. At the end of a successful installation, the module boots up, NVM and profiles data are set to the factory-programmed values of the new firmware version, and the SIM is reset (the PIN will be required if enabled). See the u-blox AT commands manual [1] for the factory-programmed values.

Do not remove the power supply or reset the module during the installation procedure even if it is fault tolerant! The module will reboot automatically after the end of update procedure.

5.2 AT command syntax for LISA-U2 Type

Syntax

Response

Example

Set

AT+UFWINSTALL=[,[,]]

OK

AT+UFWINSTALL="update.upd",1,1152 00 OK

Test

AT+UFWINSTALL=?

URC

UBX-13001845 - R13

+UFWINSTALL: "filename",(list of supported s),(list of supported s)

+UFWINSTALL: "filename",(0,1,46),(19200,38400,57600,115200,23040 0,460800,921600)

OK

OK

+UUFWINSTALL:

Early Production Information

Firmware install (+UFWINSTALL) Page 23 of 39

Cellular Module Firmware Update - Application Note

5.2.1 Defined values Parameter

Type

Description



String

Update file previously downloaded in module file system. The update file can have different extension.



Number

Serial interface where the progress percentage and information text responses will be sent: 

0: no info will be shown



1: UART interface



4: USB1



5: USB2



6: USB3

If omitted, the command will take as default value for the port where the command is issued.

Number

Available baud rates in b/s: 

19200



38400



57600



115200



230400



460800



921600

When a USB interface is selected, the parameter has no effect in the FW install configuration. If omitted, the command will take as default value for the parameter the baud rate of the port where the command is issued.

Integer

Provides the installation progress from 0 to 100 and update result (see section B).

Store the update file into the module file system before starting the install with +UFWINSTALL. Otherwise the "FFS file not found" error result code is issued. The procedure for FS storing is up to the user (via UFTPC, or +UDWNFILE). When the new FW has been installed, the user can optionally delete the “filename” using the file system AT commands (for more details see u-blox AT command manual [1] +UDELFILE). During the update operations, the +UUFWINSTALL URC displays the progress indication and the result operation on the interface chosen via +UFWINSTALL command. When the FW update is completed, a URC will notify the final result of the operation. The last URC with a value greater than 100 indicates the update operation result (e.g. 128 means operation completed with success). For more details, see the section B. The progression of the installation is incremental, but the URC step can be different from 1. Example with +UDWNFILE: Command

Response

AT+UDWNFILE="Update_FW_90_to_91.upd"

OK

AT+UFWINSTALL="Update_FW_90_to_91.upd",1,115200

OK +UUFWINSTALL: 1 +UUFWINSTALL: 2 +UUFWINSTALL: 3 +UUFWINSTALL: 4 … +UUFWINSTALL: 99 +UUFWINSTALL: 100 +UUFWINSTALL: 128

AT+UDELFILE="Update_FW_90_to_91.upd" UBX-13001845 - R13

OK Early Production Information

Firmware install (+UFWINSTALL) Page 24 of 39

Cellular Module Firmware Update - Application Note

Example with +UFTPC: Prerequisite: an FTP connection is already established (see AT commands examples application note [7] for more details. Command

Response

AT+UFTPC=4,"Update_FW_90_to_91.upd","Update_FW_90_to_91.upd"

OK

AT+UFWINSTALL="Update_FW_90_to_91.upd",1,115200

OK +UUFWINSTALL: 1 +UUFWINSTALL: 2 +UUFWINSTALL: 3 +UUFWINSTALL: 4 … +UUFWINSTALL: 99 +UUFWINSTALL: 100 +UUFWINSTALL: 128

AT+UDELFILE="Update_FW_90_to_91.upd"

OK

5.3 AT command syntax for TOBY-L2 Type

Syntax

Response

Example

Set

AT+UFWINSTALL=

OK

AT+UFWINSTALL=a07a553420 1b2e42dd2d964920e57319

UFWINSTALL REBOOT OK UFWINSTALL REBOOT Test

AT+UFWINSTALL=?

OK

5.3.1 Defined Values Parameter

Type

Description



Number

32 hexadecimal number

After the command is issued, the module reboots and starts the installation process, which will take about 1 minute. No result codes are issued on the terminal during this phase. At the end of the update process the module reboots again with the new firmware installed, NVM parameters and the file system restored to the factory-programmed values. If the parameter is correctly provided (32 hex digits), then a check is done with the update file stored in the module. If the parameter is provided incorrectly (less digits, more digits, or at least one non-hex digit), then the install process will not be started, the module will exit from Firmware Install Mode, and the current firmware will continue to run. A proper error result code will be issued on the same interface where the command has been sent. In case of power loss during the installation phase, at the next module wake-up a fault is detected and the module remains in Firmware Install Mode until the end of the procedure (installation terminated).

UBX-13001845 - R13

Early Production Information

Firmware install (+UFWINSTALL) Page 25 of 39

Cellular Module Firmware Update - Application Note Store the update file into the module cache folder before starting the install with +UFWINSTALL. Otherwise the "update file not found" error result code is issued. The procedure for storing is up to the user by means of +UFTPC AT command. The +UFTPC command for FOTA erases the cache content before storing new update file. Example with +UFTPC: Prerequisite: an FTP connection is already established (see AT commands examples application note [7] for more details. Command

Response

AT+UFTPC=100,"Update.zip"

OK +UUFTPCR: 100,1,a07a5534201b2e42dd2d964920e57319

AT+UFWINSTALL=a07a5534201b2e42dd2d964920e57319

OK UFWINSTALL REBOOT

5.4 Firmware Install specifications 5.4.1 Generation of the “update file” The “Update file” contains the binary differences between the source and target firmware region which is updatable, e.g. all the constant sources. The update file contains the binary data to allow the user to update the FW module. u-blox delivers the “update file” for customers.

5.4.2 Recovery mechanism In case of a firmware update failure (for instance possibly due to power loss or cable detach), the FW installation procedure starts again. In case of FW install failure but the update process has still not written anything in the flash memory, the update procedure stops and runs the old firmware.

5.4.3 Installation performance The installation time depends on the update file size and the section changed in the SW memory map between two SW versions The time to update the firmware can vary and in the worst case is less than 10 minutes.

5.4.4 Limitations Update procedure cannot update the module file system. All the user settings (NVM, profiles) are restored to the factory-programmed values. Calibration data are retained. The file system is restored to the factory-programmed value (see Table 3).

UBX-13001845 - R13

Early Production Information

Firmware install (+UFWINSTALL) Page 26 of 39

Cellular Module Firmware Update - Application Note

Appendix A List of acronyms Abbreviation / Term

Explanation / Definition

API

Application Programming Interface

APN

Access Point Name

AT

AT Command Interpreter Software Subsystem, or attention

CRC

Cyclic Redundancy Check

DOF

Download One File

DTE

Data Terminal Equipment

EEP

EEPROM Emulation Parameters

EEPROM

Electrically Erasable Programmable Read-Only Memory

EOT

End of Transmission

FFS

Flash File System

FOAT

Firmware Over AT commands

FOTA

Firmware Over The Air

FW

Firmware

GPRS

General Packet Radio Service

GSM

Global System for Mobile Communication

HTML

HyperText Mark-Up Language

HTTP

HyperText Transfer Protocol

IMEI

International Mobile Equipment Identity

IMSI

International Mobile Station Identity

IP

Internet Protocol

IRC

Intermediate Result Code

NVM

Non Volatile Memory

PC

Personal Computer

RAM

Random Access Memory

ROM

Read Only Memory

SMS

Short Message Service

SW

Software

TCP

Transmission Control Protocol

UA

Update Agent

UART

Universal Asynchronous Receiver-Transmitter

UPI

Update Installer

URC

Unsolicited Result Code

URL

Uniform Resource Locator

USB

Universal Serial Bus

UA

Update Agent

UBX-13001845 - R13

Early Production Information

Appendix Page 27 of 39

Cellular Module Firmware Update - Application Note

B Firmware Install error result codes B.1 Error result codes for LISA-U2 The +UFWINSTALL command returns an error result code when there is a syntax error or a problem during the installation procedure. Error result code generated due to a syntax error: Verbose description

Numeric code

Description

+CME ERROR: not supported

4

One of the following cases has occurred:

+CME ERROR: FFS file not found

1624

   

wrong serial port number wrong baud rate number of parameters not allowed file name too long



The update file is not stored in FS or the file name is wrong

Error result codes during the install procedure resulting from the +UFWINSTALL command during the installation procedure: Numeric code

Description

128

General Success Code

129

General Failure Code

130

Error in a run parameter

131

Expected length error

132

Structural error

133

Signature error

134

Given RAM is not enough

135

Does not behave as RAM

136

Memory allocation failure

137

Flash writing failure

138

Flash erasing failure

139

Flash reading failure

140

One API function is not declared

141

Backup buffer(s) not sector aligned

142

Start address is not sector aligned

143

File does not exist

144

RO or no access rights

145

File does not exist

146

No access rights

147

Cannot resize file

148

Cannot read specified size

149

Cannot close file handle

150

Failed creating symbolic link

151

Failed creating directory

152

Bad operation number for update

153

Unsupported compression

154

Can not apply reverse update for update not generated as reverse update

155

Number of backup buffers given to UPI does not match number in update file

UBX-13001845 - R13

Early Production Information

Appendix Page 28 of 39

Cellular Module Firmware Update - Application Note

Numeric code

Description

156

Sector size mismatch between UPI and update file

157

UPI was not compiled to support reverse update

158

UPI was not compiled to support IFS on compressed images

159

UPI was not compiled to support IFS

160

Source mismatch in scout only operation

161

There is not enough RAM to run with operation=2 (Dry update)

162

Update file too long - corrupted

163

Mismatch between deletes sig and update deletes buffers signature

164

Number of fragments in section is not 1

165

Over all number of backup sects too big

166

Update file is corrupt: signature mismatch between update header signature and calculated signature

167

File signature does not match signature

168

Signature for the target buffer does not match the one stored in the update file

169

Too many dirty buffers

170

UPI version mismatch between UPI and update file

171

Scout version mismatch between UPI and update file

172

Partition name is different in update and in UPI data

173

There is not enough flash to update or install the files

174

There is not enough backup space on device

175

UPI does not support RW file system update

176

UPI does not support image update

177

Deployment Package header is invalid

178

Deployment Package signature is invalid

179

Deployment Package version is not supported

180

Requested ordinal does not exist in Deployment Package

181

Requested component was not found in Deployment Package

B.2 Error result codes for TOBY-L2 / MPCI-L2 This table lists the allowed error result codes applicable to TOBY-L2 / MPCI-L2: Response

Description

md5 not matching, update failed

The md5 calculated from the stored file is not matching with the one provided in the command. The module exits Firmware Install Mode and starts the actual FW

ERROR3 short md5, update failed ERROR1 long md5, update failed ERROR1 missing md5, update failed ERROR1 md5 with no hex digits, update failed ERROR1 update file not found ERROR1

UBX-13001845 - R13

md5 provided in the command has been detected shorter. The install is not started. The module exits Firmware Install Mode and starts the actual FW md5 provided in the command has been detected longer. The install is not started. The module exits Firmware Install Mode and starts the actual FW md5 in missing from provided AT command. The install is not started. The module exits Firmware Install Mode and starts the actual FW md5 provided in the command has been detected with at least one not hex digits. Install is not started. The module exits Firmware Install Mode and starts the actual FW update file is not found in the specific folder. The install is not started. The module exits Firmware Install Mode and starts the actual FW

Early Production Information

Appendix Page 29 of 39

Cellular Module Firmware Update - Application Note

C FOTA demo application in m-center FOTA (Firmware Over The Air) is a method used for updating the software on connected electronic devices such as mobile phones and tablet computers. The FOTA demo application is implemented in m-center. The purpose of this application is to demonstrate the use of the Firmware Installation feature (+UFWINSTALL). FOTA can be started both via SMS and manually via the m-center dedicated menu. For more details see the m-center User Guide [6]. To use the FOTA demo application on m-center, a PDP context shall already be active.

FTP data received via SMS or edited locally Log showing the events and the operations performed and the errors occurred during FOTA procedures

used by m-center to recognize “FOTA” SMS Tel number sending the “FOTA” SMS Buttons for triggering manually the download and update operation

Progress bar indicating the FW upgrading status

Example of SMS text: : ,,,, FOTADWN: 195.34.89.147:21,u949p4,*****,/data/FOTA,Update_MSY_FW_22.92_to_22.91.ENG0100.upd

UBX-13001845 - R13

Early Production Information

Appendix Page 30 of 39

Cellular Module Firmware Update - Application Note

C.1 FOTA: firmware downloading procedure m-center (application)

LISA-U200

FTP server

User

SMS for FTP download (1) SMS notification AT cmd: read SMS SMS content check SMS

AT FTP cmds: login, file retrieve FTP: login, retrieve FW file Fw .file URC: FW file retrieve check presence of retrieved file

AT cmd: send download ack. SMS (2)

SMS: download ack.

(1) SMS containing FTP parameters (IP address, path, filename, username, password...) (2) SMS containing the name of retrieved file

C.2 FOTA: firmware upgrading procedure m-center (application)

LISA-U200

User SMS for FW update (1)

SMS notification AT command: read SMS SMS content check SMS

AT cmd: start FW update display FW upgrade progress & errors

reset

FW upgrade progress indication AT cmd: check FW update result

FW update process reboot

FW update result AT command: read FW version FW version AT cmd: send upgrade ack. SMS (2) SMS: upgrade ack.

(1) SMS containing the name of the FW file (downloaded in FS), this SMS can be omitted if a “FOTAALL" SMS has been used (2) SMS containing the FW version

UBX-13001845 - R13

Early Production Information

Appendix Page 31 of 39

Cellular Module Firmware Update - Application Note

D FOAT/FWUPDATE on a linux system It is also possible to perform FOAT on a Linux based operating system. The following solution has been tested:  

minicom sx command

D.1 Minicom 1. Open minicom

UBX-13001845 - R13

Early Production Information

Appendix Page 32 of 39

Cellular Module Firmware Update - Application Note 2. Configure the Xmodem protocol to 1K. Open the minicom control panel: press ‘CTRL+A’ then ‘Z’. Open the menu ‘Configure minicom’ (shortcut press ‘O’)

3. Open the menu ‘File Transfer protocols’

UBX-13001845 - R13

Early Production Information

Appendix Page 33 of 39

Cellular Module Firmware Update - Application Note 4. Configure the Xmodem protocol to Xmodem-1K. Add the option ‘-k’ to Xmodem program if not present

5. Start the FOAT update via AT command +UFWUPD

UBX-13001845 - R13

Early Production Information

Appendix Page 34 of 39

Cellular Module Firmware Update - Application Note 6. When it is displayed the information: +UFWUPD: ONGOING CC Now it is possible to start the transfer of the update file: open the menu ‘Send files’, the shortcut is ‘CTRL+A’, then ‘Z’ and ‘S’. Select the file to upload

7. Now the update procedure shall be started

UBX-13001845 - R13

Early Production Information

Appendix Page 35 of 39

Cellular Module Firmware Update - Application Note

D.2 Sx command 

Firstly check if “Sx” is available in the available Linux distribution, otherwise install it. It is possible to check by typing the command “Sx” in a terminal window:



Use the screen command to manage the Linux terminal; in this case assume that ACM0 is the modem port: o Open a terminal o Type: screen /dev/ttyACM0 921600

UBX-13001845 - R13

Early Production Information

Appendix Page 36 of 39

Cellular Module Firmware Update - Application Note

o o o o

Now it is possible to send AT commands to the module. Issue +UFWUPD and wait for “CCC”. Press "CTRL+A" followed by “:”. Now it is possible to issue linux command. Type: “exec !! sx yourfile.zip” and in yourfile.zip specify the full path of the file. This command line will start the Xmodem-1K. The FOAT should have started now.

UBX-13001845 - R13

Early Production Information

Appendix Page 37 of 39

Cellular Module Firmware Update - Application Note

Related documents [1] [2] [3] [4] [5] [6] [7]

u-blox AT Commands Manual, Docu No UBX-13002752 LEON-G series System Integration Manual Docu No UBX-13004888 SARA-G3 series System Integration Manual, Docu No UBX-13000995 LISA-U series System Integration Manual Docu No UBX-13001118 TOBY-L2 series System Integration Manual Docu No UBX-13004618 u-blox m-center User Guide, Docu No UBX-13001925 u-blox AT Commands Examples Application Note, Docu No UBX-13001820

Revision history Revision

Date

Name

Status / Comments

-

12-Apr-2011

lpah

Removed the applicability of the document to LUCY added LISA-U1/H1 s

1

20-Jun-2011

fali

Added description to revert firmware using EasyFlash tool

2

29-Jul-2011

lpah

Removed LISA-H1 series Chapter 3.1: improved description for FW download with EasyFlash

3

09-Jan-2012

dbar, lpah

Extended to include LISA-U2 series. FOAT procedure supported by LISA-U series (except for LISA-U1x0-00 versions) Updated chapter 4 - FOAT procedure

4

22-Jun-2012

lpah

Improve FOAT procedure description

5

02-Aug-2012

dbar

New EasyFlash tool version Added table to indicate the Firmware update procedures allowed on ublox wireless modules cellular modules

6

15-Oct-2012

lpah

Extended to include LISA-U260 / LISA-U270 products cellular modules

7

29-Mar-2013

spun

Extension to include SARA-G3 series Last revision with docu number WLS-CS-11001

A

25-Sep-2013

lpah

Added more details on FOAT procedure on LISA-U2 modules

R10

14-Oct-2013

mvoc

Added section 5. Firmware install (+UFWINSTALL) and FWINSTALL Error Messages Appendix

R11

26-Sep-2014

mvoc

Extended the document to TOBY-L2 and SARA-U2 series

R12

19-Oct-2015

mvoc

Extended the document with +UFWINSTALL command on TOBY-L2 series

R13

04-Apr-2016

mvoc

Extended document applicability to LISA-U201-83S and MPCI-L2

UBX-13001845 - R13

Early Production Information

Related documents Page 38 of 39

Cellular Module Firmware Update - Application Note

Contact For complete contact information visit us at www.u-blox.com u-blox Offices North, Central and South America u-blox America, Inc. Phone: +1 703 483 3180 E-mail: [email protected] Regional Office West Coast: Phone: +1 408 573 3640 E-mail: [email protected]

Headquarters Europe, Middle East, Africa u-blox AG Phone: +41 44 722 74 44 E-mail: [email protected] Support: [email protected]

Technical Support: Phone: +1 703 483 3185 E-mail: [email protected]

Asia, Australia, Pacific u-blox Singapore Pte. Ltd. Phone: +65 6734 3811 E-mail: [email protected] Support: [email protected] Regional Office Australia: Phone: +61 2 8448 2016 E-mail: [email protected] Support: [email protected] Regional Office China (Beijing): Phone: +86 10 68 133 545 E-mail: [email protected] Support: [email protected] Regional Office China (Chongqing): Phone: +86 23 6815 1588 E-mail: [email protected] Support: [email protected] Regional Office China (Shanghai): Phone: +86 21 6090 4832 E-mail: [email protected] Support: [email protected] Regional Office China (Shenzhen): Phone: +86 755 8627 1083 E-mail: [email protected] Support: [email protected] Regional Office India: Phone: +91 80 4050 9200 E-mail: [email protected] Support: [email protected] Regional Office Japan (Osaka): Phone: +81 6 6941 3660 E-mail: [email protected] Support: [email protected] Regional Office Japan (Tokyo): Phone: +81 3 5775 3850 E-mail: [email protected] Support: [email protected] Regional Office Korea: Phone: +82 2 542 0861 E-mail: [email protected] Support: [email protected] Regional Office Taiwan: Phone: +886 2 2657 1090 E-mail: [email protected] Support: [email protected]

UBX-13001845 - R13

Early Production Information

Contact Page 39 of 39