Checksums
[verified]: algorithm taken from the boot code and confirmed against every dump. The program CRC matches on all 10 full dumps (F000 and EF00), the calibration CRC on 8 of 10 (the two failures are bad community files, see Variants), and the boot CRC on all 5 dumps that contain the boot sector.
Algorithm: CRC-16/ARC (reflected polynomial
0xA001, init0x0000, no final XOR, LSB-first table at0x3D20), stored big-endian.Descriptor record (16 bytes, table at
0x14200; boot fallback0x3D00; terminated byid = 0xFF):+0 u8 id +1 u8 group records with the same group chain one running CRC +2 u16 mask result bitmask (boot 0x6, program 0x5, cal 0x3) +4 u32 start +8 u32 max_end +12 u32 ptr *(u32*)ptr = V; data covered is start..min(V-1, max_end); the stored CRC word is at V (for the group's last record)Resulting checks (F000 family):
| Group | Covered | Stored at |
|---|---|---|
| boot (0) | 0x00000–0x03F45 | 0x03F46 |
| program (1) | 0x10000–0x14453 + 0x144D0–0x3755F (one running CRC) | 0x37560 |
| calibration (3) | 0x08040–0x0FFF9 | 0x0FFFA |
The loop processes 16 KB slices and services the watchdog between them. The walker returns a bitmask whose cleared bits identify the failing region.
Practical consequence: any map edit changes the calibration CRC. Recompute it before flashing:
bashpython3 -I bms46_checksum.py edited.bin # verify python3 -I bms46_checksum.py edited.bin --fix # rewriteThe tool handles full and partial dumps and refuses byte-swapped files.
Other validity checks the boot code performs (0x3002, 0x30E8, 0x34FA, 0x3656)
- Program present:
*(u32*)0x10000 != 0xFFFFFFFFand*(u32*)0x3FFFC == 0x55FFAA00. - Calibration present:
*(u32*)0xFFFC == 0x0055FFAA(with the0x8000marker logic above). - Compatibility: cal ident
0x8010vs program ident0x3FCB0(first 6 chars, then 2 at +8). - Kennung: cal
0x8040vs program0x14040; CondComp0x14090must equal"SINGLE BOARD"or"NO SINGLE BOARD"from boot0x3696/0x36A6.
Changing the ident or Kennung bytes will therefore make the cal "incompatible" even with a correct CRC.
Tool
bms46_checksum.py (Python 3, no dependencies) verifies and fixes all three CRCs in full or partial dumps, and un-swaps byte-swapped files:
python3 bms46_checksum.py dump.bin # verify
python3 bms46_checksum.py dump.bin --fix # rewrite stored CRCs
python3 bms46_checksum.py swapped.bin --unswap natural.bin