Вы находитесь на странице: 1из 8

FIRMWARE UPDATE Revision: Page:

R2 1/8
OTA Date:
June 06, 2018

FIRMWARE UPDATE

OTA

© PST 2018
This document is proprietary and confidential. No part of this document may be disclosed in any manner to a third party without
the prior written consent of PST Eletrônica.

Confidential Content PST – DENG


FIRMWARE UPDATE Revision: Page:
R2 2/8
OTA Date:
June 06, 2018

SUMMARY

1 REVISIONS LOG .....................................................................................................................................................3

2 GLOSSARY .............................................................................................................................................................4

3 INTRODUCTION.....................................................................................................................................................5

4 DATA STRUCTURES ...............................................................................................................................................5

4.1 STRUCTURE OF THE FIRMWARE FILE............................................................................................................5

4.1.1 Line types ..............................................................................................................................................5

4.1.2 Firmware structure ............................................................................................................................... 5

4.2 STRUCTURE OF THE MESSAGE......................................................................................................................5

5 MACHINE STATE ...................................................................................................................................................6

5.1 SAD SENDING STATE .....................................................................................................................................6

5.2 EDA SENDING STATE .....................................................................................................................................6

5.3 SSG SENDING STATE (REPEATS N TIMES) .....................................................................................................6

5.4 CCD SENDING STATE .....................................................................................................................................7

5.5 URA SENDING STATE ....................................................................................................................................7

5.6 SOD SENDING STATE.....................................................................................................................................7

6 APPENDIX..............................................................................................................................................................8

7 REFERENCES..........................................................................................................................................................8

Confidential Content PST – DENG


FIRMWARE UPDATE Revision: Page:
R2 3/8
OTA Date:
June 06, 2018

1 REVISIONS LOG

Revision Date Comments Author(s)


R1 08/06/2017 Initial version. Bruno Corsi dos Santos
Message SOD was added.
R2 06/06/2018 Thiago Nascimento
Entire document was revised.

Confidential Content PST – DENG


FIRMWARE UPDATE Revision: Page:
R2 4/8
OTA Date:
June 06, 2018

2 GLOSSARY

GLOSSARY
OTA Over-the-air
SAD Start of Download
EDA Erase Download Area
SSG Send Segment
CCD Check Code Data
URA Update Running Area
SOD Stop of Download

Confidential Content PST – DENG


FIRMWARE UPDATE Revision: Page:
R2 5/8
OTA Date:
June 06, 2018

3 INTRODUCTION
This document describes how update the firmware of tracking devices over-the-air using PST OPEN
Tracking Protocol, which is used for the tracking system (tracking devices, accessories and servers). A file
that represents a firmware issued by PST Electronics to their partners according to a defined format almost
ready to update tracker devices is needed to perform this operation.

4 DATA STRUCTURES
4.1 STRUCTURE OF THE FIRMWARE FILE

A firmware file released by PST Electronics is needed to perform an OTA firmware update. This file holds
all the content to be sent to the tracker device using messages of PST OPEN Tracking Protocol.

4.1.1 Line types

There are 3 (three) types of lines kept inside the firmware file. These lines have the content of some message
to be sent to the tracker during the OTA firmware update process. Each line starts with ‘:’ and is represented
in hex string format. Each line type has the following structure:

Structure of the line


: 2 bytes length, XXXX 1 byte, 92 Variable length firmware data as hex 2 bytes checksum, XXXX
string
: 2 bytes length, XXXX 1 byte, 93 Variable length firmware data as hex 2 bytes checksum, XXXX
string
: 2 bytes length, XXXX 1 byte, 94 Variable length firmware data as hex 2 bytes checksum, XXXX
string

4.1.2 Firmware structure

Many lines of type 0x92, one line of type 0x93 and one line of type 0x94 represent a firmware inside the
file.

4.2 STRUCTURE OF THE MESSAGE

The structure of the generic PST OPEN Tracking Protocol message to be used during firmware update is
presented below:

Application Layer Message


Application Layer Fields SEQ MTP FFD
Size [Bytes] 4 1 variable

All the header fieds (not indicated here) have to be compliant with the PST OPEN Tracking Protocol. This
document will describe how to create the fields SEQ, MTP and FFD that is inside Application Layer
Message.

Confidential Content PST – DENG


FIRMWARE UPDATE Revision: Page:
R2 6/8
OTA Date:
June 06, 2018

5 MACHINE STATE
The server application must implement a machine state that has two states that prepares the tracker device
to the start the firmware update process followed by a set of other states that transfers data to the tracker
device and two final states that checks the firmware transfer and performs the update. Each state generates
a generic and unique message to the tracker device and keeps a sequencer for matching received SEQ inside
acknowledge ACK messages. The process is moved ahead from an old state to a new one when an
acknowledge ACK message is received, the SEQ matches the one of the message sent by that state and the
message source type MST of the acknowledge message ACK matches the MTP of message sent during that
state.

5.1 SAD SENDING STATE


This state starts the update process and a message must be built as shown below:

Application Layer Message (0x0E)


Application Layer Fields SEQ MTP FFD
Detailed Fields Content * 0x0E IP1 PT1
Size [Bytes] 4 1 4 2

