Skip to content

fbuild-cli: promote bring-up orchestrator to first-class command #697

Description

@zackees

TL;DR

bash autoresearch <board> is FastLED's end-to-end "build + flash + reset + monitor + bring-up RPC test" pipeline. The build and flash halves use fbuild; the bring-up test half is Python that lives only on the FastLED side. As a result:

  • Any other firmware project that wants the same end-to-end sanity test has to reinvent the Python wrapper.
  • The split makes the boundary between "fbuild's responsibility" and "FastLED's responsibility" hard to reason about — autoresearch dips into both freely.
  • New board ports require parallel updates in two repos to wire up the bring-up flow.

This issue requests promoting the bring-up orchestrator to a first-class fbuild command: fbuild bringup <board> or fbuild autoresearch <board> (name TBD).

Why this matters

FastLED bash autoresearch lpc845brk today does:

  1. Build firmware → fbuild.
  2. Resolve VCOM port by VID:PID → FastLED ci/util/port_utils.py.
  3. Flash via pyocd → FastLED (shells out to pyocd CLI).
  4. Reset → FastLED (shells out to pyocd).
  5. Open monitor with DTR/RTS=True → FastLED ci/util/pyserial_monitor.py.
  6. Drain boot banner → FastLED ci/autoresearch/phases.py.
  7. Send JSON-RPC echo → FastLED.
  8. Validate 3-way (remote_ok, log_ok, echo_ok) → FastLED.
  9. Report → FastLED.

Steps 2-9 should live in fbuild. The application-specific echo sentinel (4242) and the "what does pass mean" predicate can stay as plug-ins / callbacks from the caller; the orchestration machinery is generic.

Proposed shape

$ fbuild bringup lpc845brk --rpc-method echo --rpc-payload '[4242]' --expect-result 4242
🔨 Build:       fbuild build lpc845brk          → 53.85KB / 64KB
🔌 Port:        VID:PID 16C0:0483 → COM20
📡 Flash:       pyocd flash --target lpc845    → 60416 bytes / 3.10 kB/s
🔄 Reset:       sw reset                        → resumed
👂 Monitor:     COM20 @ 115200, DTR=True       → 8s drain
📨 RPC:         {"method":"echo","params":[4242]}
                {"result":4242}                  ✓
✅ BRING-UP PASSED  (3.7 s)

FastLED's bash autoresearch becomes a one-line shell that calls fbuild bringup with the right per-board defaults. Per-board defaults live in board JSON (echo method, sentinel, expected-result predicate).

Acceptance criteria

  • fbuild bringup subcommand exists in fbuild-cli.
  • Pluggable RPC method / payload / expected-result via CLI flags.
  • Per-board defaults loaded from board JSON bringup.{method, payload, expected_result}.
  • FastLED's bash autoresearch migrated to a thin wrapper.
  • Same output shape on success and failure (3-way remote_ok / log_ok / echo_ok tuple).

Refs

Filed from the audit fan-out on FastLED/FastLED#3339.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions