Skip to content

LA decoders in the SDK and MCP: USB, Modbus RTU, CAN/CAN FD, PWM, 1-Wire, SMBus/PMBus - #138

Merged
wardviaene merged 9 commits into
mainfrom
usb-decode
Nov 21, 2026
Merged

wardviaene merged 9 commits into
mainfrom
usb-decode

Conversation

@wardviaene

@wardviaene wardviaene commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

LA protocol decoders in the SDK and the MCP server: USB, plus Modbus RTU, CAN / CAN FD, PWM, 1-Wire and SMBus/PMBus. Python mirrors of the server's decoders (embeddedci-server main: USB a2ffaee6, the five 4ef57842..08a18dee), each held to Go by shared vectors that are byte-identical to the server's testdata/shared/*_decode_vectors.json.

SDK (bp.decode(la, protocol, ...), LaCapture.decode, embeddedci.benchpod.decode.decode):

  • usb (dp, dm, speed) → UsbDecode: packets (CRC5/CRC16, bit stuffing, PID checks), transactions (repeated NAKs merged), control transfers with requests and descriptors decoded.
  • modbus (rx, baud, optional tx) → ModbusFrame list: request/response pairing, the line each frame was on, function codes, registers/coils, exceptions, CRC.
  • can (can, bitrate, optional data_bitrate, sample_point) → CanFrame list: CAN 2.0 base/extended, ISO CAN FD with BRS, stuffing, CRC15/17/21, stuff count, ACK, error frames.
  • pwm (channels, optional servo) → PwmDecode: per-period rows, min/max/mean, jitter, glitches; servo pulse width and position only with servo=True.
  • onewire (onewire) → OneWireTransaction list: reset/presence, overdrive, ROM commands and SEARCH ROM, CRC8, scratchpad temperature.
  • smbus / pmbus (sda, scl, pec) → SmbusTransaction list: SMBus protocols, PEC, PMBus command names, LINEAR11/LINEAR16 values, status bits.

MCP decode_la: all of the above (tx, can, bitrate, data_bitrate, sample_point, channels, onewire, pec added; USB dp, dm, speed), with items per frame/transaction/channel, errors, and the full result in benchpod://capture/decode for the capture view (benchpod-ui#39).

Synthetic minimum rates: USB full speed 32 MS/s (docs 48), low speed 4 MS/s (docs 6); CAN 6 samples per data bit; 1-Wire 1 MS/s, overdrive 4 MS/s.

Version: 4.0.1 was released from main meanwhile, so these are entries under an unreleased 4.0.2. embeddedci is 4.0.2 in pyproject and embeddedci-mcp needs >=4.0.2, so the min-SDK CI job tests against the in-repo SDK.

Host-tested only (synthetic captures); no hardware capture yet. CAN FD CRCs follow ISO 11898-1:2015 but are only checked against our own encoder.

Note: test_feature_map.py::test_bundled_copy_matches_the_firmware fails locally against the shared benchpod-firmware checkout (another session's branch), unrelated.

🤖 Generated with Claude Code

wardviaene and others added 5 commits November 20, 2026 16:18
Full speed and low speed from a passive D+/D- tap: packets (CRC5/CRC16,
bit stuffing, PID checks per packet), transactions, control transfers with
SETUP requests and descriptors decoded. Mirrors the server's decode/usb.go,
held to it by the shared usb_decode_vectors.json.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…dci 4.0.0)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… (USB decode)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…K and MCP decode_la

Python mirrors of the server's decoders, held to them by the shared vectors.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@wardviaene wardviaene changed the title USB decode from the logic analyzer (SDK + MCP) LA decoders in the SDK and MCP: USB, Modbus RTU, CAN/CAN FD, PWM, 1-Wire, SMBus/PMBus Nov 21, 2026
wardviaene and others added 4 commits November 20, 2026 19:24
embeddedci 4.0.2 in pyproject, embeddedci-mcp needs embeddedci>=4.0.2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nces, falling-edge resync; USB rate check

Mirrors embeddedci-server ab728b0a (from an independent review against ISO 11898-1:2015).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… frames carry their line

Mirrors embeddedci-server 05d4e992.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@wardviaene
wardviaene merged commit 3dd0e23 into main Nov 21, 2026
12 checks passed
@wardviaene
wardviaene deleted the usb-decode branch November 21, 2026 04:18
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