Skip to content

Stop hardware write_memory from discarding a successful write on resume failure - #59

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

Stop hardware write_memory from discarding a successful write on resume failure#59
harshverma27 merged 1 commit into
mainfrom
claude/issue-49-fix

Conversation

@harshverma27

Copy link
Copy Markdown
Owner

Fixes #49

Summary

  • HardwareBackend::write_memory chained haltmwwresume behind a single ?-propagating async block. A resume failure after a successful mww write propagated as the whole function's error, discarding the fact the write itself had already landed — and (mirroring issue hardware read_memory: early ? skips resume, leaving STM32 permanently halted in OpenOCD #48) an mww failure would skip resume entirely, leaving the target halted.
  • write_memory now tracks write_result and resume_result separately: resume is always attempted once halt has actually succeeded, and a resume failure is recorded via record_failure without overwriting a successful write result.

Test plan

  • Added write_memory_keeps_a_successful_write_even_when_resume_fails: a mock telnet server that lets the mww write land, then forces the connection closed so the subsequent resume fails — asserts the function still returns Ok(()) and the failure is recorded.
  • cargo test -p nucleus-hil --lib — 64 passed.
  • cargo clippy -p nucleus-hil -p nucleus-cli --all-targets -- -D warnings — clean.
  • cargo fmt --all -- --check — clean.

Generated by Claude Code

…me failure

write_memory chained halt/mww/resume behind a single \`?\`, so a resume
failure after a successful write propagated as the whole function's
error, discarding the fact the write itself had already landed.
write_result and resume_result are now tracked separately: resume is
always attempted once halt succeeds, and a resume failure is recorded
without overwriting a successful write result.
@harshverma27
harshverma27 merged commit 0bc1c26 into main Jun 30, 2026
@harshverma27
harshverma27 deleted the claude/issue-49-fix branch June 30, 2026 13:02
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 write_memory: early ? skips resume, leaving STM32 permanently halted in OpenOCD

2 participants