Skip to content

Add backpressure to flash write protocol#33

Merged
widgetii merged 4 commits intomasterfrom
flash-write-backpressure
Apr 6, 2026
Merged

Add backpressure to flash write protocol#33
widgetii merged 4 commits intomasterfrom
flash-write-backpressure

Conversation

@widgetii
Copy link
Copy Markdown
Member

@widgetii widgetii commented Apr 6, 2026

Summary

  • Agent now sends a per-packet ACK during flash write data transfer, preventing UART FIFO overflow on sustained writes
  • Client uses _write_block helper with retry logic (up to 3 attempts per block) instead of inline send loop

Test plan

  • Verify flash write completes without FIFO overflow on hi3516ev300
  • Verify retry logic triggers on simulated packet loss

🤖 Generated with Claude Code

widgetii and others added 4 commits April 4, 2026 19:39
handle_flash_write now sends per-packet ACK (matching handle_write).
write_flash reuses _write_block for consistent backpressure behavior.

Flash write still fails at ~1MB due to FMC soft reset accumulation
during page programming. RAM write (16MB) verified at 921600 baud.
Flash write needs further debugging of fmc_enter_boot impact.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fix progress display: use plain print() instead of Rich console.print()
  which was adding newlines instead of overwriting in-place via \r
- Scale CRC32 verification timeout with data size (~1s/MB) to avoid
  timeout on large reads (16MB was timing out at 10s hard limit)
- Show "Sending Agent" instead of "Sending U-Boot" during agent upload
- Document flash agent commands in main README

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- `agent read` no longer requires -a and -s; defaults to 0x14000000 and
  queries flash size from the device via get_info()
- `agent write` defaults -a to 0x14000000
- `agent read` -o defaults to flash_dump.bin
- Update README examples to show the simpler invocation

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@widgetii widgetii merged commit e37d2e6 into master Apr 6, 2026
26 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