Skip to content

I2C busy names the other holder; closing CAN switches termination off (SDK + MCP 2.13.16) - #79

Merged
wardviaene merged 1 commit into
mainfrom
fix/i2c-holder-can-term
Nov 14, 2026
Merged

wardviaene merged 1 commit into
mainfrom
fix/i2c-holder-can-term

Conversation

@wardviaene

Copy link
Copy Markdown
Member

Fixes two findings from the 2026-11-14 app test pass.

  • I2C busy (finding 11): with the desktop app's I2C session open, an SDK script got i2c busy: close the I2C session from bp.open_i2c() first, which points at the script. The firmware's I2C master is one per pod and does not track which connection opened it, so the SDK tells the cases apart: if this BenchPod has its own unclosed session it says to close that; otherwise it says another connection holds it (desktop app, web app, AI agent or another script) and names that session's pins and rate from i2c_status. New: I2CMaster.closed.
  • CAN termination (finding 12): CanBus.close() and the MCP can_close also send can_term off, so a bus opened with term=True no longer leaves 120 ohm on the bus. Firmware 3.10.6 does the same in can_disable (benchpod-firmware PR).
  • Docs: SDK README (I2C master, CAN), MCP README can_close, tool docstrings, both changelogs. Patch bump to 2.13.16.

HW-tested on benchpod-30a9f1 over the LAN (fw 3.10.5): two connections, the second gets "another connection to this pod holds its I2C master (LA2 SDA, LA1 SCL, 100000 Hz) ..."; the first gets "this BenchPod already has an I2C session open"; CAN after close: enabled false, term false.

🤖 Generated with Claude Code

… (SDK + MCP 2.13.16)

open_i2c() refused with "i2c busy" while the desktop app held the pod's I2C master told the script
to close its own open_i2c() session, which it never opened. The SDK now tells the two cases apart:
another connection holds it (the error says so, with that session's pins and rate from
i2c_status), or this BenchPod still has its own session open (close that one).
I2CMaster.closed is new.

CanBus.close() (and the MCP can_close) also sends can_term off, so a bus opened with term=True no
longer leaves the 120 ohm termination in. Firmware 3.10.6 does the same in can_disable.

HW-tested on benchpod-30a9f1 over the LAN (fw 3.10.5): both I2C messages, and CAN status after
close reports enabled false, term false.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@wardviaene
wardviaene enabled auto-merge (squash) November 14, 2026 16:44
@wardviaene
wardviaene merged commit b9f09c3 into main Nov 14, 2026
20 checks passed
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.

1 participant