Complete flash pipeline: RAM→flash program + sysctrl reboot#34
Merged
Complete flash pipeline: RAM→flash program + sysctrl reboot#34
Conversation
CMD_FLASH_PROGRAM (0x0A): erase + program flash from RAM in one operation. Host uploads firmware to RAM via write_memory (fast, reliable at 921600), then sends one command. Agent erases sectors, programs pages, sends per-sector/page progress. Host verifies after. Sysctrl reboot: write 0xdeadbeef to 0x12020004 (from Linux hisi-reboot driver). Clean reset that boots from flash — confirmed OpenIPC U-Boot + Linux kernel boot on hi3516ev300. End-to-end verified: - RAM upload: 16MB in 9min at 921600 - Flash program: 256 sectors + 65536 pages in 76s - Reboot: U-Boot → Linux 4.9.37-hi3516ev300 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two-phase flash write + clean reboot. The full firmware recovery pipeline.
CMD_FLASH_PROGRAM (0x0A)
Host uploads firmware to RAM via
write_memory(16MB, 921600 baud, CRC verified), then sends one command. Agent locally:Sysctrl Reboot
Replaced watchdog reset with proper HiSilicon sysctrl reset:
*(0x12020004) = 0xdeadbeef(same as Linuxhisi-rebootdriver). Clean reset that boots from flash.End-to-End Results (hi3516ev300, W25Q128 16MB)
Confirmed: OpenIPC Linux 4.9.37-hi3516ev300 boots from flash after agent-written firmware.
Test plan
🤖 Generated with Claude Code