0 firmware update procedure, Firmware update procedure, Stn bootloader – ScanTool STN Bootloader User Manual

Page 8

Advertising
background image

STN Bootloader

Table 8 – Firmware Upload Commands

Command Name

Description

30

StartUpload

Start firmware image upload

31

SendChunk

Send the next firmware image chunk

StartUpload

Start firmware image upload. Every firmware image

upload must be preceded by a StartUpload command.
The StartUpload command packet has the following
format:

<0x30><0x04>[<image size><mode>] 

Table 9 details the data field format of the

StartUpload command.

Table 9 – StartUpload Command Format

Field

Length

(bytes)

Description

<image size>

3

Firmware image size

<mode> 1

Mode. Must be set to
0x01

The response to StartUpload command is a big-

endian 16-bit integer specifying the maximum chunk
size that can be accepted by the bootloader (data
length = 2).

SendChunk

Send the next firmware image chunk. Firmware

chunk length must be a multiple of 16 bytes, and

cannot exceed the maximum chunk size returned by
the StartUpload command. The chunk size can be
varied to achieve the optimum balance between
firmware upload speed, progress granularity, and the
speed of error recovery.

The SendChunk command packet has the following

format:

<0x31><chunk_len+2>[<chunk num><chunk>] 

Table 10 details SendChunk command data field

format.

Table 10 – SendChunk Command Format

Field

Length

(bytes)

Description

<chunk num>

2

Chunk number

<chunk> variable

Firmware image
chunk data

Chunk number is a sequential number assigned to

each chunk. It must be set to 0 for the first chunk and
then incremented by one for each subsequent chunk.

The response to SendChunk command contains

the 16-bit chunk number (data length = 2).

6.0 Firmware Update Procedure

Basic firmware update steps are as follows:

1. Load firmware file header into memory
2. Start bootloader session (Connect)
3. Verify bootloader version (GetVersion).

Proceed only if the major version is 2.

4. Upload each firmware image (see

Appendix A: Firmware File Format for
details):

a. Send

StartUpload command

b.

Send firmware image using
SendChunk commands until all
bytes of the firmware image have
been transmitted

5. Send

GetFWStatus command to verify that

the application firmware was successfully
uploaded

8 of 12

www.obdsol.com STNBLA

Advertising