Stop hardware read_memory from leaving the target permanently halted - #58
Merged
Conversation
An early `?` on the mdw read (e.g. read_until_value's 2s timeout) skipped the resume telnet command entirely, leaving the OpenOCD target halted for the rest of the run. read_memory now always attempts resume after halt succeeds, tracking the read and resume results separately so a resume failure is recorded without discarding a successful read.
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.
Fixes #48
Summary
HardwareBackend::read_memoryused a single?-propagating async block forhalt→mdw→resume. If themdwread failed (e.g.read_until_value's 2s timeout, or the connection closing mid-read), the early return skippedresumeentirely, leaving the OpenOCD target halted for the rest of the run.read_memorynow tracks the read result and the resume result separately:resumeis always attempted oncehalthas actually succeeded, regardless of whether themdwread itself failed. A resume failure is recorded viarecord_failurewithout discarding a successful read.Test plan
read_memory_attempts_resume_even_when_the_mdw_read_fails: a mock telnet server that letsmdwfail (closes its write side to force EOF) and assertsresumeis still sent.cargo test -p nucleus-hil --lib— 63 passed.cargo clippy -p nucleus-hil -p nucleus-cli --all-targets -- -D warnings— clean.cargo fmt --all -- --check— clean.Generated by Claude Code