.embedder/hardware/ and define what counts as success.
Run a script
You can run a saved script in three ways:- Ask Embedder in Act or Debug mode.
- Open it in VS Code and choose Embedder: Run Hardware Script.
- Use the terminal command from the project directory:
.embedder/hardware/. Use Embedder: Stop Hardware Script, the chat task controls, or Ctrl+C in the terminal to stop a run.
Use Embedder’s runner for scripts that rely on its instrument helpers. Running those files with plain python does not supply the same helpers and setup.
Run a script from the editor
In VS Code, a run button (▷) appears in the editor title bar and right-click menu for any Python file in the workspace. Choose it to start the script without writing a chat message. A run row appears at the bottom of the chat with three choices:- Run executes the script and keeps the result out of the conversation. A Hand to agent button on the finished row sends the result later if you change your mind.
- Run and hand to agent executes the script and delivers the result to the agent when the run finishes.
- Cancel removes the row without touching hardware.
embedder script in a terminal.
A simple UART check
Replace the port with the intended target’s port:.embedder/hardware/boot_check.py
Supply a capture profile
For settings that change between runs, usecapture_profile in the script and a companion file such as boot_check.profile.json.
The CLI and editor use the companion profile automatically. An agent-started run uses the profile supplied with that run instead. Without a profile, capture_profile is an empty dict; use defaults for optional settings.
You can override it at launch:
Use instrument helpers
Choose the tool first, then use its guide for dependencies, channel numbering, and supported operations:- Debuggers: J-Link, OpenOCD, TI CCS, XMOS xgdb, and AURIX/TriCore over TCF.
- Serial: UART, RTT, ITM/SWO, and xSCOPE.
- Instruments: Saleae, Digilent, PicoScope, Siglent, PPK2, and Joulescope.
- Other hardware workflows: Bluetooth LE, J-Trace, and XMOS xsim.
la_* or scope_* helper names. Available triggers, decoders, capture modes, and output controls still depend on the selected tool. A script written for one instrument may need changes for another.
Use run_tool(["probe-rs", "list"]) in a script when a command must run on the selected hardware host, including a bridge. Name the target explicitly before any programming or control action.
For generated waveforms, supplies, BLE connections, and similar resources, include cleanup even when a test fails.
Watch a live capture preview
Instrument captures show a live preview in the Monitor’s Power, Logic, or Oscilloscope tab while the script runs. A script chip and a Live or Ended pill replace the tab’s setup and transport controls. The preview observes the script’s acquisition; it does not open a second USB connection or take another hardware lease. Closing the preview does not stop the script; use the script’s stop control to end acquisition. Previews are built in forjoulescope_measure, ppk2_measure and manual PPK2 start/read/stop captures, and Saleae timed or manual logic captures. Power previews update five times per second, and the view retains the most recent 4,000 preview points. A stopped preview stays visible until you dismiss it with New capture.
Other providers can publish preview points while acquiring:
state="stopped" with the final update. A preview never saves a capture; use the provider’s normal capture publication helper for that.
Keep a hardware case
For an investigation with several probes, keep related files together:CASE.md. Update existing scripts when the test changes so it remains clear which version produced a result.
Run longer checks
Ask for a background run when you need a soak test or long capture. Follow its status in the task view and stop it when the test is complete. An active hardware workflow can make another session wait. Check/hardware-queue before starting a conflicting operation, and release the equipment when the run finishes.
