Skip to main content
Use this workflow to turn a firmware requirement or reproduced defect into a repeatable check that runs at the appropriate layer: host, target, simulator, or bench. Embedder can write and run project tests, program a target, wait for runtime output, coordinate instruments, and preserve evidence.
Embedder orchestrates your project’s test commands and reusable hardware scripts. It does not add a separate HIL test framework, generate a complete test suite automatically, or schedule regressions by itself. Keep durable tests in the repository and connect them to your existing CI or automation system.

Choose the lowest useful test layer

Start with the least expensive check that can prove the requirement. Add real hardware only when the behavior depends on the target, peripheral, timing, power, or electrical interface. A passing host test does not prove that the hardware works. A successful build does not prove that the image boots. A verified flash does not prove that the required runtime state occurred.

Record the project test workflow

Run /init and verify the commands placed in EMBEDDER.md:
The project guide should identify:
  • the focused and broad host test commands;
  • the target build command and expected artifact;
  • the intended board, flasher, probe, and serial transport;
  • any simulator, hardware script, or instrument prerequisites;
  • the observable result that constitutes a pass;
  • actions that require confirmation or physical setup.
Ask Embedder to inspect the existing tests before it invents another harness:

Run host tests and static checks

Use Act mode for ordinary source changes, test commands, builds, and static analysis:
For C and C++ projects, enabled language servers and CLI analyzers can add diagnostics after an edit. Use project_diagnostics when you need a broader scan:
Static analysis is opt-in. A detected analyzer is not necessarily enabled, and an automated MISRA or CERT result is evidence rather than certification.

Add an on-target smoke check

An on-target smoke check should build one known image, program one identified target, and wait for one bounded result.
1

Build and identify the artifact

Run the recorded build command. Stop if the command fails or the expected ELF, HEX, or BIN artifact is absent.
2

Confirm the target and transport

Identify the board, probe or remote bridge, power state, UART or RTT endpoint, and expected baud rate. Do not guess when several targets are connected.
3

Flash with early output capture

Use the dedicated flash workflow so serial capture begins before the reset that follows programming.
4

Bound the wait

Supply a stop string and timeout. A missing marker is a failed or incomplete observation, not a reason to wait indefinitely.
Use serial history when the device may already have produced the result. Use live monitoring when the check must wait for new output. A Monitor tab being open is not evidence that the agent read the expected line.

Create reusable hardware checks

Switch to Debug mode when a check needs GDB, coordinated target control, trace, coverage, or a bench instrument:
Store hardware automation under:
Use a case directory when the check belongs to a longer investigation:
Ask Embedder to reuse or update an existing script rather than create numbered copies:
Run the file with hardware_script_run, not plain Python or a shell command. The managed runner:
  • injects helpers for GDB, serial, RTT, logic, scope, power, or BLE;
  • selects providers from the script and detected equipment;
  • routes commands to a paired hardware host when needed;
  • takes an exclusive hardware lease;
  • validates helper usage before execution;
  • publishes supported captures to the Monitor.
Every script should print a final one-line JSON object containing a boolean success and string summary. Add structured data and metadata when the next step needs measurements or artifact paths.

Coordinate the bench

Use one hardware script when operations must occur in a controlled order or share the same target lease. Separate instruments do not automatically share a clock. Use a firmware GPIO marker, a known sequence, or an instrument-native combined capture when results must be correlated.

Turn a failure into a regression check

1

Reproduce and preserve evidence

Capture the original symptom before changing code. Record the build, target, trigger, instrument configuration, and result in the case note.
2

State the pass condition

Convert the symptom into a boolean outcome with a bounded timeout or numeric tolerance.
3

Write the smallest durable check

Prefer a host test when it can reproduce the defect. Otherwise, create or update one hardware script and keep raw captures needed for review.
4

Demonstrate the check

When safe and practical, show that the check detects the original behavior before applying the fix. If that would damage hardware or require destructive rollback, document why the failing run was not repeated.
5

Apply the fix and rerun unchanged

Run the same command, firmware workload, script, trigger, and pass condition. Report both the software result and the physical observation.

Run long or headless work deliberately

Set run_in_background=true on hardware_script_run for a soak, endurance test, or long capture. The script keeps the board leased until it exits or you stop its task. Only one background hardware script can run in a session, and a 24-hour backstop prevents an abandoned process from holding the board indefinitely. For repository-triggered work, the Embedder daemon can run a GitHub or Slack task on a machine that has the required toolchain or physical hardware. Parallel workers still serialize access to the same board through the hardware arbiter.
An active goal can continue Act-mode software work with automatic approval, but it is not a replacement for a test scheduler. Bounded loops can observe buffered or saved hardware telemetry; they cannot flash, start live captures, run GDB, or send commands.

Preserve reviewable evidence

Keep enough provenance to reproduce each result:
  • exact test and build commands;
  • source revision and build configuration;
  • artifact and matching ELF path;
  • board, MCU, probe, instrument, and firmware state;
  • requested and achieved sample rates;
  • reset, program, halt, and attach actions;
  • raw captures plus decoded or summarized output;
  • script result and CASE.md hypothesis verdicts;
  • trace continuity, dropped records, and symbol-match status.
Instrument captures persist under .embedder/captures/, coverage reports appear in the Coverage view, and trace sessions persist under .embedder/traces/. Hardware cases and scripts remain under .embedder/hardware/.

Hardware scripts

Write structured checks, hold hardware leases, and preserve case evidence.

Combined workflows

Coordinate serial, debugger state, trace, and instruments.

Coverage and trace

Measure executed source and inspect RTT, ITM, or ETM activity.

Tool approvals

Control confirmation behavior without bypassing hardware safety checks.
Last modified on August 22, 2026