2.2 UART Bootloader Protocol
The bootloader firmware communicates with the personal computer host application by using a predefined communication protocol to exchange data between the Harmony v3 bootloader framework and the host.
The UART bootloader protocol comprises of a Guard, Data size, Command, and Data bytes as shown in the following figure.
The protocol details are as follows:
- GUARD
- The Guard is a constant value: 0x5048434D
- This value provides protection against the spurious commands
- Bootloader always checks for the Guard value at the start of packet reception, and proceeds further accordingly
- Data Size
- This field indicates the number of data bytes to be received
- This value varies for different commands
- Command
- Indicates the command to be processed. Each command width is one Byte
- The following commands are
supported:
- Unlock (0xA0)
- Data (0xA1)
- Verify (0xA2)
- Reset (0xA3)
- Bank Swap and reset (0xA4)
- Data
- Contains the actual data to be processed based on the command
- Length of the data to be received is indicated by a Data Size field
- Bootloader receives the data in size of words (4 bytes)
- All data words must be sent in a little-endian (LSB first) format
Response Codes
The bootloader will send a single character response code in response to each command. The sequential commands can only be sent after the response code is received for a previous command, or after a 100 ms timeout without a response.
The valid response codes are as follows:
- OK (0x50) – Command was received and processed successfully
- Error (0x51) – There were errors during the processing of the command
- Invalid (0x52) – Invalid command is received
- CRC OK (0x53) – CRC verification was successful
- CRC Fail (0x54) – CRC verification failed