revert(lpc): remove LPC804 from SPI+DMA driver gate — LPC804 has no DMA silicon - #3513
Conversation
…MA silicon 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) <noreply@anthropic.com>
|
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 (6)
📝 WalkthroughWalkthroughThis PR reverts prior LPC804 SPI+DMA support, restricting ChangesLPC845-only SPI+DMA gating revert
Estimated code review effort: 2 (Simple) | ~15 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant ArgsPy as args.py
participant PhasesPy as phases.py
participant Bench as _run_lpc_dma_spi_tests
User->>ArgsPy: pass --dma-spi flag
ArgsPy->>PhasesPy: parsed args with dma_spi=true
PhasesPy->>PhasesPy: check env in LPC_DMA_SPI_ENVS
PhasesPy-->>User: reject if LPC804 (no DMA peripheral)
PhasesPy->>Bench: run bench for LPC845 env
Bench-->>User: print LPC845 clock/channel defaults
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 |
Reverts #35. The original PR added a fabricated `DMA_Type` struct + `DMA0` pointer + `DMA_BASE_ADDRS` / `DMA_BASE_PTRS` arrays to `variants/lpc804/LPC804.h`, claiming to match a real peripheral at 0x50008000. That claim was empirically wrong — LPC804 silicon has no DMA peripheral. ## Empirical evidence NXP's own official CMSIS PAL from 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**. - `devices/LPC804/LPC804_features.h` — no `FSL_FEATURE_SOC_DMA_COUNT`. Compare LPC845's file which has `FSL_FEATURE_SOC_DMA_COUNT = 1` + `FSL_FEATURE_DMA_NUMBER_OF_CHANNELS = 25`. - `devices/LPC804/drivers/` — no `fsl_inputmux_connections.h`. LPC845 has it — INPUTMUX exists to route peripheral requests to DMA channels, and no DMA means no INPUTMUX. - UM11065 — 3 DMA references total, all copy-paste leftovers in ADC/DAC/CAPT/I2C/SPI comment blocks. No dedicated DMA chapter. ## Diagnosis + guardrail Diagnosed by @phatpaul in FastLED/FastLED#3499 comment 4855252061 with a UM11065 grep + memory-map inspection. FastLED-side revert cascade in FastLED/FastLED#3513. FastLED#3499 closed as INVALID. Preventive guardrail added: FastLED/FastLED PR #3506 / #3507 (`agents/docs/peripheral-existence.md`). Agents must now grep vendor CMSIS + features flags + drivers/ for the peripheral before writing any code that names its typedef. All four "absent" → HALT. Refs: FastLED/FastLED#3513, FastLED/FastLED#3499, FastLED/fbuild#916 (the fbuild pin bump that pulled this phantom typedef in, also needs reverting).
follow-up) (#918) Bumps `ACLPC_COMMIT` past `FastLED/framework-arduino-lpc8xx#35` (the phantom LPC804 `DMA_Type` addition) to the revert HEAD `8836a9bb08c77273758776aa3e8a233e97ff97cf`, which is the tip of `main` after `FastLED/framework-arduino-lpc8xx#36` (revert) merged. Also updates the `ACLPC_CHECKSUM` to the SHA256 of the archive tarball GitHub currently serves for the new SHA: `e74c2226873ccf5676096b8e28c8a9acc4af39894c7fc651ea320628a69281ec` (verified via `curl … | sha256sum`). Cleans the stale doc comment that used to justify the bump to 1179200 with the phantom-peripheral rationale. ## Why the revert LPC804 silicon has no DMA peripheral. NXP's own `mcux-sdk` sources confirm: - `devices/LPC804/LPC804.h` — zero `DMA_Type` typedef, zero `DMA0_BASE` - `devices/LPC804/LPC804_features.h` — no `FSL_FEATURE_SOC_DMA_COUNT` - `devices/LPC804/drivers/` — no `fsl_inputmux_connections.h` - UM11065 — 3 DMA hits total, all copy-paste leftovers, no DMA chapter 0x50008000 is a reserved AHB slot on LPC804. Diagnosed by @phatpaul in FastLED/FastLED#3499 comment 4855252061. FastLED-side revert cascade: FastLED/FastLED#3513. FastLED#3499 closed as INVALID. Preventive guardrail: FastLED/FastLED#3506 / #3507 (`agents/docs/peripheral-existence.md`) — agents must now grep vendor CMSIS + features flag + drivers/ before writing any driver code that names a `<Peripheral>_Type` typedef. All four "absent" → halt. Refs: FastLED/framework-arduino-lpc8xx#36 (upstream revert), FastLED/FastLED#3513, FastLED/FastLED#3499, FastLED/FastLED#3517 (meta issue Phase D). Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Reverts the FastLED-side of the phantom LPC804 DMA cascade (PRs #3500 + #3505). LPC804 silicon has no DMA peripheral.
Empirical evidence (per
agents/docs/peripheral-existence.md)Four independent signals from NXP's own sources all agree LPC804 has no DMA:
mcux-sdk/devices/<CHIP>/<CHIP>.hgrep count ofDMA_Type<CHIP>_BASEmacro forDMA00x50008000)FSL_FEATURE_SOC_DMA_COUNTin<CHIP>_features.h1fsl_inputmux_connections.hindevices/<CHIP>/drivers/LPC804 also has no dedicated DMA chapter in UM11065 — the 3 DMA hits in the whole 700+ page manual are 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. Address
0x50008000is a reserved AHB slot on LPC804.Diagnosis credit @phatpaul in #3499 comment 4855252061. The revert follows the guardrail landed in #3506 / #3507 (
agents/docs/peripheral-existence.md), which now automates the exact grep recipe that would have caught the fabrication before it shipped.Changes
src/platforms/arm/lpc/spi_arm_lpc_dma.h— narrow build gate back toFL_IS_ARM_LPC_845only. Add a compile-time#errorthat fires with a clear "LPC804 has no DMA" diagnostic + link to peripheral-existence guardrail if a user tries to opt intoFASTLED_LPC_SPI_DMAon LPC804. Delete the earlier "LPC804 vendor CMSIS PAL prerequisite" text and the LPC804-specificFASTLED_LPC_SPI_DMA_CHANNELdefault (0→ dropped; the LPC845 default of4stands).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— collapseLPC_DMA_SPI_ENVSback toLPC_WS2812_ENVS(LPC845 environments only). Drop theis_lpc804 → core_hz = 15_000_000branch (always 24 MHz now).ci/autoresearch/args.py— update--dma-spi--helptext: 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.hfiles entry marked LPC845-only. Feature-defines section corrected. References/Shipped entry for feat(lpc): widen spi_arm_lpc_dma.h gate to include LPC804 (#3499) #3500 strikethrough-annotated with "REVERTED — see peripheral-existence.md."Follow-up (out of scope for this PR)
framework-arduino-lpc8xx#35(the fabricatedDMA_Typeinvariants/lpc804/LPC804.h).fbuild#916(bumped ArduinoCore-LPC8xx pin for the fabricated typedef).Verification
bash compile wasm --examples AutoResearch— cleanbash 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 fix(lint): stream Rust build stdout/stderr + replace deprecated os.system in ci/ #3510)Test plan
spi_arm_lpc_dma.hgate (only in documentation explaining why it's not supported)AutoResearchSpiDma.h/AutoResearchLowMemory.hgatesLPC_DMA_SPI_ENVS == LPC_WS2812_ENVSinphases.pyframework-arduino-lpc8xx#35revertCo-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com
Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Documentation