Skip to content

test(lpc): add fault emit autoresearch mode - #3615

Merged
zackees merged 1 commit into
masterfrom
feat/lpc-fault-emit-test
Jul 6, 2026
Merged

zackees merged 1 commit into
masterfrom
feat/lpc-fault-emit-test

Conversation

@zackees

@zackees zackees commented Jul 6, 2026 •

Copy link
Copy Markdown
Member

Summary

  • add LPC845-only --fault-emit-test AutoResearch mode
  • gate trigger_oom and trigger_stackblow RPCs behind FASTLED_AUTORESEARCH_FAULT_TEST=1
  • document the fault-emission workflow in agents/docs/hardware-autoresearch.md

Closes #3302.
Part of #3348.

Local validation

  • fbuild port scan confirmed LPC-Link2 CMSIS-DAP on COM10.
  • bash lint ci/autoresearch/args.py ci/autoresearch/phases.py examples/AutoResearch/AutoResearchLowMemory.h
  • bash autoresearch lpc845 --fault-emit-test --upload-port COM10 --timeout 120s --skip-lint

Observed fault diagnostics:

  • trigger_oom: FAULT: HardFault PC=0x10001E70 LR=0xFFFFFFF9 xPSR=0x10000020
  • trigger_stackblow: FAULT: HardFault PC=0x10002FC0 LR=0xFFFFFFF9 xPSR=0x00000000

Summary by CodeRabbit

  • New Features

    • Added a new LPC845 fault-validation mode for AutoResearch.
    • This mode can intentionally trigger memory and stack failures and verify that the device reports a FAULT: diagnostic before resetting.
  • Documentation

    • Updated the hardware AutoResearch guide with step-by-step instructions, required setup, and expected pass/fail results for the new validation flow.
    • Added command-line help for the new option.

@zackees
zackees merged commit 298830f into master Jul 6, 2026
10 of 11 checks passed
@zackees
zackees deleted the feat/lpc-fault-emit-test branch July 6, 2026 22:51
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Jul 6, 2026
@fastled-project-sync fastled-project-sync Bot moved this from Triage to Done in FastLED Tracker Jul 6, 2026
@coderabbitai

coderabbitai Bot commented Jul 6, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 9b3d4575-27b4-4f9b-825d-1bcdf5f3ca7c

📥 Commits

Reviewing files that changed from the base of the PR and between 31891c4 and 7a8b6bf.

📒 Files selected for processing (5)
  • agents/docs/hardware-autoresearch.md
  • autoresearch
  • ci/autoresearch/args.py
  • ci/autoresearch/phases.py
  • examples/AutoResearch/AutoResearchLowMemory.h

📝 Walkthrough

Walkthrough

Adds a FASTLED_AUTORESEARCH_FAULT_TEST build mode for LPC845 that intentionally triggers OOM and stack-blow faults via RPC endpoints, a --fault-emit-test CLI flag wired into build defines and dispatch logic, an orchestration routine that flashes, triggers, and asserts FAULT: diagnostics over serial, and accompanying documentation.

Changes

Fault-Emit Validation

Layer / File(s) Summary
Firmware fault-trigger RPC endpoints
examples/AutoResearch/AutoResearchLowMemory.h
Adds fault-test-only triggerLowMemoryNullFault and recurseLowMemoryStackBlow helpers, binds trigger_oom/trigger_stackblow RPC methods under FASTLED_AUTORESEARCH_FAULT_TEST, and extends preprocessor gating to exclude normal SCT-RX handlers in fault-test builds.
CLI flag and build define wiring
ci/autoresearch/args.py, ci/autoresearch/phases.py
Adds fault_emit_test field and --fault-emit-test argparse flag; appends FASTLED_AUTORESEARCH_FAULT_TEST=1 to compile defines during parse-time and deferred synthesis.
Fault validation orchestration and reporting
ci/autoresearch/phases.py
Adds a special-mode dispatch branch and _run_lpc_fault_emit_tests which resets the device, sends JSON-RPC fault triggers, classifies PASS/FAIL on FAULT: output, re-flashes between triggers, and prints a summary.
Wrapper help and documentation
autoresearch, agents/docs/hardware-autoresearch.md
Adds --fault-emit-test help text and a new "LPC845 Fault-Emit Validation" documentation section with usage and pass/fail criteria.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related issues

Sequence Diagram(s)

sequenceDiagram
  participant CLI as autoresearch CLI
  participant Phases as ci/autoresearch/phases.py
  participant Device as LPC845 Firmware

  CLI->>Phases: run with --fault-emit-test
  Phases->>Phases: validate target env is LPC845 WS2812
  Phases->>Device: build and flash fault-test firmware
  Phases->>Device: reset, send trigger_oom RPC
  Device-->>Phases: FAULT: output or normal result
  Phases->>Phases: classify PASS/FAIL
  Phases->>Device: re-flash fresh firmware
  Phases->>Device: reset, send trigger_stackblow RPC
  Device-->>Phases: FAULT: output or normal result
  Phases->>Phases: classify PASS/FAIL
  Phases->>CLI: print PASS/FAIL summary
Loading
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/lpc-fault-emit-test

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[MED] Fault-emit validation test — intentionally OOM / stack-blow to assert the device emits proper error

1 participant