Skip to content

revert(lpc): remove LPC804 from SPI+DMA driver gate — LPC804 has no DMA silicon - #3513

Merged
zackees merged 1 commit into
masterfrom
revert/lpc804-phantom-dma-cascade
Jul 1, 2026
Merged

revert(lpc): remove LPC804 from SPI+DMA driver gate — LPC804 has no DMA silicon#3513
zackees merged 1 commit into
masterfrom
revert/lpc804-phantom-dma-cascade

Conversation

@zackees

@zackees zackees commented Jul 1, 2026

Copy link
Copy Markdown
Member

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:

Signal LPC845 LPC804
mcux-sdk/devices/<CHIP>/<CHIP>.h grep count of DMA_Type 2 0
<CHIP>_BASE macro for DMA0 present (0x50008000) absent
FSL_FEATURE_SOC_DMA_COUNT in <CHIP>_features.h 1 absent
fsl_inputmux_connections.h in devices/<CHIP>/drivers/ present absent

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 0x50008000 is 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 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 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)

Verification

Test plan

  • Grep confirms zero LPC804 references remain in spi_arm_lpc_dma.h gate (only in documentation explaining why it's not supported)
  • Grep confirms zero LPC804 references in AutoResearchSpiDma.h / AutoResearchLowMemory.h gates
  • LPC_DMA_SPI_ENVS == LPC_WS2812_ENVS in phases.py
  • Follow-up PR for framework-arduino-lpc8xx#35 revert

Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes

    • Clarified that DMA-based SPI support is available only on LPC845 boards, and LPC804 now shows a clear unsupported message.
    • Improved build-time checks so invalid board/configuration combinations fail earlier with more direct guidance.
  • Documentation

    • Updated help text, examples, and platform docs to match the current supported hardware and default DMA channel guidance.

…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>
@zackees
zackees merged commit 01622e6 into master Jul 1, 2026
8 of 11 checks passed
@coderabbitai

coderabbitai Bot commented Jul 1, 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: fa0aa9f2-43dd-471d-82ba-62b4f9fee0d9

📥 Commits

Reviewing files that changed from the base of the PR and between 8d69069 and 5c13e20.

📒 Files selected for processing (6)
  • ci/autoresearch/args.py
  • ci/autoresearch/phases.py
  • examples/AutoResearch/AutoResearchLowMemory.h
  • examples/AutoResearch/AutoResearchSpiDma.h
  • src/platforms/arm/lpc/README.md
  • src/platforms/arm/lpc/spi_arm_lpc_dma.h

📝 Walkthrough

Walkthrough

This PR reverts prior LPC804 SPI+DMA support, restricting FASTLED_LPC_SPI_DMA compilation to LPC845 only. Changes span the core driver header, AutoResearch example harnesses, CI autoresearch scripts/args, and README documentation, adding an explicit compile-time error for LPC804 usage.

Changes

LPC845-only SPI+DMA gating revert

Layer / File(s) Summary
Core driver gating and diagnostics
src/platforms/arm/lpc/spi_arm_lpc_dma.h
Preprocessor gating requires FL_IS_ARM_LPC_845; a new #error triggers on LPC804 + FASTLED_LPC_SPI_DMA; documentation, resource notes, and class brief updated to LPC845-only.
AutoResearch example gating
examples/AutoResearch/AutoResearchLowMemory.h, examples/AutoResearch/AutoResearchSpiDma.h
Combined LPC845/LPC804 preprocessor conditions replaced with LPC845-only guards; comments updated to state LPC804 lacks DMA.
CI autoresearch harness and args update
ci/autoresearch/phases.py, ci/autoresearch/args.py
LPC_DMA_SPI_ENVS narrowed to LPC845; --dma-spi dispatcher rejects LPC804 with updated message; bench clock/channel logic fixed to LPC845; help text updated.
README documentation update
src/platforms/arm/lpc/README.md
Supported platforms table, spi_arm_lpc_dma.h entry, feature defines, and shipped history updated to reflect LPC845-only support and the reverted gate-widening attempt.

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
Loading

Possibly related issues

Possibly related PRs

  • FastLED/FastLED#3500: This PR directly reverts the gate widening to LPC804 introduced there, restoring LPC845-only compilation with a new #error.
  • FastLED/FastLED#3502: This PR amends the SPI+DMA README documentation added there to state LPC845-only support and LPC804's compile-time error.
  • FastLED/FastLED#3503: Both PRs modify the same --dma-spi CI flow across ci/autoresearch/args.py, ci/autoresearch/phases.py, and the AutoResearch example headers.
✨ 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 revert/lpc804-phantom-dma-cascade

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.

@zackees
zackees deleted the revert/lpc804-phantom-dma-cascade branch July 1, 2026 15:25
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Jul 1, 2026
@fastled-project-sync fastled-project-sync Bot moved this from Triage to Done in FastLED Tracker Jul 1, 2026
zackees added a commit to FastLED/framework-arduino-lpc8xx that referenced this pull request Jul 1, 2026
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).
zackees added a commit to FastLED/fbuild that referenced this pull request Jul 1, 2026
 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>
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.

1 participant