Skip to content

Implement sendFrameForStart handshake for hi3516av200#48

Merged
widgetii merged 1 commit intomasterfrom
feature/send-frame-for-start
Apr 20, 2026
Merged

Implement sendFrameForStart handshake for hi3516av200#48
widgetii merged 1 commit intomasterfrom
feature/send-frame-for-start

Conversation

@widgetii
Copy link
Copy Markdown
Member

Summary

HiTool uses sendFrameForStart (continuous 0xAA + HEAD frame blast for 30s) as the handshake instead of waiting for 0x20 markers. This puts the av200 bootrom in the correct state for DDR initialization.

Without this, the protocol transfer completes (all frames ACKed) but U-Boot crashes because the bootrom was in the wrong internal state for DDR init.

Changes

  • _send_frame_for_start(): blasts 0xAA + HEAD(64, ADDRESS0) every 50ms for 30s until ACK
  • Use frame-blast for both initial handshake AND post-SPL rehandshake on PRESTEP0 chips
  • Add 300ms DDR training delay after SPL (HiTool's getDDRTrainingOver logic)
  • Session skips separate handshake() for frame-blast chips
  • HEAD timeout increased to 150ms

Test plan

  • uv run pytest tests/ -x -v --ignore=tests/fuzz — 326 passed
  • hi3516av200 hardware: full transfer succeeds (PRESTEP0→DDRSTEP0→PRESTEP1→SPL→U-Boot all ACKed)
  • hi3516ev300 hardware: no regression, OpenIPC U-Boot prompt reached
  • hi3516av300 hardware: no regression (tested in previous PRs)

🤖 Generated with Claude Code

HiTool uses sendFrameForStart (continuous 0xAA + HEAD frame blast) as
the handshake instead of waiting for 0x20 markers. This puts the
bootrom in the correct state for DDR initialization on av200.

- Add _send_frame_for_start(): blasts 0xAA + HEAD(64, ADDRESS0) for
  30s until bootrom ACKs
- Use frame-blast for both initial handshake and post-SPL rehandshake
  on chips with PRESTEP0
- Add 300ms DDR training delay after SPL (HiTool's getDDRTrainingOver)
- Skip separate handshake() for frame-blast chips in session
- Increase HEAD frame timeout to 150ms (av200 needs ~100ms after ACK)

Tested on hardware:
- hi3516av200: full PRESTEP0→DDRSTEP0→PRESTEP1→SPL→U-Boot transfer OK
- hi3516ev300: no regression, OpenIPC prompt reached
- hi3516av300: no regression (PRESTEP0 without frame-blast)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@widgetii widgetii force-pushed the feature/send-frame-for-start branch from 8e17405 to 8c4103d Compare April 20, 2026 14:35
@widgetii widgetii merged commit fbae959 into master Apr 20, 2026
13 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