Skip to content

D890UV: carry the rest of every 128 KB flash half a write lands in (#143) - #160

Merged
ww8l merged 1 commit into
mainfrom
issue-143-d890-flash-halves
Nov 23, 2026
Merged

ww8l merged 1 commit into
mainfrom
issue-143-d890-flash-halves

Conversation

@ww8l

@ww8l ww8l commented Nov 23, 2026

Copy link
Copy Markdown
Owner

Closes #143.

What was found

The AT-D890UV rebuilds a whole 128 KB flash half from only the data a write session sends, the same as the AT-D578UV. This was proven on hardware on 2026-11-22: an identical-bytes write of the erased window 0x02004000 wiped the zone lists at 0x02000000 (same half), and the radio booted to "Program error, please initialize the radio". The radio was recovered from a whole-half read-only sweep taken minutes before the test.

A read-only sweep of 28 halves measured the layout. Each codeplug 256 KB block is a data half followed by a half holding only 22334455 @+0x1FBF4 and 5555AAAA @+0x1FFFC. Data halves carry no marker, and reads at +0x40000 alias (0x03A40000 returns the contacts at 0x03A00000).

The fix

  • Every D890 write path now rewrites, unchanged, each other populated window of a touched half: Program, the settings write, Restore backup, run_patch_writes, and the dev helpers (write_carrying / carry_halves / carry_blocks).
  • Contacts are capped at 655 (MAX_CONTACTS_WRITE, the contact bank's first half). Program no longer reads or clears records past it.
  • The restore guard accepts a carried window only in a half that an owned window shares.
  • FakeAnytone.rebuilds_halves models the radio's commit and reproduces the wipe in a test.

Verification

  • Hardware: the same 0x02004000 write through the fixed path. The radio booted clean, and the zone-list half read back byte-identical to the snapshot.
  • Not on hardware: Program, settings and Restore with the carry. They share carry_halves, which is unit-tested against the rebuilding fake.
  • npm run ci green locally.

🤖 Generated with Claude Code

)

The D890UV rebuilds a whole 128 KB flash half from only the data a session
sends, like the D578. Proven on hardware 2026-11-22: an identical-bytes write
of the erased window 0x02004000 wiped the zone lists at 0x02000000 and the
radio booted to "Program error, please initialize the radio".

Every D890 write path now also rewrites, unchanged, each other populated
window of a touched half: Program, the settings write, Restore backup,
run_patch_writes and the dev helpers (write_carrying / carry_halves /
carry_blocks). The same write through the fixed path left the zone-list
half byte-identical and the radio booted clean.

Contacts are capped at 655 (the contact bank's first half): past it the
records run into a half holding only the radio's 22334455/5555AAAA markers,
and reads at +0x40000 alias the bank's first records. The restore guard
accepts a carried window only in a half an owned window shares.

FakeAnytone gains `rebuilds_halves`, which reproduces the wipe.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ww8l
ww8l merged commit 6725e96 into main Nov 23, 2026
3 checks passed
@ww8l
ww8l deleted the issue-143-d890-flash-halves branch November 23, 2026 05:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

D890UV: check for the 128 KB flash-half rewrite found on the D578

1 participant