Skip to content

Instantly share code, notes, and snippets.

@zeldin
Last active August 26, 2018 13:42
Show Gist options
  • Save zeldin/8418c17f489c2240c2cb9cb900bcb4c3 to your computer and use it in GitHub Desktop.
Save zeldin/8418c17f489c2240c2cb9cb900bcb4c3 to your computer and use it in GitHub Desktop.
DK5Q firmware upload format
FW upload starts with a packet of type 8:
byte 0 : 00
byte 1 : 08 = FW upload start command
byte 2 : 03 = packet sequence number
byte 3 : 01 = upload protocol version? Must be 1
byte 4-5 : 00 00 = total number of bytes (16-bit little endian), 0 means 64K (max size)
byte 6-7 : 7e 04 = total number of data blocks (16-bit little endian)
byte 8-9 : 00 00 = ? (not used)
byte 10: 39 = bytes of flash data per data block (decimal: 57) (not used)
byte 11: d1 77 = ? (fw checksum?) (not used)
byte 62-63: checksum
Then follows the indicated number of data blocks as packets of type 9:
byte 0 : 00
byte 1 : 09 = FW upload data command
byte 2 : 93 = packet sequence number
byte 3-4 : 8c 03 = block number (16-bit little endian), first block is #0
byte 5-61 : flash data payload (57 bytes)
byte 62-63: checksum
Each packet of 57 bytes is flashed at address 0x08000000 + block_num*57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment