1.17.1 Get Version Command

The GetVersion command does two things. As the first command that is sent to the bootloader, it is used to establish communication with the device. Therefore, if the communications channel is not setup correctly, this command will fail. Secondly, it returns the device information such as:
  - Bootloader version 
  - Max Packet size
  - Device ID
  - Erase page size 
  - Minimum write size
  - Config words 
Get Version Command Format

Field Size

Description

Data Type

Comments

1

Cmd

uint8_t

Command (0x00) - Get Version Command

2

Length

uint16_t

Unused - Set to 0x0000

4

Unlock Seqeunce

uint32_t

Unused - Set to 0x00000000

4

Address

uint32_t

Unused - Set to 0x00000000

 

Get Version Command Response Format

Field Size

Description

Data Type

Comments

1

Cmd

uint8_t

Command (0x00) - Get Version

2

Length

uint16_t

0x0000

4

Unlock Sequence

uint32_t

0x00000000

4

Address

uint32_t

0x00000000

2

Bootloader Version

uint16_t

0x0600 The version of the bootloader

2

Max Packet Size in Bytes

uint16_t

Maximum size of any packet in either direction. This includes all header and payload data

2

Not Used

uint16_t

0x0000

2

Device ID

uint16_t

0x3456(user defined) A generic version number for the user to use

2

Not Used

uint16_t

0x0000

2

Erase Page Size in Bytes

uint16_t

Size of a erase page on the device in bytes including phantom bytes. This will vary from device to device and the value can be found if the device manual.

2

Minimumn Write Size in Bytes

uint16_t

The minimum amount of data in bytes that can be written. This also defines the alignment of the data. So if the min write size is 8, then the data must also be 8 byte aligned

4

Not Used

uint32_t

0x00000000

4

User Reserved Area Start Address

uint32_t

0x00000000 - Currently not supported

4

User Reserved Area End Address

uint32_t

0x00000000 - Currently not supported

 

 

Example Sequence

Get Version Command - All values in Hex

Example command to the device

Field Size

Description

Data Type

Value

1

Cmd

uint8_t

0x00

2

Length

uint16_t

0x0000

4

Unlock Seqeunce

uint32_t

0x00000000

4

Address

uint32_t

0x000000

Example command as viewed on bus: 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00

 

Example Response Sequence

Example reponse from the device

Field Size

Description

Data Type

Value

1

Cmd

uint8_t

0x00

2

Length

uint16_t

0x0000

4

Unlock Sequence

uint32_t

0x00000000

4

Address

uint32_t

0x000000

2

Version

uint16_t

0x1012

2

Max Packet Size

uint16_t

0x0100

2

Unused

uint16_t

0x0000  

2

Device ID

uint16_t

0x3456  

2

Unused

uint16_t

0x0000

2

Erase Page Size in Bytes

uint16_t

0x0800

2

Minimumn Write Size in Bytes

uint16_t

0x0008  

4

User Reserved Start

uint32_t

0x00000000  

4

User Reserved End

uint32_t

0x00000000  

Example response as viewed on bus: 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x01, 0x00, 0x01, 0x00, 0x00, 0x56, 0x34, 0x00, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,