Skip to content

Stop hardware read_memory from leaving the target permanently halted - #58

Merged
harshverma27 merged 1 commit into
mainfrom
claude/issue-48-fix
Jun 30, 2026
Merged

Stop hardware read_memory from leaving the target permanently halted#58
harshverma27 merged 1 commit into
mainfrom
claude/issue-48-fix

Conversation

@harshverma27

Copy link
Copy Markdown
Owner

Fixes #48

Summary

  • HardwareBackend::read_memory used a single ?-propagating async block for haltmdwresume. If the mdw read failed (e.g. read_until_value's 2s timeout, or the connection closing mid-read), the early return skipped resume entirely, leaving the OpenOCD target halted for the rest of the run.
  • read_memory now tracks the read result and the resume result separately: resume is always attempted once halt has actually succeeded, regardless of whether the mdw read itself failed. A resume failure is recorded via record_failure without discarding a successful read.

Test plan

  • Added read_memory_attempts_resume_even_when_the_mdw_read_fails: a mock telnet server that lets mdw fail (closes its write side to force EOF) and asserts resume is 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

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.
@harshverma27
harshverma27 merged commit 7901976 into main Jun 30, 2026
5 checks passed
@harshverma27
harshverma27 deleted the claude/issue-48-fix branch June 30, 2026 12:57
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.

hardware read_memory: early ? skips resume, leaving STM32 permanently halted in OpenOCD

2 participants