serial_sequence
Run multi-step hardware sequences mixing serial I/O, delays, captures, and SWD memory reads or writes in one call, preserving real timing between steps for hardware-in-the-loop tests.
Instructions
Run a multi-step hardware sequence (serial + SWD memory) in one tool call.
Executes a list of send, delay, capture, mem_write, and mem_read steps sequentially with real timing (no tool-call overhead between steps). Useful for hardware test sequences that are timing-sensitive — blinking GPIOs over SWD, bit-banging registers with deterministic delays, mixed serial/memory flows.
Timing note: each mem_write/mem_read currently launches a fresh OpenOCD process (~tens of ms overhead per op), so sub-10ms delays between memory ops won't be honored precisely. Delay steps themselves are accurate.
Args: steps: JSON array of step objects. Step types: Send: {"send": "CMD", "to": "/dev/ttyACM0 (Linux) or /dev/cu.usbmodemXXXX (macOS)", "expect": "OK", "read_timeout": 2.0, "line_ending": "lf"} Delay: {"delay_ms": 500} Capture: {"capture": true, "label": "my_label", "device_index": 0} MemWrite: {"mem_write": true, "address": "0x48000418", "value": "0x40", "probe": "yellow", "width": 32} or {"mem_write": true, "symbol": "blink", "elf_path": "/path/to.elf", "value": "1", "probe": "yellow"} MemRead: {"mem_read": true, "address": "0x48000400", "count": 2, "probe": "yellow", "width": 32, "label": "gpio_pre"} or {"mem_read": true, "symbol": "blink", "elf_path": "/path/to.elf", "probe": "yellow"}
Serial: "to" is the connection_id from serial_connect. "expect",
"read_timeout", "line_ending" optional on send steps.
Capture: "label" and "device_index" optional. PNGs saved to /tmp/stm32-captures/.
Memory: "probe" accepts board nickname, probe nickname, or ST-Link SN.
"address" is hex ("0x48000418"); or use "symbol" + "elf_path".
"width" is 8/16/32 bits, defaults to 32 (auto-detected from symbol size).
"count" (read only) defaults to 1. "label" (read only) prefixes the result line.
on_failure: "continue" (default) to run all steps, or "stop" to abort on first failure.
filter_responses: If true, expect patterns match only >-prefixed VCP response lines.Returns: Formatted report with per-step results and a summary line.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| steps | Yes | ||
| on_failure | No | continue | |
| filter_responses | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |