Patch the flash checksum into the composed Arrow delete tunes
The composed .hex files were missing a valid flash checksum entirely (checksum.py flagged MISMATCH on both) -- not flash-ready as committed. Patches the checksum in-place for both, and fixes compose_arrow_delete.py to patch it automatically on future regenerations instead of leaving it as a manual follow-up step. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FP2GaxS9HkUdL5sLBnjKje
This commit is contained in:
@@ -38,6 +38,7 @@ from __future__ import annotations
|
|||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
import checksum
|
||||||
from decode_map import decode, encode
|
from decode_map import decode, encode
|
||||||
from toggle_devices import SAI, O2_1, O2_2, repack, unpack
|
from toggle_devices import SAI, O2_1, O2_2, repack, unpack
|
||||||
|
|
||||||
@@ -77,6 +78,11 @@ def compose(arrow_raw: bytes, stock_after_raw: bytes, delete_raw: bytes) -> tupl
|
|||||||
f" (byte {before} -> {after})"
|
f" (byte {before} -> {after})"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
before_sum = checksum.stored(bytes(arrow_rom))
|
||||||
|
checksum.patch(arrow_rom)
|
||||||
|
after_sum = checksum.compute(bytes(arrow_rom))
|
||||||
|
notes.append(f"checksum: stored {before_sum:04x} (stale) -> patched {after_sum:04x}")
|
||||||
|
|
||||||
repacked = repack(arrow_dec, bytes(arrow_rom), positions)
|
repacked = repack(arrow_dec, bytes(arrow_rom), positions)
|
||||||
out = encode(repacked)
|
out = encode(repacked)
|
||||||
assert decode(out) == repacked, "round-trip failed"
|
assert decode(out) == repacked, "round-trip failed"
|
||||||
@@ -101,8 +107,9 @@ def main() -> int:
|
|||||||
for n in notes:
|
for n in notes:
|
||||||
print(" ", n)
|
print(" ", n)
|
||||||
print(f"wrote {out_path} ({len(out)} bytes)")
|
print(f"wrote {out_path} ({len(out)} bytes)")
|
||||||
print("NOTE: flash checksum not patched -- not known to be flashable as-is.")
|
|
||||||
print("NOTE: main VE fuel-table overlap (~1340 bytes) still unresolved -- see COMMUNITY_TUNING.md.")
|
print("NOTE: main VE fuel-table overlap (~1340 bytes) still unresolved -- see COMMUNITY_TUNING.md.")
|
||||||
|
print("NOTE: only device flags + 2 idle-CO trim bytes are composed -- the main")
|
||||||
|
print(" running-range VE fuel tables are untouched stock-Arrow calibration.")
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user