Appendix a: firmware file format, Appendix a, Firmware file format – ScanTool STN Bootloader User Manual
Page 9: Stn bootloader

STN
Bootloader
Appendix A: Firmware File Format
Firmware images to be used with STN Bootloader
are released as binary files with a .bin extension. The
STN firmware file format is detailed in this section.
The current file version is 5. If any other file version
is detected, you should abort the upload, because the
firmware will not be compatible with the file layout
described in this document. Table 11 describes STN
firmware file structure. All multi-byte values are big-
endian.
Table 11 – Firmware File Structure
Field
Size
(bytes)
Description
Signature 6
File signature (ASCII
STNFWv)
Version 2
File version (ASCII
05)
Device ID Count
1
Size of device IDs array
Device IDs Array
[Dev ID Count] * 2
Device IDs of compatible devices that can
be programmed with this firmware
FW Image Descriptors Count
1
Size of firmware descriptors array (see
Table 12)
File Header
FW Image Descriptors Array
[FW Image Desc Count] * 12
Optional firmware descriptors array
Firmware images, specified by firmware
image descriptors
FW Images
Variable
Table 12 – Firmware Image Descriptor Format
Field Length
(bytes)
Description
Image Type
1
Firmware image type (see Table 13)
Reserved 1
Next firmware image to upload. 0xFF means there are no more images to
upload.
Next FW Index
1
Error FW Index
1
Firmware to upload on error. Used only for images of ‘Validation’ type.
Image Offset
4
Absolute file offset to beginning of firmware image
Image Size
4
Size of firmware image in bytes
Table 13 – Firmware Image Types
FW Image Type
Value (hex)
Description
Normal 00
Go to [Next FW Index] on success, handle all errors normally (ignore
[Error FW Index]
)
Go to [Next FW Index] on success; if connection is lost, reconnect,
then continue with the [Next FW Index]; if device comm error occurs,
send ResetDevice command, reconnect, then continue with the [Next
FW Index];
handle all other errors normally (ignore [Error FW
Index]
)
Normal, Tolerate Errors
01
Validation 10
Go to [Next FW Index] on success, go to [Error FW Index] on
Validation error, handle all other errors normally
STNBLA www.obdsol.com 9 of 12