IP1 and PT1 is the endpoint the tracker will connect (or keep connected if it is the same of the current
tracker device connection) to perform the whole firmware update process. For example, 192.168.0.1:1234
would be represented by 6 bytes (C0A8000104D2 in hex format).

5.2 EDA SENDING STATE


This state erases the temporary transfer memory and a message must be built as shown below:

Application Layer Message (0x0F)


Application Layer Fields SEQ MTP FFD
Detailed Fields Content * 0x0F 0x0000
Size [Bytes] 4 1 2

This message has not variable content and uses just predefined values as described above.

5.3 SSG SENDING STATE (REPEATS N TIMES)


This state represents each 0x92 line type got from the firmware file and a message must be built as shown
below:

Application Layer Message (0x10)


Application Layer Fields SEQ MTP FFD
from firmware file lines of type 0x92
Detailed Fields Content * 0x10 (except the first 0x92 byte and two final
checksum bytes)
Size [Bytes] 4 1 variable

Confidential Content PST – DENG


FIRMWARE UPDATE Revision: Page:
R2 7/8
OTA Date:
June 06, 2018

The content of FFD field in this message must be got from firmware file lines of type 0x92 and must
exclude the first 0x92 byte and also the two final checksum bytes. As the firmware file has n lines of type
0x92, a firmware update process will have hundreds of such “state” repetition and a unique sequencer will
represent each state.

5.4 CCD SENDING STATE


This state represents a 0x93 line type got from the firmware file and a message must be built as shown
below:

Application Layer Message (0x11)


Application Layer Fields SEQ MTP FFD
from firmware file lines of type 0x93
Detailed Fields Content * 0x11 (except the first 0x93 byte and two final
checksum bytes)
Size [Bytes] 4 1 variable

The content of FFD field in this message must be got from firmware file lines of type 0x93 and must
exclude the first 0x93 byte and also the two final checksum bytes.

5.5 URA SENDING STATE


This state represents a 0x94 line type got from the firmware file and a message must be built as shown
below:

Application Layer Message (0x12)


Application Layer Fields SEQ MTP FFD
from firmware file lines of type 0x94
Detailed Fields Content * 0x12 (except the first 0x94 byte and two final
checksum bytes)
Size [Bytes] 4 1 variable

The content of FFD field in this message must be got from firmware file lines of type 0x94 and must
exclude the first 0x94 byte and also the two final checksum bytes.

5.6 SOD SENDING STATE


This state should not be used in a normal update process. This state stops the update process (if the
server needs to do that for any reason) and a message must be built as shown below:

Application Layer Message (0x13)


Application Layer Fields SEQ MTP
Detailed Fields Content * 0x13
Size [Bytes] 4 1

The FFD field does not exist in this message.

Confidential Content PST – DENG


FIRMWARE UPDATE Revision: Page:
R2 8/8
OTA Date:
June 06, 2018

6 APPENDIX
Follow the content of three sample lines showing which bytes must be used to build the messages (two
SSG state messages followed by one CCD and one URA):

:010A92FFC5C94FCDCD13890212309B212455AD443676BF67CBAE42BFD98D509CEFE866F9FDC
B74DA83220A3391011810A7642E75B5473C564ABEC3AF589DD18C6EF8E7E97CDBF5CA02328B2
3101199002674AF653457BD46CD33C5494C58D76A5E7BE10F681EF32C7A3D8DC504D49FE616F
7A9832092BBA032B14459CD48567ADF6B601FE90E723CFB2D0CD585C41EF697E72893A1823AB
0B3A1C7684E79D54B5C5AE32E6A3FF10D781C8FE406F59DC714D6ABA222B3B98130904678CF6
9545BDD4A623EEB2F701DF90C0EF487E51CD795C62AB2A3A33891B180C10B481AD3285A39E54
D6C5CF76E7E7F898700969BA412B5ADC124D0BFE236F3401BC90A5238DB29645DED4C767EB57
E805A
:00F692EB3A36B1323290F7687E79E54B6C5AD32E5A3FC10D481C3CD5B5C42EF6A7E71893918
20AB083A17459FD48667AEF6B501FD90E423CCB2DBDC534D4AFE626F7998310928BA002B1F54
97C58E76A6E7BD10F581EC32C4A3D2E3396AF32E6372FB83670AC3A605E3A1E306EA13212813
160E2227106AD122E30A2B932126131C237333212BF32122632332221F75A313AF35B313A175
E313A6358313A1359313AB5361E3774EC313ABE4A362D36C23A3032BCF4313A6649363A31720
2352D49313A365C5D5C5737223732326A9D3212000660BE3A60C6222231BA98321256422D8A5
424372F963640CD33323633CDCD3535CDB1995F4E
:001D93BBB383B3B3B15C5E41F8B3A6DB3C870C3E99245E0D1C06B747DE0D12
:001D9441F8BBB383B3B3B15C5EB3A6DB3C870C3E99245E0D1C06B747DE0D13

7 REFERENCES

• Tracking Protocol: PST OPEN.

Confidential Content PST – DENG

Вам также может понравиться