Add agent CLI commands and chunked write support#12
Merged
Conversation
CLI: `defib agent upload/info/read/write` commands with human+json output. - upload: boot protocol upload with SPL from OpenIPC U-Boot - info: query running agent - read: dump memory to file with CRC32 verification - write: write file to memory with CRC32 verification Client: rewrite FlashAgentClient with chunked write_memory (16KB blocks of 512B packets) to work within PL011 FIFO limits. Added read_memory, dump_memory, selfupdate, verify methods. Uses recv_response to skip stale READY packets. 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
Wire the flash agent into the defib CLI with
defib agentsubcommands.defib agent upload -c hi3516ev300 -p /dev/ttyUSB0— upload agent via boot protocoldefib agent info -p /dev/ttyUSB0— query running agentdefib agent read -a 0x41000000 -s 4KB -o dump.bin -p /dev/ttyUSB0— read memory with CRC32defib agent write -a 0x40200000 -i data.bin -p /dev/ttyUSB0— write memory with CRC32Client rewrite:
FlashAgentClient.write_memory()uses 16KB chunked transfers with 512B packets to work within PL011 FIFO limits on uncached DDR. Addedread_memory,dump_memory,selfupdate,verifymethods.Covers roadmap items 1 (WRITE chunking) and 2 (defib integration) from #11.
Test plan
defib agent info— shows RAM base, flash sizedefib agent read— 4KB read with CRC32 OKdefib agent write— 4KB write with CRC32 OK🤖 Generated with Claude Code