split PM3_CMD_DATA_SIZE_OLD out of PM3_CMD_DATA_SIZE

The OLD frame size was tied to the NG one, but the bootloader only speaks
OLD - growing PM3_CMD_DATA_SIZE would silently change sizeof(PacketCommandOLD)
and break flashing against every deployed bootrom in both directions.

Pin the OLD structs to their own constant and use it on every OLD path:
reply_old and the OLD receive branch on both sides, the bootrom, and the
flasher's write_block/send_finish_write_cmd, which memcpy into a
PacketCommandOLD using the NG size.

No behaviour change - both constants are 512 and armsrc .text is
byte-identical before and after.
This commit is contained in:
iceman1001 committed 2026-08-30 13:03:53 +02:00
1 parent 50c63690cd
commit 25d958e5e6
5 files changed
+25 -22

No files matched your search

+2 -2
View File
@@ -115,7 +115,7 @@ void SendCommandOLD(uint64_t cmd, uint64_t arg0, uint64_t arg1, uint64_t arg2, c
PacketCommandOLD c = {CMD_UNKNOWN, {0, 0, 0}, {{0}}};
if (len > PM3_CMD_DATA_SIZE) {
if (len > PM3_CMD_DATA_SIZE_OLD) {
PrintAndLogEx(WARNING, "Sending " _RED_("%zu") " bytes of payload is too much for OLD frames, abort", len);
return;
// return PM3_EOUTOFBOUND;
@@ -622,7 +622,7 @@ __attribute__((force_align_arg_pointer))
rx.oldarg[0] = rx_old.arg[0];
rx.oldarg[1] = rx_old.arg[1];
rx.oldarg[2] = rx_old.arg[2];
rx.length = PM3_CMD_DATA_SIZE;
rx.length = PM3_CMD_DATA_SIZE_OLD;
memcpy(&rx.data, &rx_old.d, rx.length);
PacketResponseReceived(&rx);
if (rx.cmd == CMD_ACK) {