Skip to content

fix(i2c): generate STOP after NACK and wait before next START - #225

Merged
andelf merged 1 commit into
mainfrom
fix/i2c-nack-stop
Oct 22, 2026
Merged

andelf merged 1 commit into
mainfrom
fix/i2c-nack-stop

Conversation

@andelf

@andelf andelf commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Summary

Test plan

  • CH32H417 NACK regression: blocking_write to an absent address returns Err(Nack) and leaves MSL=0 BUSY=0 SCL=1 SDA=1.
  • cargo xtask run --example i2c_scan finds BME280 @ 0x76 across repeated full-bus scans.
  • cargo xtask run --example bme280_blocking init + continuous measurements succeed.
  • examples/ch32v307 cargo check (embassy-enabled) succeeds.

🤖 Generated with Claude Code

After AF/NACK the master stayed in MSL with SCL held low until something
else wrote STOP (#222). Also wait for a pending STOP to clear before the
START RMW so a stale STOP bit cannot be written back (#221). Applies to
both blocking and async paths, including OnDrop cancel.

Verified on CH32H417: NACK leaves the bus idle; i2c_scan and
bme280_blocking still work.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@andelf
andelf merged commit bbcabaa into main Oct 22, 2026
24 checks passed
@andelf
andelf deleted the fix/i2c-nack-stop branch October 22, 2026 01:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant