Self-Implement the SoftLoad process
This method is appropriate for users with deeply embedded systems and that want to customize the firmware updating process to their application. C++ source code is available to provide example code of processing S-Records and converting them to NovAtel format commands.
Contact Customer Support at novatel.com/support and ask about the srec2softload utility. The C++ source code can then be customized to your application.
SoftLoad Commands and Logs
Command |
Description |
---|---|
Initiate a new SoftLoad process |
|
Send an S-Record to the receiver for the SoftLoad process |
|
Send firmware image data to the receiver for the SoftLoad process |
|
Complete the SoftLoad process |
|
Send configuration information to the receiver for the SoftLoad process. This command is not required when working with a *.shex file |
|
Load a firmware image that has been loaded onto the internal storage of the receiver. |
Log |
Description |
---|---|
Provides status updates for the ongoing SoftLoad process |
Each command and log can be used in abbreviated ASCII, ASCII or binary format, with the exception of SOFTLOADDATA, which should only be used in binary format.
File Types
Firmware data is stored in *.shex files as ASCII data in the form of S-Records, based on the Motorola S-Record format. The *.shex file includes a digital signature for the firmware.
Working With S-Records
Each S-Record has a header indicating the type of information contained in the record.
Records beginning with S0, S5 and S7 contain metadata about the firmware image, such as version information and which card types are supported by the firmware image.
Example S0 Record
S0~V~OM7MR0400RN0000
Example S5 Records
S50000
S503D9FE25
S5033158D5A
Example S7 Records
S70000
S70500000000FA
Records beginning with S3 contain the actual firmware image data. Aside from the header, each pair of characters forms the ASCII representation of a binary byte. The format is as follows:
S3 |
LL |
AAAAAAAA |
DDDDDDDD...DDDDDDDD |
CC |
|
|
|
|
|
Check Sum |
|
|
|
Little Endian Data. These bytes are copied into the "data" field of the SOFTLOADDATA command |
|||
|
4 - Byte Address. Set this as the value of "offset" in the SOFTLOADDATA command |
||||
|
Length. This is the hexadecimal number of character pairs to follow in the record. This value minus 4 bytes for the address and 1 byte for the check sum is copied into the "data length" field of the SOFTLOADDATA command |
||||
Header |
Sending Firmware Data
The SOFTLOADSREC and SOFTLOADDATA commands can be used to send firmware data from *.shex files to the receiver.
S0, S5 and S7 S-Records should be sent directly to the receiver using the SOFTLOADSREC command, by enclosing the S-Record in quotation marks and issuing the command to the receiver, as follows:
SOFTLOADSREC "<S-RECORD>"
S3 records can be sent individually to the receiver using the SOFTLOADSREC command. Alternatively, the data from an S3 record can be parsed and packaged together with data from other S3 records into a binary SOFTLOADDATA command. Packaging data parsed from multiple S3 records into a binary SOFTLOADDATA command can result in improved firmware update times as each S3 record contains only a small number of bytes of firmware data. A single SOFTLOADDATA command can package up to 4096 bytes of firmware data from multiple S3 records, whereas a single SOFTLOADSREC command contains a maximum of 28 bytes of firmware data from a single S3 record.
Multiple S3 records can be packaged into a single SOFTLOADDATA command as long as the data from one S3 record follows immediately after the previous record. That is, the address from the current S3 record must equal the address from the previous S3 record plus the data length of the previous S3 record. If the data is not consecutive then the SOFTLOADDATA command can be sent with the amount of data it has packaged up to that point. Subsequent data can be packaged in a new SOFTLOADDATA command. Within the SOFTLOADDATA command, the "offset" field remains the address of the first S3 record and the "data" and "data length" are updated to include the new data.
The *.shex file data may contain many gaps and jumps. For example, in many NovAtel *.shex files, data for address 0x000_00000 is stored near the very end of the file.
Example Packaging Multiple S3 Records In A SOFTLOADDATA Command
Start a new SOFTLOADDATA command
S32100407AD48FCA63034B80F5CE0C36507DE3D8DCC0C6C0C00515D74BCACF2F2949E1
Address: 0x00407AD4 Num Data Bytes: 0x21 – 0x01 – 0x04 = 0x1C
S32100407AF04CCA4985F0F7B081E41D9B7D806C26989AE2D4E4CCBCB47C10FBFD3E43
Previous Address + Previous Num Bytes = 0x00407AD4 + 0x1C = 0x00407AF0
Address: 0x00407AF0 Num Data Bytes: 0x1C
Add data to existing SOFTLOADDATA command
S30D00407B0CDE0400A6374D5BFFC5
Previous Address + Previous Num Bytes = 0x00407AF0 + 0x1C = 0x00407B0C
Address: 0x00407B0C Num Data Bytes: 0x0D – 0x01 – 0x04 = 0x08
Add data to existing SOFTLOADDATA command
S3210000000007F0A7F1F4060000147B4000F49217813C7BB00014493F005C00000009
Previous Address + Previous Num Bytes = 0x00407B0C + 0x08 = 0x00407B14
Address: 0x00000000 Num Data Bytes: 0x1C
Requires new SOFTLOADDATA command because address does not match previous address + previous number of data bytes
Send existing SOFTLOADDATA command, and start a new SOFTLOADDATA command
S3210000001C80040000E001000030000000082B0100D8060000E4060000C806000063
Address: 0x0000001C Num Data Bytes: 0x1C
Previous Address + Previous Num Bytes = 0x00000000 + 0x1C = 0x0000001C
Add data to existing SOFTLOADDATA command
The SOFTLOADDATA command must be sent as a NovAtel binary format command.
SoftLoad Update Method
This section describes the sequence of commands that are issued to the receiver when updating using a *.shex file.
The response for each command must be processed before sending the next command so as to determine if the command was accepted or rejected, and to wait for the receiver to complete the operation. Responses to SoftLoad commands are guaranteed to be output from the receiver within a specific time, which varies by command. Refer to specific SoftLoad command for more information on responses and the timeout values for SoftLoad commands.
-
Open a connection to any port on the receiver (COM, USB or ICOM) with the input and output INTERFACEMODE set to NOVATEL.
-
Request the SOFTLOADSTATUS log using the following command:
LOG SOFTLOADSTATUSA ONCHANGED
-
Initialize SoftLoad with a SOFTLOADRESET command. This command stops all tracking on the receiver to ensure sufficient memory is available for the loading process. An RXSTATUSEVENTA log reports a SoftLoad In Progress status.
-
Open the *.shex firmware file.
-
Read each line of the *.shex firmware file.
-
Send S0, S5 and S7 S-Records directly to the receiver using the SOFTLOADSREC command. The S‑Record must be enclosed in quotation marks:
SOFTLOADSREC "<S-RECORD>"
Data within S0 records can also be sent to the receiver by converting them to SOFTLOADSETUP commands. Refer to the SOFTLOADSETUP command for details on how to convert from S0 S-Records to SOFTLOADSETUP commands. -
S3 S-Records should be parsed and packaged into a SOFTLOADDATA command.
-
-
Send the SOFTLOADCOMMIT command after all data from the *.shex file has been transferred to the receiver. The SOFTLOADSTATUS log reports the status of the loading process. Wait for a SOFTLOADSTATUS log to indicate the status is COMPLETE. The COMPLETE status or an error is guaranteed to be output from the receiver within 300 seconds from the time the SOFTLOADCOMMIT command was received by the receiver.
-
Send the auth code for the newly downloaded image using the AUTH command. This is only required if there is not already a signature auth code on the receiver as signature auth codes are maintained through a SoftLoad update. See Authorization Code for details on Auth Codes.
AUTH ADD_DOWNLOAD <AUTH CODE>
-
Reset the receiver using any of the following methods:
-
Enter the RESET command
-
Enter the FRESET command
-
Power-cycle the receiver
-
Once the receiver resets, the new version of firmware is active.
The SoftLoad process can be safely canceled at any time using the SOFTLOADRESET command or by otherwise resetting the receiver. Once the COMPLETE status is reported by SOFTLOADSTATUS, the new firmware image will be run after the receiver is reset.
SoftLoad Errors
It is possible for errors to occur during the SoftLoad update. All command responses should be checked to verify all issued commands were accepted. The SoftLoad status should also be monitored in the SOFTLOADSTATUS log. Any status enum value greater than the ERROR status indicates an error has occurred during the SoftLoad update. In the event of an error, the SoftLoad update should be restarted by issuing a SOFTLOADRESET command or normal operation can be restored by resetting the receiver.
In rare cases after a SoftLoad error, the boot code may not be able to determine which is the latest firmware to be executed. To protect against this, SoftLoad does not erase the previous valid firmware image from flash on the receiver. In such cases, the boot code will execute the old image and raise the "Safe Mode" error (see RXSTATUS log). If that error is detected, simply restart the SoftLoad process to reload the new firmware image and the error will be resolved.