Skip to content

Fix flash dump: RAM addresses, CRC32 verification, modal UX#8

Merged
widgetii merged 1 commit intomasterfrom
feature/flash-dump-fixes
Mar 30, 2026
Merged

Fix flash dump: RAM addresses, CRC32 verification, modal UX#8
widgetii merged 1 commit intomasterfrom
feature/flash-dump-fixes

Conversation

@widgetii
Copy link
Copy Markdown
Member

Summary

  • Fix data abort crash: per-SoC RAM base addresses from qemu-hisilicon
  • Per-block CRC32 verification with retry (optional, XMODEM-style)
  • HyperTerminal-style modal transfer dialog with live stats
  • Clean cancel flow (no terminal artifacts)

Verified on real hardware

  • hi3516ev300: flash dump with correct RAM address (0x42000000)
  • Cancel mid-dump: clean return to terminal

Test plan

  • 206 Python tests pass (28 flashdump tests)
  • Lint + mypy clean

🤖 Generated with Claude Code

RAM address fix:
- Added RAM_BASE map from qemu-hisilicon for all SoC families
- get_ram_staging_addr() returns correct address per chip
- hi3516ev300: 0x42000000 (was 0x82000000 which caused data abort)

Per-block CRC32 verification:
- Detects if U-Boot has crc32 command (optional, graceful fallback)
- After each 4KB block: device crc32 vs local zlib.crc32
- Mismatch triggers retry (up to 3 attempts, like XMODEM)
- Stats: verified/total blocks, error count, retry count

Modal transfer dialog (HyperTerminal-style):
- Progress bar + live transfer stats
- Blocks done/total, speed (KB/s), elapsed time, ETA
- CRC32 verification status, error rate, retries
- Cancel: graceful (finishes current block, Ctrl-C to U-Boot,
  drains serial, clears terminal — no artifacts)
- Return to Terminal button after completion/cancel

Other fixes:
- Ctrl-D/S/C handled directly in on_key (TextArea was swallowing them)
- Reduced chunk size to 4KB for reliable serial transfer
- *.bin added to .gitignore

Tests: 28 flashdump tests (RAM addresses, CRC32 parsing, detection)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@widgetii widgetii merged commit 2fd8ee9 into master Mar 30, 2026
12 checks passed
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.

1 participant