Skip to content

UART half_duplex and boot-mode entry (UartEntry) in the SDK and MCP - #104

Merged
wardviaene merged 4 commits into
mainfrom
uart-half-duplex
Nov 18, 2026
Merged

wardviaene merged 4 commits into
mainfrom
uart-half-duplex

Conversation

@wardviaene

Copy link
Copy Markdown
Member

For embeddedci-com/benchpod-firmware#135: the host side of embeddedci-com/benchpod-firmware#161. The RL78 protocol module can build on this.

SDK (embeddedci)

  • open_uart / capture_uart take half_duplex=True: a one-wire UART on rx alone (tx defaults to it, and a different tx is refused).
  • They also take entry=UartEntry(reset_ms, tx_low, hold_ms, idle_ms, data): a boot-mode entry the pod times itself before the session starts.
  • New capability flag uart_hd (gateware v57). entry also needs nrst_pin. Older pods raise UnsupportedFeatureError before anything is sent, and so does the USB console transport.
  • The TCP/cloud transport sends half_duplex / entry only when they are set, so older firmware sees the same requests as before.
from embeddedci.benchpod import UartEntry

entry = UartEntry(reset_ms=5, hold_ms=3, idle_ms=2, data=b"\x00")
with bp.open_uart(rx=3, half_duplex=True, entry=entry, encoding="latin-1") as uart:
    reply = uart.read(timeout=0.5)

MCP (embeddedci-mcp)

uart_open and capture_uart take half_duplex and entry (reset_ms, tx_low, hold_ms, idle_ms, data_hex). uart_open reports half_duplex in its result.

Tests

  • pytest packages/embeddedci: 967 passed. New test_uart_half_duplex.py covers the pin rules, the capability gates, UartEntry validation and the TCP wire format. The API snapshot is refreshed (additive only).
  • pytest packages/embeddedci-mcp: 207 passed. Tool surface refreshed, README rows updated.

The READMEs are updated. Merge after the firmware PR; this PR is safe on its own because it refuses on pods without uart_hd. Not run on hardware yet (see the firmware PR).

🤖 Generated with Claude Code

wardviaene and others added 3 commits November 18, 2026 09:19
…ry (UartEntry)

open_uart / capture_uart take half_duplex (rx alone, tx defaults to it) and
entry=UartEntry(reset_ms, tx_low, hold_ms, idle_ms, data): the pod holds TX
low across a reset, releases it and sends the first bytes, timed on the pod.
Capability uart_hd (gateware v57); entry also needs nrst_pin. Refused before
anything is sent on older pods and on the USB console.

Refs embeddedci-com/benchpod-firmware#135

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… (mcp-min-sdk)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@wardviaene
wardviaene merged commit e080139 into main Nov 18, 2026
20 checks passed
@wardviaene
wardviaene deleted the uart-half-duplex branch November 20, 2026 02:47
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