3.1 UART Firmware Upgrade Protocol
The UART Firmware Upgrade application uses a predefined communication protocol to exchange data between the PC and host MCU.
The protocol comprises a Guard, Data Size, Command, and Data bytes as shown in the following figure.
- Guard
- The Guard is a constant value 0x5048434D.
- This value provides the protection against spurious commands.
- Host MCU firmware 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 is of 1 byte width.
- Below are the supported commands:
- Unlock (0xA0)
- Data (0xA1)
- Verify (0xA2)
- Reset (0xA3)
- Device Configuration Command (0xA5)
- Firmware Version (0xA6)
- 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.
- Host MCU receives the data in the size of words (4 bytes).
- All data words must be sent in a little-endian (LSB first) format.
Response Codes
After sending a command, the host MCU will respond with a single-character or double-character code. Subsequent commands can only be sent after receiving the response code for the previous command or after a 100 ms timeout with no response.
The valid response codes are as follows:
- OK (0x50)
- Error (0x51)
- Invalid (0x52)
- CRC OK (0x53)
- CRC Failed (0x54)