Skip to content
This repository has been archived by the owner on Jan 17, 2025. It is now read-only.

Commit

Permalink
swapped length field byte order in write flash packet, fixes mistake …
Browse files Browse the repository at this point in the history
…in write flash packet (size field) #41
  • Loading branch information
whosmatt committed Jun 13, 2024
1 parent 72eecd0 commit dd74d95
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion js/tool_patcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ function flash_generateCommand(data, address, totalSize) {
const length_msb = 0x01;
const length_lsb = 0x00;

return new Uint8Array([0x19, 0x5, 0xc, 0x1, 0x8a, 0x8d, 0x9f, 0x1d, address_msb, address_lsb, address_final_msb, address_final_lsb, length_msb, length_lsb, 0x0, 0x0, ...data]);
return new Uint8Array([0x19, 0x5, 0xc, 0x1, 0x8a, 0x8d, 0x9f, 0x1d, address_msb, address_lsb, address_final_msb, address_final_lsb, length_lsb, length_msb, 0x0, 0x0, ...data]); // notice the inconsistent byte order as observed in the official updater tool
}

// function to flash the firmware file to the radio
Expand Down

1 comment on commit dd74d95

@qrp73
Copy link

@qrp73 qrp73 commented on dd74d95 Jul 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I analyzed official updater code and it appears that both variants are incorrect, see packet structure here for details: https://github.com/qrp73/K5TOOL/blob/main/Packets/PacketFlashWriteReq.cs

K5TOOL now has fixed packet structure to be compatible with official updater.

Please sign in to comment.