Repository navigation
fix(autoresearch): widen SPI+DMA harness gate to LPC804 (#3456 follow-up) - #3505
Conversation
…-up) The underlying driver `spi_arm_lpc_dma.h` was widened to LPC804 in #3500 once fbuild >= 2.3.16 ships the vendor DMA0 typedef, but the AutoResearch harness gate stayed LPC845-only — so LPC804 users can never exercise the `dmaSpi*` RPCs even with `FASTLED_LPC_SPI_DMA=1` set. Changes: - Widen `AutoResearchSpiDma.h` self-gate from `FL_IS_ARM_LPC_845` to `(FL_IS_ARM_LPC_845 || FL_IS_ARM_LPC_804)`. Header comments now note the F_CPU delta (24 MHz vs 15 MHz → default divider 6 yields 4 MHz vs 2.5 MHz SCK). - Widen `AutoResearchLowMemory.h` include + bind gates to match. The compile-time mutex against `FASTLED_LPC_PWM_DMA` stays LPC845-only (LPC804 has no PWM+DMA clockless driver), so the LPC804 path never triggers the collision. - Add `LPC_DMA_SPI_ENVS = LPC_WS2812_ENVS | {"lpcxpresso804"}` in `ci/autoresearch/phases.py` and switch the phase gate + error message to use it. - Pass `--core-hz` to `test_lpc_dma_spi.py` based on the target environment (15_000_000 for lpcxpresso804, else 24_000_000) so the SCK measurement band is centered correctly on LPC804 too. - Update `--dma-spi` `--help` text to note LPC804 support + the fbuild release prerequisite. Verified: WASM AutoResearch compile clean, `bash lint` clean. 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 (4)
📝 WalkthroughWalkthroughThis PR extends the LPC845-only SPI+DMA AutoResearch harness to also support LPC804 boards. CLI help text, CI environment sets, and dispatch logic are updated to accept LPC804, with a per-board core clock (15 MHz vs 24 MHz) passed through to the test runner. Firmware compile-time guards in the example headers are widened accordingly. ChangesLPC804 SPI+DMA Support
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related issues
Possibly related PRs
✨ 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 |
…3507) Adds `agents/docs/peripheral-existence.md` requiring agents to verify any `<Peripheral>_Type` typedef / `<Peripheral>_BASE` address is actually present in BOTH the vendor CMSIS PAL header for the specific chip variant AND the chip datasheet chapter before writing driver code against it. If either source is absent, halt development and report on the driving issue; do NOT fabricate the missing typedef in the vendor header repo to make the build compile. Cross-linked from: - `agents/docs/register-maps.md` (pre-flight before shim tier decisions) - `.claude/agents/platform-port-agent.md` (description + Step 5 + Key Rules) - `.claude/skills/platform-port/SKILL.md` (LED Output Drivers section) - `CLAUDE.md` "Read the Right File for Your Task" table row Discoverable by grep for: DMA, async driver, phantom peripheral, peripheral existence, vendor CMSIS, FSL_FEATURE_SOC. Canonical anti-example is the four-PR LPC804 phantom-`DMA_Type` cascade (framework-arduino-lpc8xx#35, fbuild#916, #3500, #3505) — LPC804 silicon has no DMA peripheral; NXP's own `LPC804.h` has zero `DMA_Type` / `DMA0_BASE` / `FSL_FEATURE_SOC_DMA_COUNT`, but an agent fabricated one at reserved AHB slot `0x50008000` so downstream driver code would compile. Doc includes copy-pasteable verification recipe (grep vendor CMSIS header + features + drivers dir) plus a false-negative guard so verification of absence is as rigorous as verification of presence. Closes #3506. Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
…MA silicon (#3513) Reverts the FastLED-side of the phantom LPC804 DMA cascade (PRs #3500 + #3505). LPC804 silicon has no DMA peripheral. Empirical evidence: - NXP's own `mcux-sdk/devices/LPC804/LPC804.h`: zero `DMA_Type` typedef, zero `DMA0_BASE` macro. Only `CRC_BASE = 0x50000000` in the 0x5000_xxxx AHB range; 0x50008000 is a reserved slot. - `LPC804_features.h`: no `FSL_FEATURE_SOC_DMA_COUNT`. LPC845's file has `FSL_FEATURE_SOC_DMA_COUNT = 1` and `FSL_FEATURE_DMA_NUMBER_OF_CHANNELS = 25`. - `devices/LPC804/drivers/`: no `fsl_inputmux_connections.h`. LPC845's driver dir has it (INPUTMUX exists to route peripheral requests to DMA channels — no DMA, no INPUTMUX). - UM11065 has only 3 DMA references, all copy-paste leftovers in ADC / DAC / CAPT / I2C / SPI comment blocks referring to "DMA trigger flags" for a peripheral that does not exist on this die. Diagnosis credit @phatpaul (#3499 comment 4855252061). The revert follows the guardrail landed in #3506 / #3507 (`agents/docs/peripheral-existence.md`). ## Changes - `src/platforms/arm/lpc/spi_arm_lpc_dma.h` — narrow build gate back to `FL_IS_ARM_LPC_845` only. Add a compile-time `#error` that fires with a clear "LPC804 has no DMA" diagnostic + link to peripheral-existence guardrail if a user tries to opt into `FASTLED_LPC_SPI_DMA` on LPC804. Delete the earlier "LPC804 vendor CMSIS PAL prerequisite" text and the LPC804-specific `FASTLED_LPC_SPI_DMA_CHANNEL` default (0 → dropped; the LPC845 default of 4 stands). - `examples/AutoResearch/AutoResearchSpiDma.h` — narrow harness gate back to LPC845 only. - `examples/AutoResearch/AutoResearchLowMemory.h` — narrow include + bind gates back to LPC845 only. - `ci/autoresearch/phases.py` — collapse `LPC_DMA_SPI_ENVS` back to `LPC_WS2812_ENVS` (LPC845 environments only). Drop the `is_lpc804 → core_hz = 15_000_000` branch (always 24 MHz now). - `ci/autoresearch/args.py` — update `--dma-spi` `--help` text: drop LPC804 mention + fbuild prerequisite; note LPC804 not supported. - `src/platforms/arm/lpc/README.md` — LPC804 row now clearly documents "no DMA-async SPI" with citation to the guardrail. `spi_arm_lpc_dma.h` files entry marked LPC845-only. Feature-defines section corrected. References/Shipped entry for #3500 strikethrough-annotated with "REVERTED — see peripheral-existence.md." Follow-up (out of scope for this PR): - Revert `framework-arduino-lpc8xx#35` (the fabricated `DMA_Type` in `variants/lpc804/LPC804.h`). - Revert or supersede `fbuild#916` (bumped ArduinoCore-LPC8xx pin for the fabricated typedef). - Close FastLED #3499 as INVALID. ## Verification - `bash compile wasm --examples AutoResearch` — clean - `bash lint` — python_pipeline passes; cpp_linting fails only on the same pre-existing Rust-binary silent-fail this Windows environment has (unrelated to this diff; see #3510) Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
Summary
The underlying driver
spi_arm_lpc_dma.hwas widened to LPC804 in #3500 once fbuild ≥ 2.3.16 ships the vendor DMA0 typedef, but the AutoResearch harness gate stayed LPC845-only — so LPC804 users can never exercise thedmaSpi*RPCs even withFASTLED_LPC_SPI_DMA=1set.Direct follow-up to #3503 (which landed the harness) and #3500 (which widened the driver gate).
Changes
AutoResearchSpiDma.hself-gate fromFL_IS_ARM_LPC_845to(FL_IS_ARM_LPC_845 || FL_IS_ARM_LPC_804). Header comments now note the F_CPU delta (24 MHz vs 15 MHz → default divider 6 yields 4 MHz vs 2.5 MHz SCK).AutoResearchLowMemory.hinclude + bind gates to match. The compile-time mutex againstFASTLED_LPC_PWM_DMAstays LPC845-only (LPC804 has no PWM+DMA clockless driver), so the LPC804 path never triggers the collision.LPC_DMA_SPI_ENVS = LPC_WS2812_ENVS | {\"lpcxpresso804\"}inci/autoresearch/phases.pyand switch the phase gate + error message to use it.--core-hztotest_lpc_dma_spi.pybased on the target environment (15_000_000 forlpcxpresso804, else 24_000_000) so the SCK measurement band is centered correctly on LPC804 too.--dma-spi--helptext to note LPC804 support + the fbuild release prerequisite.Test plan
bash compile wasm --examples AutoResearch— cleanbash lint— cleanbash autoresearch lpcxpresso804 --dma-spi— pending silicon + fbuild ≥ 2.3.16Related
spi_arm_lpc_dma.hgate to LPC804framework-arduino-lpc8xx#35— vendor DMA0 typedef prerequisitefbuild#916— bump ArduinoCore-LPC8xx pin for the DMA0 blockCo-Authored-By: Claude Opus 4.7 (1M context) [email protected]
Generated with Claude Code
Summary by CodeRabbit
New Features
Bug Fixes