Repository navigation
Teensy LED driver bring-up: ObjectFLED + FlexPWM RX + AutoResearch hardening - #3405
Conversation
…ence [codex] Require AutoResearch capture evidence for PASS
Classifies AutoResearch hardware failures for Teensy/ObjectFLED bring-up.
Synchronize AutoResearch host fallback pins with firmware platform defaults, including Teensy 4.x, ESP32-S3, ESP32-P4, CLI half-overrides, and failed pin-discovery fallback. Validated with focused pytest, ruff, and diff checks.
Queue setPins for every final effective AutoResearch TX/RX pair, including defaults, discovered pins, and discovery fallback. Adds focused coverage for all pin setup paths.
Expose the Teensy FlexIO omitted-TX default through AutoResearch effective pin setup instead of hidden runSingleTest params. Validation: pytest ci/tests/test_autoresearch_phases.py -q; ruff check; ruff format --check; git diff --check.
Require setup RPC pin echoes to match wrapper-requested pins, classify mismatches as pin_state_mismatch, and keep setPins normal-path state in JSON-RPC instead of FL_PRINT.
- remove stale .pio Teensy pre-upload from AutoResearch port detection so fbuild owns deploy - add AutoResearch runtime output lint for direct FastLED/Serial logging in scoped runtime files - convert scoped diagnostics to JSON-RPC/JSONL result data
Map Teensy AutoResearch --spi to the registered SPI_UNIFIED driver, wire firmware SPI test/decode paths for SPI_UNIFIED, and harden scoped AutoResearch runtime-output linting.
Adds AutoResearch-attached ObjectFLED register snapshots for issue #3359 S3.
Add current Teensy pin-22 legacy ObjectFLED one-strip coverage and tighten AutoResearch runtime-output lint.
Allow historical legacy multi-lane AutoResearch requests and add same-timing ObjectFLED regression coverage.
Extend AutoResearch runtime-output lint markers to driver .cpp.hpp files and protect ObjectFLED transmit paths.
…WM RX fixes, AutoResearch diagnostics (#3389) ObjectFLED hardware fixes (S4/S8 related): - ObjectFLED::begin() now enables CCM_CCGR1/0/2/3 GPIO1-4 clocks before remapping fast GPIO6-9 to standard GPIO1-4 via IOMUXC_GPR_GPR26..29. Without this, DMA writes to the standard GPIO alias addresses had no observable effect on the pad, producing zero RX capture even though DMA, TCD, and busy state all reported success. - New configure_pin_output_aliases() programs both the fast and standard GDIR registers as outputs and clears any pending DR bits in both aliases so the pad is in a known state before DMA drives it. - ObjectFLEDDmaManager::waitForCompletion() gains a 250 ms watchdog and returns bool, so a stuck DMA fails cleanly instead of spinning forever. FlexPWM RX corrections (S9 acceptance prerequisite): - IOMUXC_FLEXPWM*_PWMA*_SELECT_INPUT daisy-chain values were 0 (wrong) for pins 8, 22, 23, and 36; corrected to the SION-tied alt entry for each pad so the FlexPWM submodule actually samples the wired pin. - FlexPwmRxChannelImpl::wait() now compares CITER against the value captured at configureDma()/arm time, not at wait() entry. The earlier sampling falsely classified successful capture as TIMEOUT whenever FastLED.wait() drained the TX DMA before wait() was invoked. Diagnostic surface (S3/S11): - ObjectFLED snapshot adds CCM_CCGR0..3 plus per-pin standard mode/ input/output and fast mode registers so diagnostics can prove the alias bank is clocked and configured. - New JSON-RPC probes runSingleTest emits on ObjectFLED runs: objectFledStandardGpioProbe (manually toggles TX via standard GPIO and reads RX to prove electrical connectivity) and objectFledRxCaptureProbe (drives manual pulses while sampling FlexPWM RX state through flexPwmRxDiagnosticsToJson()). - RunResult/runSingleTest response now include per-pattern decodeOk, decodeError, decodeBytes, decodeOutputCapacity, and a compact rawEdgeSample, so AutoResearch failures can distinguish decode failure vs zero capture vs partial capture without serial spam. - context.py renders the new RX/decode fields and probe summaries alongside the existing ObjectFLED diagnostic block. AutoResearch phase plumbing: - Removed the broken leading setLaneSizes RPC for --lane-counts; the per-lane sizes now ride on the runSingleTest/runParallelTest params directly, eliminating a setup-time failure mode and pulling the test matrix into a single lane_size_sets list. Existing fan-out semantics (drivers x lane_counts x strip_sizes) are preserved. Validation: - bash test --unit: 254/254 passed - bash lint --cpp: clean (PlatformIO-internal-usage warnings unchanged) - uv run pytest ci/tests/test_autoresearch_phases.py: 81 passed Refs: #3359 Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
…st (#3391) Adds fl::FlexPwmRxChannel::diagnosticsToJson(pin) - a read-only snapshot of the active FlexPWM input-capture receiver: IOMUXC mux/select register live vs expected values, FlexPWM submodule MCTRL/CTRL/CTRL2/DMAEN/ CAPTCTRLA/CAPTCTRLB/CAPTCOMPx, the four CVAL2..CVAL5 capture values, the receiver DMA channel + DMAMUX + ERQ/HRS/INT/ERR/ES, and the full TCD descriptor. Wired into the ObjectFLED branch of runSingleTest so every ObjectFLED acceptance attempt now returns objectFledDiagnostics AND flexPwmRxDiagnostics. context.py renders both blocks. No runtime behavior change in the FlexPWM RX driver, ObjectFLED, or AutoResearch test loop - this is strictly observability. First diagnostic run on canonical TX 22 -> RX 8 with this PR confirms zero-capture root cause is upstream of the receiver: FlexPWM RX is fully armed (mctrl bit 11 set, captctrla ARMA + EDGA bits set, dmaen=0x60, dma erq=8) but cval2..cval5 stay at 0 and DMA citer never decrements, so no edges ever reach the FlexPWM submodule. That points the next investigation step at whether ObjectFLED's GPIO1_DR_SET / GPIO1_DR_CLEAR writes actually toggle the standard GPIO1 alias on pin 22 after IOMUXC_GPR_GPR26 bit 24 is cleared. Validation: - bash test --unit: 254/254 passed - bash lint --cpp: clean (PlatformIO-internal-usage warnings unchanged) - bash autoresearch teensy41 --object-fled --tx-pin 22 --rx-pin 8 --timeout 90 --skip-lint: completes in <30s, returns zero_capture (no regression), now emits flexPwmRxDiagnostics block Refs: #3359 Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
Adds probeStandardGpioPad(tx_pin, rx_pin) that manually drives the TX pin via the standard GPIO1-4 alias (clearing IOMUXC_GPR_GPR26 bit, setting the standard GDIR bit, and pulsing standard DR_SET/DR_CLEAR in software) while reading RX via digitalReadFast. Probe saves and restores all touched IOMUXC/GPIO state and never touches FlexPWM or DMA, so it cannot disturb the subsequent ObjectFLED + FlexPWM RX test run. Runs once per ObjectFLED runSingleTest before driver setup; result is attached as response field standardGpioPadProbe and rendered by context.py. First-run evidence on canonical TX 22 -> RX 8: standardGpioRxHighCount: 5 standardGpioRxLowCount: 5 standardGpioConnected: True Standard GPIO1 alias *does* reach the pad and *does* drive RX through the soldered loopback. Combined with the prior FlexPWM RX diagnostic showing cval2..5=0 / citer never decrements, this isolates the zero-capture failure to ObjectFLED's DMA-driven TX path itself (pad config, timing, or DMA-vs-pad interaction) -- not to the standard GPIO bank mapping or to the FlexPWM receiver. Validation: - bash test --unit: 254/254 (fingerprint cache; no source changes invalidated the unit suite) - bash lint --cpp: clean (PlatformIO-internal-usage warn-only baseline unchanged) - bash autoresearch teensy41 --object-fled --tx-pin 22 --rx-pin 8 --timeout 120 --skip-lint: completes normally, returns zero_capture (no regression), new probe emits success. Refs: #3359 Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
…FLED actually programs) (#3393) ObjectFLED wires TMR4 to DMA via xbar_connect() with output indices XBARA1_OUT_DMA_CH_MUX_REQ30=0, REQ31=1, REQ94=2 (Teensy core macros). xbar_connect() therefore writes to XBARA1_SEL0 (outputs 0 + 1) and XBARA1_SEL1 (outputs 2 + 3), NOT to SEL15 / SEL47 the existing snapshot was reading. Adds xbar.sel0 / xbar.sel1 fields to every snapshot event. First diagnostic run on canonical TX 22 -> RX 8 confirms: xbar.sel0=0x2524 -> output 0 src=0x24=36 (QTIMER4_TIMER0) output 1 src=0x25=37 (QTIMER4_TIMER1) xbar.sel1=0x0026 -> output 2 src=0x26=38 (QTIMER4_TIMER2) So the TMR4 -> XBAR -> DMAMUX -> DMA chain is wired exactly as ObjectFLED requests. Combined with the existing evidence (DMA citer decrements, dma1 daddr cycles GPIO1..4_DR_SET, dma2/dma3 daddr cycles GPIO1..4_DR_CLEAR, standard-bank DR_SET / DR_CLEAR writes via the probe reach the pad), the TX-side hardware program is internally consistent with WS2812 generation. Zero capture is still observed; root cause remains in a layer the current diagnostics do not yet expose. No runtime behavior change. Validation: - bash test --unit: 254/254 passed - bash lint --cpp: clean - bash autoresearch teensy41 --object-fled --tx-pin 22 --rx-pin 8 --timeout 120 --skip-lint: completes normally, returns zero_capture (no regression), new xbar.sel0/sel1 fields render. Refs: #3359 Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
… pad probe (#3394) Extends probeStandardGpioPad with a 50-iteration tight-loop section that writes HIGH to GPIO1_DR_SET, reads RX with digitalReadFast (no delay), writes LOW to GPIO1_DR_CLEAR, reads RX (no delay), and measures the success rate both at zero-delay and after 200 ns settle. First diagnostic run on canonical TX 22 -> RX 8: fastToggleHighSettled: 50 fastToggleLowSettled: 50 fastToggleHighZeroDelay: 50 fastToggleLowZeroDelay: 50 Standard GPIO1_DR_SET / GPIO1_DR_CLEAR writes propagate to the pad and back to digitalReadFast within a CPU-bus-cycle window -- much faster than WS2812's 1.25 us bit period. This rules out: - Standard alias propagation delay - Pad rate-limiting / signal-integrity - Pull/keeper/drive strength Conclusion: ObjectFLED's DMA TX path is the failure surface; the standard alias itself is rate-tolerant at WS2812 speeds and faster. No runtime behavior change in driver / test loop. Refs: #3359 Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
…#3395) ty was failing on every `_is_plain_int(x) and x > 0` style guard in phases.py because the predicate returned plain bool, so the subsequent `>` / `<=` comparisons saw `Any | None` instead of narrowed `int`. Annotating the predicate as `TypeGuard[int]` lets ty narrow correctly and turns the seven existing comparison-side errors into no-ops at runtime (logic unchanged). Refs: #3359 (Stop-hook unblock) Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
…xpwm-rx-diag (#3398) Extends FlexPwmRxChannel::diagnosticsToJson with the RX pin's PAD control register and the fast + standard GPIO bank GDIR / PSR / GPR slots. Lets a failing run prove whether the FlexPWM input pad inherited any non-zero pull / keeper / HYS / ODE bit from boot or from a prior driver, and whether the input pad bank is mapped to the fast or standard alias when capture is attempted. First diagnostic run on canonical TX 22 -> RX 8: rxBit=16, rxMask=0x10000 rxPadValue=0x38 -> DSE=7, PKE=0, PUE=0, ODE=0, SPEED=0, SRE=0, HYS=0 rxFastGpioBank=7, rxStandardGpioBank=2 rxFastModeValue=0, rxStandardModeValue=0 (input) rxFastInputValue=6, rxStandardInputValue=6 (pad bit 16 LOW) rxGprValue=0xFFFFFFFF (pad on fast GPIO7) rxMappedToStandard=False Pad / mode / GPR / PSR all reasonable for an idle input pin at end-of-frame, but the actual data point we are after is whether this state changes WHILE ObjectFLED is transmitting. The snapshot is taken after `FastLED.wait()` returns, so for a stuck RX it will remain LOW; future work will sample at multiple stages. No runtime behavior change. Validation: - bash test --unit: 254/254 - bash lint --cpp: clean (PlatformIO-internal-usage warn-only) - bash autoresearch teensy41 --object-fled --tx-pin 22 --rx-pin 8 --timeout 120 --skip-lint: completes, zero_capture (no regression), new rxPad/rxFast/rxStandard fields render under flexPwmRxDiagnostics. Refs: #3359 Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
…3399) Adds objectFledDiagnosticsSetRxPin(int) and records the RX pin's fast + standard GPIO PSR (and bit/mask) inside every snapshot event. afterShowReturn is captured while DMA is still actively driving TX, so a HIGH bit at that stage proves the RX pad does see the signal end-to-end. First diagnostic run on canonical TX 22 -> RX 8: stage=afterShowReturn -> rx.fastHigh=1 (rx.fastPsr=0x10006) stage=afterFastLedWait -> rx.fastHigh=0 Conclusion: pin 8 pad DOES see the WS2812 signal. ObjectFLED's DMA-driven TX path through GPIO1_DR_SET/CLEAR is producing visible edges on the wire. The zero_capture is purely a FlexPWM-RX-side defect: the input-capture submodule is correctly armed (mctrl, captctrla, dmaen, mux+SION all match expected) but the IOMUXC FLEXPWM*_SELECT_INPUT daisy-chain value is wrong for pin 8 (currently 0 = GPIO_SD_B1_00, should be 4 = GPIO_B1_00). Fix to follow in a separate, focused PR. No runtime behavior change in this commit. Refs: #3359 Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
…MA completion ISR (#3400) Two coupled changes that move ObjectFLED+FlexPWM-RX acceptance from zero_capture to decode_mismatch (real capture data flowing): 1. Pin 8 SELECT_INPUT was 0 (GPIO_SD_B1_00 - an unrelated pad), so FlexPWM1 SM3 channel A never saw the pin 8 signal even though IOMUX + SION routed pin 8's input to FlexPWM. Corrected to 4 (GPIO_B1_00) per i.MX RT1062 IOMUXC_FLEXPWM1_PWMA3_ SELECT_INPUT table. Diagnostic evidence from #3399 showed pin 8 pad actually toggled HIGH during ObjectFLED's DMA TX (rx.fastHigh=1 at afterShowReturn) while FlexPWM RX still reported cval2..5=0 - exactly the SELECT_INPUT-pointed-at-wrong- pad signature. 2. With SELECT_INPUT corrected, registering the DMA major-loop completion ISR caused runSingleTest to hang past the 120 s RPC timeout (firmware ACKs but never returns). Removing the `interruptAtCompletion()` + `attachInterrupt(dmaIsr)` calls restored normal execution. wait() already terminates via the CITER-inactivity branch (mSignalRangeMaxNs), so the ISR is a convenience the driver does not need. Root-cause investigation of the ISR-induced hang is deferred to a follow-up - the immediate priority is unblocking acceptance. Hardware result (bash autoresearch teensy41 --object-fled --tx-pin 22 --rx-pin 8 --timeout 60 --skip-lint): TEST OBJECT_FLED lanes=1 leds=100 FAIL 31 ms class=decode_mismatch cval2=27599 cval3=27633 citer=1696 (was 4096) -> 2400 minor loops fired = one full WS2812 frame captured decode_mismatch (not zero_capture) is real progress and the next debugging surface is decoder-side, not RX-side. PASS still requires the captured bytes to match the expected pattern. Refs: #3359 Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
… reconfig (#3402) Combines the routing fix from the reverted #3400 with the actual DMA defensive sequence that makes it safe across multiple test patterns. 1. Pin 8 SELECT_INPUT 0 -> 4 (GPIO_B1_00 = pin 8 per i.MX RT1062 IOMUXC_FLEXPWM1_PWMA3_SELECT_INPUT table). 2. configureDma() now disables the DMA channel and clears any pending completion / interrupt / error flag before rewriting the TCD. Each capture() call invokes configureDma() afresh, and the previous pattern may have left ERQ set with an in-flight minor loop. Modifying the TCD while a transfer is active is undefined behavior on i.MX RT eDMA and was the trigger for the runSingleTest hang / DACCVIOL we saw the first time pin 8 SELECT_INPUT actually pointed at the pin (#3401 revert evidence). Quiescing first makes the re-arm safe and the dmaIsr completion path can stay attached. Hardware result (bash autoresearch teensy41 --object-fled --tx-pin 22 --rx-pin 8 --timeout 60 --skip-lint, two consecutive runs): Run 1: TEST OBJECT_FLED lanes=1 leds=100 FAIL 31 ms class=decode_mismatch cval2=27520 cval3=27554 citer=1696 Run 2: TEST OBJECT_FLED lanes=1 leds=100 FAIL 31 ms class=decode_mismatch cval2=27635 citer=1696 Deterministic. No hang, no crash. Each test pattern captures one full WS2812 frame (2400 minor loops out of the 4096-CITER buffer) and the decoder can now operate on real edge data. Bytes-decoded is still 0/300 - that is a decoder/timing issue, not an RX-path issue, and will be addressed in a follow-up. Refs: #3359 Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
…estore decode diagnostics (#3403) The FlexPWM RX wait() loop was sampling CITER at wait-entry and declaring TIMEOUT when CITER had not changed since. But capture() calls FastLED.wait() BEFORE rx_channel->wait() -- by the time we enter wait() the TX has already completed and the RX DMA may have already drained one frame. CITER at wait-entry == CITER now, so dma_progressed = false, so wait() returns TIMEOUT, so capture() returns 0 without ever decoding the perfectly-good buffer. Switched to comparing against `mArmedCiter`, captured at configureDma() right after BITER is set. Now wait() correctly returns SUCCESS whenever DMA progressed since arm, regardless of whether the progress happened before or during the wait() call itself. Also re-introduces the decode-side RunResult fields that were collateral damage of the #3390 revert: decodeOk, decodeError, decodeBytes, decodeOutputCapacity, rawEdgeSample. context.py renders them, and AutoResearchRemoteRunSingleTest emits them under each pattern. Without these fields the failure was opaque - they are what proved decode was never called. Hardware result (bash autoresearch teensy41 --object-fled --tx-pin 22 --rx-pin 8 --timeout 60 --skip-lint): TEST OBJECT_FLED lanes=1 leds=100 FAIL 32 ms class=decode_mismatch Captured bytes: 300/300 Decode status: ok=1 error=-1 bytes=300/3300 Byte corruption: 0.3%-1.3% per pattern, 0.6% aggregate (7/1200) Driver now produces nearly-correct WS2812 output end-to-end on the canonical TX22 -> RX8 loopback. Sub-1% byte corruption is a timing tolerance or single-bit-flip issue, not a structural defect. Refs: #3359 Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
Three more FlexPWM input-capture daisy-chain values were wrong -- same class of bug as #3402's pin 8 fix. Independent audit (subagent A) cross-checked every pin in the kPinMap[] against the i.MX RT1062 IOMUXC_FLEXPWM*_SELECT_INPUT tables and identified these three: Pin | Pad | Register | Was | Should be ----+-----------------+------------------------------------------+-----+----------- 22 | GPIO_AD_B1_08 | IOMUXC_FLEXPWM4_PWMA0_SELECT_INPUT | 0 | 1 23 | GPIO_AD_B1_09 | IOMUXC_FLEXPWM4_PWMA1_SELECT_INPUT | 0 | 1 36 | GPIO_B1_02 | IOMUXC_FLEXPWM2_PWMA3_SELECT_INPUT | 1 | 4 With the wrong DAISY value the FlexPWM submodule listens to an unrelated pad, so any AutoResearch run that uses one of these pins as RX would silently fail with zero capture -- exactly the signature pin 8 produced before #3402. The canonical TX 22 -> RX 8 test is unaffected (it uses pin 8 as RX, which is already correct). Hardware sanity-checked: the test still reports `class=decode_mismatch` with 99.4% bit accuracy (8/1200 byte corruption) -- no regression. Subagent A also confirmed every other pin in kPinMap[] is correct: pins 2, 4, 5, 6, 8, 29, 49, 53, 54. Audit cross-references: - i.MX RT1062 IOMUXC daisy-chain tables (chapter on IOMUXC) - Teensy core imxrt.h IOMUXC_FLEXPWM*_SELECT_INPUT defines - pwm.c xbar_connect() implementation - Existing diagnostic snapshot evidence (flexPwmRxDiagnostics) Refs: #3359 Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (47)
📝 WalkthroughWalkthroughTeensy AutoResearch gains structured JSON RPC output, stricter host-side validation, new legacy and pin-selection options, and updated ObjectFLED/FlexPWM diagnostics. Channel data now carries explicit pixel-format metadata, and the runtime-output linting path is extended for AutoResearch sources. ChangesChannel pixel-format contract
AutoResearch RPC payloads
AutoResearch host setup and validation
Runtime-output linting
Sequence Diagram(s)sequenceDiagram
participant Phases as ci.autoresearch.phases
participant RpcClient
participant SingleTest as AutoResearchRemoteRunSingleTest
participant ParallelTest as AutoResearchRemoteRunParallelTest
participant Context as ci.autoresearch.context
Phases->>RpcClient: send runSingleTest / runParallelTest
RpcClient->>SingleTest: invoke RPC
RpcClient->>ParallelTest: invoke RPC
SingleTest-->>RpcClient: JSON response with capture evidence
ParallelTest-->>RpcClient: JSON response with totals and evidence
RpcClient-->>Phases: responses
Phases->>Context: display_pattern_details / display_objectfled_diagnostics
Estimated code review effort🎯 5 (Critical) | ⏱️ ~90+ minutes Possibly related issues
Possibly related PRs
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Summary
Consolidates 48 commits of Teensy LED driver bring-up work into
master. Squash-merge intended — the individual PRs (#3351–#3404) tell the diagnostic story but the consolidated change is one logical unit: getting ObjectFLED + FlexPWM RX + AutoResearch to where the canonical TX 22 → RX 8 loopback decodes 300/300 bytes per pattern at 99.3% bit accuracy.What changed
ObjectFLED driver (
src/third_party/object_fled/)ChannelEngineObjectFLED::poll()now waits for DMA + latch completion (fix(objectfled): drain DMA before ready #3376).FlexPWM input-capture RX driver (
src/platforms/arm/teensy/teensy4_common/rx_flexpwm_channel.cpp.hpp)zero_captureregardless of how good TX was.configureDma()now quiesces the DMA channel (disable + clearComplete + clearInterrupt + clearError) before rewriting the TCD, eliminating the DACCVIOL crash + 120 s hang that occurred when actual edges started flowing (fix(teensy4-rx): pin 8 SELECT_INPUT=4 + DMA quiesce before TCD reconfig #3402).wait()now compares CITER against the value captured at arm time (mArmedCiter), not at wait-entry — was returning false TIMEOUT for already-completed captures becauseFastLED.wait()had drained the TX beforerx_channel->wait()was called (fix(teensy4-rx): wait() compares CITER against arm time; restore decode diagnostics — 300/300 bytes decoded #3403).AutoResearch harness (
ci/autoresearch/,examples/AutoResearch/)runSingleTest/runParallelTestPASS must now carry explicit driver name, requested + actual pins, capture backend, nonzero capture evidence, andtotalTests > 0/passedTestsmatch ([codex] Harden AutoResearch test RPC acceptance #3362–[codex] Classify AutoResearch hardware failures #3366).setPinsfor the effective pair, visible FlexIO TX mux substitution, blocked stale.pioupload paths, mapped Teensy SPI selector →SPI_UNIFIEDregistered name ([codex] Sync AutoResearch default pins with firmware #3367–[codex] Map Teensy AutoResearch SPI to SPI_UNIFIED #3373).captureWaitResult,rawEdgesAfterWait,decodeOk,decodeError,decodeBytes,decodeOutputCapacity, and a compactrawEdgeSample(fix(teensy4-rx): wait() compares CITER against arm time; restore decode diagnostics — 300/300 bytes decoded #3403).FL_PRINT/FL_WARN/raw Serial calls in AutoResearch runtime paths; setup-onlyfl::serial_beginallowed but runtime output must use JSON-RPC (fix(autoresearch): block stale Teensy preupload #3371, [codex] Guard ObjectFLED runtime output paths #3386).Diagnostics (read-only)
objectFledDiagnostics: register-level snapshots atbeforeBegin/afterBegin/beforeShow/afterShowReturn/afterFastLedWait/afterFastLedClear. Includes per-pin pad/mux/mode/PSR, GPR26..29, CCM_CCGR0..3, TMR4 ch0..2 control/count/compare, XBARA1 SEL0/SEL1 + control, DMA ERQ/HRS/INT/ERR/ES + per-channel TCD, and the configured RX pin's fast + standard PSR sampled at every stage (diag(objectfled): attach register snapshots #3374, diag(objectfled): snapshot XBARA1_SEL0/SEL1 (correct timer→DMA wiring registers) #3393, diag(objectfled): snapshot RX pin PSR inside every diagnostic event — proves TX reaches pad #3399).flexPwmRxDiagnostics: live FlexPWM submodule state (MCTRL, CTRL, CTRL2, DMAEN, CAPTCTRLA/B, CAPTCOMPA/B, CVAL2..5), DMA channel + DMAMUX state, full TCD descriptor, and the RX pin's pad/mode/PSR/GPR snapshot (diag(teensy4): emit FlexPWM RX register snapshot on every runSingleTest #3391, diag(teensy4): include RX pin PAD + fast/standard GDIR/PSR/GPR in flexpwm-rx-diag #3398).standardGpioPadProbe: software-driven TX via standard GPIO1..4 alias withdigitalReadFaston RX, including a 50-iteration zero-delay fast-toggle test. Saves and restores all touched state; cannot disturb the subsequent ObjectFLED test (diag(autoresearch): add standard-GPIO direct-drive pad probe (#3359 progress) #3392, diag(autoresearch): add tight-loop fast-toggle phase to standard-GPIO pad probe #3394).Test coverage
Hardware result (canonical TX 22 → RX 8 loopback)
Sub-1% byte corruption is random 0→1 bit flips at different LED/bit positions per run — the most plausible remaining causes are an unproven MLOFF DMA-race or soldered-loopback signal integrity. Not strict PASS yet; tracked in #3359.
Test plan
bash test --unit→ 254/254 passedbash lint→ cleanbash autoresearch teensy41 --object-fled --tx-pin 22 --rx-pin 8 --timeout 60 --skip-lint→ deterministicclass=decode_mismatch, 300/300 bytes decoded, sub-1% byte corruption, no hang/crash.How to read the merged history
If you want the diagnostic chronology, follow PR numbers #3351 → #3404 on
teensy-fix. The bisection that isolated the pin 8 SELECT_INPUT bug as the root cause ofzero_captureis captured in #3391 → #3392 → #3393 → #3394 → #3398 → #3399 → #3402.Refs: #3359 #3353
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Tests