1.17.5 Checksum Command

This command will cause the device to perform a checksum and return the results. The specific checksum will depend on the device and the algorithm used.

 

NOTE: Supporting this command is discouraged and is disabled by default in the MCC Bootloader UI. It is recommended that designs use the SELF_VERIFY command for integrity checking instead. This command can be used to read out the contents of the device memory even if the Read command is disabled. It is also a weak form of integrity check. The SELF_VERIFY command can provide more robust integriy and authenticity checks without leaking the device memory.  

 

NOTE: The maximum size for the checksum check is 64KB. When validating larger memory ranges, multiple checksum command requests are required.  

Field Size

Description

Data Type

Comments

1

Cmd

uint8_t

Command (0x08) - Calculate and Read Checksum of Program Memory

2

Length

uint16_t

Length of the range to be used for the calculation.

4

Unused

uint32_t

4

Address

uint32_t

The start address where to start the checksum. This should be aligned to a PC instruction address in the hex address space. This address is twice the PC address found in the datasheets but match the addresses found in the .hex files.

 

Checksum Command Response Format:

Field Size

Description

Data Type

Comments

1

Cmd

uint8_t

Command (0x08) - Calculate and Read Checksum of Program Memory

2

Length

uint16_t

Length of the range to be used for the calculation.

4

Unused

uint32_t

4

Address

uint32_t

The start address where to start the checksum. This should be aligned to a PC instruction address in the hex address space. This address is twice the PC address found in the datasheets but match the addresses found in the .hex files.

1

Status

uint8_t

Status of Command
  • 0x01 Success

  • 0xFF Unsupported command

  • 0xFE Invalid Address

2

Checksum

uint16_t

Checksum of the requested memory range.

 

Example command to the device

Field Size

Description

Data Type

Value

1

Cmd

uint8_t

0x09

2

Length

uint16_t

0x0000

4

Unlock Seqeunce

uint32_t

0x00000000

4

Address

uint32_t

0x00000000

Checksum Example Response Command

Example reponse from the device

Field Size

Description

Data Type

Value

1

Checksum command

uint8_t

0x09

2

Length

uint16_t

0x0000

4

Unlock Seqeunce

uint32_t

0x00000000

4

Address

uint32_t

0x00000000

1

Status

uint8_t

0x01 (Success)

2

Checksum Result

uint16_t

0x55AA

Example as viewed on bus: 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xAA, 0x55