Repository navigation
feat(lpc): consume vendor NXP CMSIS PAL, delete 5/8 hand-rolled register maps (closes #3437) - #3438
Conversation
First step of the meta #3437 plan to remove all hand-rolled LPC register maps. Vendors NXP's CMSIS Peripheral Access Layer for LPC845 (rev. 1.2, BSD-3-Clause) into src/platforms/arm/lpc/cmsis/ from upstream nxp-mcuxpresso/mcux-sdk @ SHA 8a289764. Purely additive — no existing call sites changed. Subsequent PRs will wire the header into led_sysdefs_arm_lpc.h (V5), then delete the three LPC845 PWM+DMA shims (FL_LPC_SCT_Shim, FL_LPC_DMA_Shim, FL_LPC_SYSCON_Shim) and migrate call sites to the vendor typedefs (SCT_Type, DMA_Type, SYSCON_Type) (V6). Verified against the new vendor header: - SYSCON_Type.SYSAHBCLKCTRL0 is at offset 0x80 — confirms @phatpaul's #3349 fix (_resv0[16]→[32]) is correct. The pre-#3349 master shim places it at 0x40, which is wrong. - DMA_Type.CHANNEL[].CFG/CTLSTAT/XFERCFG layout matches the shim's FL_LPC_DMA_ChannelShim member offsets. But the common-register block uses DMA0->COMMON[0].INTENSET (not LPC_DMA->INTENSET0) — the V6 call-site migration must rename these. - SCT_Type has each of LIMIT/HALT/STOP/START as a SINGLE 32-bit register (with optional 16-bit access via an inner union). The FL_LPC_SCT_Shim splits each into _L/_H 32-bit pairs (8 bytes each), which shifts every member from COUNT onwards 16 bytes too high. The driver does not (yet) dereference COUNT/STATE/INPUT/etc., so this hidden offset bug has not manifested — but it is a latent defect that vendoring eliminates structurally. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe LPC platform README now lays out a tiered plan for sourcing vendor device headers and removing hand-rolled register access. The LPC system header now includes vendor LPC845/LPC804 device headers, and LPC8xx board/platform pins point to a new platform revision. ChangesLPC Platform README Remediation Plan
LPC Header and Platform Pins
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related issues
Possibly related PRs
🚥 Pre-merge checks | ✅ 2 | ❌ 3❌ Failed checks (3 warnings)
✅ Passed checks (2 passed)
✨ Finishing Touches🧪 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 |
Stop-hook lint flagged the vendored NXP LPC845.h with 2342 violations
(uint32_t use, namespace fl, IWYU pragma private, banned <stdint.h>,
plain enum) — all FastLED house-style rules that don't apply to
byte-identical-with-upstream vendored code.
Two-part fix:
1. Move src/platforms/arm/lpc/cmsis/ → src/platforms/arm/lpc/third_party/cmsis/
so that path-substring `/third_party/` triggers the exemptions
already wired into BareLegacy, PlatformTrampoline, PlatformPolicy
checkers etc.
2. Add the same `/third_party/` exemption to the three checkers that
were missing it:
- BannedHeadersChecker (test_structure.rs) — banned-header rules
don't apply to vendor code
- PlatformsFlNamespaceChecker (platform_policy.rs) — vendor code
uses upstream namespacing (no `namespace fl`)
- IwyuPragmaPrivateChecker (bare_legacy.rs) — vendor code uses
its own include pragmas
Updated `agents/docs/register-maps.md` to codify the path convention:
the vendored chip header now lives at
`src/platforms/<arch>/<vendor>/third_party/cmsis/<chip>.h`.
Lint goes from 2342 violations to 0 (PlatformIO-internal-usage warn-only
hits in unrelated files are pre-existing, see #2701).
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/platforms/arm/lpc/README.md (1)
82-86: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winUpdate the Tier-2 milestone path to match the actual vendored location.
The milestone description says to drop headers into
src/platforms/arm/lpc/cmsis/, but the vendored files actually landed underthird_party/cmsis/(per lines 60-71 and commit messages). Update this path tosrc/platforms/arm/lpc/third_party/cmsis/so the tracking document stays consistent with the file tree.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/platforms/arm/lpc/README.md` around lines 82 - 86, The Tier-2 vendoring milestone path in the LPC README is inconsistent with the actual vendored location. Update the referenced destination in the milestone text from src/platforms/arm/lpc/cmsis/ to src/platforms/arm/lpc/third_party/cmsis/ so it matches the current file tree and stays aligned with the CMSIS vendoring notes.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@src/platforms/arm/lpc/README.md`:
- Around line 82-86: The Tier-2 vendoring milestone path in the LPC README is
inconsistent with the actual vendored location. Update the referenced
destination in the milestone text from src/platforms/arm/lpc/cmsis/ to
src/platforms/arm/lpc/third_party/cmsis/ so it matches the current file tree and
stays aligned with the CMSIS vendoring notes.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: ac290dc0-a313-4a21-ac27-a640223d5199
📒 Files selected for processing (8)
agents/docs/register-maps.mdci/lint_cpp_rs/src/checkers/bare_legacy.rsci/lint_cpp_rs/src/checkers/platform_policy.rsci/lint_cpp_rs/src/checkers/test_structure.rssrc/platforms/arm/lpc/README.mdsrc/platforms/arm/lpc/third_party/cmsis/LPC845.hsrc/platforms/arm/lpc/third_party/cmsis/README.mdsrc/platforms/arm/lpc/third_party/cmsis/system_LPC845.h
💤 Files with no reviewable changes (1)
- src/platforms/arm/lpc/third_party/cmsis/system_LPC845.h
✅ Files skipped from review due to trivial changes (2)
- src/platforms/arm/lpc/third_party/cmsis/README.md
- agents/docs/register-maps.md
…LPC8xx The ArduinoCore-LPC8xx platform package that fbuild uses ships a 54-line LPC845.h stub (IRQn_Type + CMSIS-Core constants only — no peripheral typedefs) plus a hand-rolled `cores/lpc8xx/lpc8xx_registers.h` covering SYSCON/IOCON/SWM/USART/SPI (no SCT, no DMA, and itself buggy for the LPC845 SYSCON layout — documented in that file's own comments). FastLED vendored NXP's full LPC845.h in commits 0365745 + c047a58 to fill that gap. Discussion concluded that the upstream fix is preferable: get the ArduinoCore-LPC8xx package to ship NXP's full vendor LPC845.h directly, which lets FastLED stay on tier-1 (`#include <LPC845.h>`) per agents/docs/register-maps.md with zero vendoring. This commit reverts: - Drops src/platforms/arm/lpc/third_party/cmsis/ (vendored LPC845.h, system_LPC845.h, cmsis README) - Drops the third_party/ exemption additions to BannedHeadersChecker, PlatformsFlNamespaceChecker, IwyuPragmaPrivateChecker (no longer needed without the vendored files) - Reverts agents/docs/register-maps.md to its master state - Updates src/platforms/arm/lpc/README.md to document the new path: tier-1 via upstream-fix-first, tier-2 vendoring only if upstream declines The hand-rolled register-map audit list (8 sites across 6 files) and the #3437 meta-tracking reference are preserved — they remain the canonical inventory for whatever path lands. Tracking issue against the upstream package will be filed separately. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Step 3 (foundation) of FastLED #3437. Bumps _NXPLPC_PLATFORM SHA in ci/boards.py and platformio.ini from 2ee527ae to 12265f76 — the merged tag of zackees/platform-nxplpc-arduino v0.2.0, which pins framework-arduino-lpc8xx to zackees/ArduinoCore-LPC8xx @ 50d76e0d. That ArduinoCore-LPC8xx SHA ships the full NXP CMSIS PAL in variants/lpc845/LPC845.h and variants/lpc804/LPC804.h (steps 1 + 2 of #3437, already merged upstream). Adds #include <LPC845.h> and <LPC804.h> to led_sysdefs_arm_lpc.h behind FL_IS_ARM_LPC_845 / FL_IS_ARM_LPC_804 guards. Brings peripheral typedefs (SCT_Type, DMA_Type, SYSCON_Type, SPI_Type, GPIO_Type, etc.) and pointer macros (SCT0, DMA0, SYSCON, SPI0, SPI1) into scope for all FastLED LPC drivers. The existing hand-rolled shims (FL_LPC_SCT_Shim, FL_LPC_DMA_Shim, FL_LPC_SYSCON_Shim, FL_LPC_SPI_Type, etc.) remain in place for now; they coexist with the vendor types under different names. Subsequent commits in this PR delete each shim and migrate the call sites. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@platformio.ini`:
- Line 190: The root platformio.ini platform pin changes are missing the
required audit-trail comments. Update each modified platform = entry in
platformio.ini so it is immediately accompanied by adjacent ; justification: and
; added-in: comments, following the repo’s frozen-root rules. Use the existing
platform pin entries as the anchor points and add the required rationale/version
metadata for every changed non-comment line, including the block covering the
other modified platform lines referenced in this review.
In `@src/platforms/arm/lpc/led_sysdefs_arm_lpc.h`:
- Around line 102-105: The unconditional vendor-header include in
led_sysdefs_arm_lpc.h blocks the existing no-CMSIS fallback path used by
clockless_arm_lpc_pwm_dma.h and led_sysdefs.h. Make the LPC845/LPC804 include
path optional at this boundary by guarding the direct <LPC845.h>/<LPC804.h>
includes behind a suitable availability check or fallback macro, so environments
without the CMSIS headers can still parse through the led_sysdefs entrypoint.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: fbc2a22b-44af-4cab-b418-709607ea8bab
📒 Files selected for processing (3)
ci/boards.pyplatformio.inisrc/platforms/arm/lpc/led_sysdefs_arm_lpc.h
IwyuPragmaBlockChecker requires angle-bracket system headers to be gated by '// IWYU pragma: begin_keep' / 'end_keep'. The vendor PAL headers are unconditional requirements when the corresponding chip is detected, so keep-block is the correct directive. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Sites 1, 2, 3, 4 of FastLED #3437 audit list — clockless_arm_lpc_pwm_dma.h and spi_arm_lpc.h migrated to canonical NXP CMSIS PAL types/pointers. clockless_arm_lpc_pwm_dma.h: - Deletes FL_LPC_SCT_Shim, FL_LPC_DMA_Shim, FL_LPC_DMA_ChannelShim, FL_LPC_SYSCON_Shim and their #define LPC_SCT/LPC_DMA/LPC_SYSCON overrides - Deletes LPC_SCT_BASE/LPC_DMA_BASE/LPC_SYSCON_BASE #defines (vendor provides SCT0_BASE/DMA0_BASE/SYSCON_BASE) - Migrates all 26 call sites: LPC_SCT->... -> SCT0->... LPC_DMA->... -> DMA0->... LPC_SYSCON->... -> SYSCON->... LPC_SCT->MATCH[i].U -> SCT0->MATCH[i] (vendor stores as plain u32) LPC_SCT->MATCHREL[i].U -> SCT0->MATCHREL[i] LPC_SCT->LIMIT_L -> SCT0->LIMIT (vendor stores as plain u32) LPC_DMA->ENABLESET0 -> DMA0->COMMON[0].ENABLESET LPC_DMA->SETVALID0 -> DMA0->COMMON[0].SETVALID LPC_DMA->ACTIVE0 -> DMA0->COMMON[0].ACTIVE - Applies @phatpaul's #3349 DMA CHANNEL.CFG fix (was missing PERIPHREQEN bit, only setting HWTRIGEN). With vendor SYSCON_Type, the SYSAHBCLKCTRL0 bit-set in clockEnable() now writes to the correct hardware offset 0x80 (the pre-#3349 shim had it at 0x40). spi_arm_lpc.h: - Deletes FL_LPC_SPI_Type typedef; uses canonical vendor SPI_Type - FL_LPC_SPI0_BASE / FL_LPC_SPI1_BASE retained as aliases for the pSPIX template parameter (now defined as SPI0_BASE / SPI1_BASE from the vendor PAL) - All 6 SPI driver call sites now use SPI_Type via the pSPIX-cast pattern Three latent shim bugs structurally eliminated: 1. #3349 SYSAHBCLKCTRL0 offset (was 0x40, vendor truth: 0x80) 2. #3349 DMA CHANNEL.CFG missing PERIPHREQEN (now applied) 3. Newly uncovered SCT shim _L/_H pair bug (LIMIT/HALT/STOP/START were 8-byte pairs in the shim; vendor has them as single 4-byte regs). Every shim member from COUNT onwards was 16 bytes too high. Driver doesn't dereference those today, so this was latent — now impossible. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
…PUT/OUTPUT Site 7 of FastLED #3437 audit list — clockless_arm_lpc_plu.h migrated to canonical NXP PLU_Type / SYSCON_Type accesses. Discovered while migrating: the previous raw-offset constants had THREE register-block offsets wrong against UM11065 §12 (cross-checked against NXP vendor PLU_Type in LPC804.h): Block FastLED kept (wrong) NXP vendor truth LUT_TRUTH 0x000 0x800 OUTPUT_MUX 0x800 0xC00 LUT_INP_MUX 0xC00 0x000 The PLU driver code path is opt-in via FASTLED_LPC_PLU and has not been hardware-verified on LPC804 yet (#2880 hardware bring-up pending), which is why the bug had not surfaced. Vendoring the vendor PLU_Type eliminates it structurally — the new code uses PLU->LUT_TRUTH[i], PLU->LUT[i].INP_MUX[j], PLU->OUTPUT_MUX[i] and SYSCON->SYSAHBCLKCTRL0, all of which inherit correct offsets from the NXP-authored typedef. The WAKEINT_CTRL register (PLU_BASE + 0xFF8) is not included in the vendor PLU_Type (struct ends at OUTPUT_MUX[7] @ 0xC1C). The single disable-write to it uses a small helper that derives the address from the vendor PLU_BASE macro — keeps the migration unblocked without re-introducing a parallel offset table. led_sysdefs_arm_lpc.h fix: wrap the <LPC845.h> / <LPC804.h> includes in / pop_macro pairs. Arduino.h on the LPC8xx core defines INPUT / OUTPUT as preprocessor macros for digitalRead/Write, and the vendor SCT_Type has members named INPUT (offset 0x048) and OUTPUT (offset 0x050) per UM11029 §16.6.7-10. Without the push/undef/pop the macros would clobber the struct definitions. (Identical pattern to the old FL_LPC_SCT_Shim push/pop.) Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
V7 of FastLED #3437: hard-require the vendor PAL via #error checks in led_sysdefs_arm_lpc.h. If the toolchain failed to put <LPC845.h> / <LPC804.h> on the include path (no SCT0_BASE / PLU_BASE visible), the build now fails at preprocessing time instead of silently falling back on hand-rolled shims. agents/docs/register-maps.md: retires the 'Worked anti-example: LPC845' section. The three offset bugs are documented (#3349 fixed two, the third surfaced during #3437 cross-verification) along with the three-repo fix that resolved them. src/platforms/arm/lpc/README.md: marks audit sites 1, 2, 3, 4, 7 done. Sites 5 (LPC11 legacy, no CI), 6 (fastpin fallback, retained for LPC11/LPC15), and 8 (rx_sct_capture opt-in driver) deferred with rationale. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
…eRabbit) Per .coderabbit.yaml frozen-root rules — every modified non-comment line in root platformio.ini needs an adjacent justification + added-in comment. Adds them to all 5 LPC platform pins bumped by this PR. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
@coderabbitai resolving your two review comments: 1. platformio.ini audit-trail comments — fixed in fdf70cc. All 5 LPC platform pin bumps now carry adjacent 2. Unconditional vendor-header include — intentional, will not change. The whole point of FastLED #3437 V7 step is to hard-require the vendor PAL with no silent fallback. The earlier no-CMSIS fallback path was the failure mode that motivated #3437 — it allowed the hand-rolled shims in clockless_arm_lpc_pwm_dma.h to ship 3 register-offset bugs (2 fixed in #3349, 1 latent uncovered during cross-verification). Making the include 'optional' here recreates exactly the bug class we're eliminating. The Both upstream coordinating PRs are merged (zackees/ArduinoCore-LPC8xx#34 ships the headers, zackees/platform-nxplpc-arduino#9 pins the SHA), so the vendor PAL is guaranteed to be on the include path for any build going through the v0.2.0 platform pin. |
|
Tip For best results, initiate chat on the files or code changes.
Given the deleted shim fallback in 🐇💭 ✏️ Learnings added
|
…S PAL (#785) Updates ACLPC_COMMIT, ACLPC_VERSION, ACLPC_URL, and ACLPC_CHECKSUM in crates/fbuild-packages/src/library/arduino_core_lpc8xx.rs: COMMIT: 195a2eddd31eba8472ceaffa6a1a1902f72439ae -> 50d76e0d63c2d2a2b365b29de47100d93c530c83 VERSION: 0.1.0+g195a2ed -> 0.2.0+g50d76e0 URL: bumped tarball URL to new SHA CHECKSUM: 366de74b93179ba4b5e8ac9e527f15f189d9e26bcedd030fe11c11a2c907f3e4 -> e6bbcc3392ae9da44c5c92268d7cd953770e0011fcf285561104633e36087428 FastLED/framework-arduino-lpc8xx#34 ships the full NXP CMSIS Peripheral Access Layer in variants/lpc845/LPC845.h (~10K lines) and variants/lpc804/ LPC804.h (~7K lines), replacing the previous 54/49-line IRQn-only stubs. The vendor headers (rev. 1.2, BSD-3-Clause from nxp-mcuxpresso/mcux-sdk) provide canonical peripheral typedefs (SCT_Type, DMA_Type, SYSCON_Type, SPI_Type, GPIO_Type, SWM_Type, IOCON_Type, PINT_Type, INPUTMUX_Type, PLU_Type for LPC804, etc.) plus pointer macros (SCT0, DMA0, SYSCON, SPI0/1, PLU, IOCON, SWM0, ...). Unblocks downstream FastLED #3437 which migrated FastLED's LPC drivers to vendor typedefs (FastLED/FastLED#3438 merged today). After this fbuild pin bump, the fbuild backend will pull the same upstream commit that the platformio backend now pulls via platform-nxplpc-arduino v0.2.0 (FastLED/platform-nxp-lpc8xx#9, also pinned at the same ArduinoCore-LPC8xx SHA). Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
…ers (#3502) - Fix stale LPC845 clock reference (30 MHz -> actual 24 MHz FRO direct path per led_sysdefs_arm_lpc.h:49). - Add newly shipped drivers to the Supported Platforms table: - LPC845 SCT+DMA channels-API engine (#3460, TX->RX byte-match verified #3472) - LPC845 SPI+DMA async driver (#3454) - LPC804 SPI+DMA async gate (#3500, requires fbuild >= 2.3.16 for LPC804 CMSIS DMA0 typedef from framework-arduino-lpc8xx#35 + fbuild#916) - Document new files under Files: spi_arm_lpc_dma.h, drivers/sct_dma/*, rx_sct_capture.{h,cpp.hpp}. - Document new opt-in feature defines: FASTLED_LPC_SPI_DMA, FASTLED_LPC_SPI_DMA_CHANNEL, FASTLED_LPC_SPI_DMA_MAX_BYTES. - Add recent shipped PRs (#3438 register-map remediation, #3454, #3460, #3472, #3500) and cross-repo prerequisites (framework-arduino-lpc8xx#35, fbuild#916). - Add open follow-ups #3437 (register-map meta), #3501 (LPC11Uxx/LPC15xx SPI), fbuild#565 (CMSIS-DAP deploy). No code changes. Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
Summary
Implements step 3 of #3437 — FastLED consumes the vendor NXP CMSIS PAL through the now-merged upstream chain, deletes 5 of the 8 hand-rolled register-map sites, and migrates every call site to canonical NXP typedefs.
Upstream chain (both merged before this PR):
LPC845.h+LPC804.hCMSIS PAL invariants/lpc845/+variants/lpc804/. Merge SHA50d76e0d.framework-arduino-lpc8xxto step 1 SHA inplatform.json, bumps platform version0.1.0→0.2.0. Merge SHA12265f76.What this PR does
Foundation (step 3a)
_NXPLPC_PLATFORMSHA inci/boards.py+platformio.ini(2ee527ae→12265f76) — picks up the new v0.2.0 platform with the pinned ArduinoCore-LPC8xx that ships the full vendor PAL.#include <LPC845.h>+#include <LPC804.h>toled_sysdefs_arm_lpc.hbehindFL_IS_ARM_LPC_845/FL_IS_ARM_LPC_804guards, wrapped in#pragma push_macro("INPUT")/pop_macroso Arduino.h'sINPUT/OUTPUTmacros don't clobber vendor struct members of the same name.#errorguards that fail at preprocessing time if the vendor PAL is somehow missing — no silent fallback to hand-rolled shims.Audit sites migrated (5/8 — sites 1, 2, 3, 4, 7)
Site 1 —
FL_LPC_SCT_Shim+LPC_SCT_BASE+#define LPC_SCT(clockless_arm_lpc_pwm_dma.h):SCT0->.MATCH[i].U→MATCH[i],MATCHREL[i].U→MATCHREL[i],LIMIT_L→LIMIT(vendor stores as single 32-bit regs).Site 2 —
FL_LPC_DMA_Shim+FL_LPC_DMA_ChannelShim+#define LPC_DMA(clockless_arm_lpc_pwm_dma.h):DMA0->.DMA0->COMMON[0].ENABLESET/.SETVALID/.ACTIVE.CHANNEL.CFGfix applied (PERIPHREQEN | HWTRIGEN, explicitTRIGPOL=0/TRIGTYPE=0).Site 3 —
FL_LPC_SYSCON_Shim+#define LPC_SYSCON(clockless_arm_lpc_pwm_dma.h):SYSCON->SYSAHBCLKCTRL0.SYSAHBCLKCTRL0at offset0x40; vendor truth (confirming @phatpaul) is0x80. Now structurally correct.Site 4 —
FL_LPC_SPI_Type(spi_arm_lpc.h):SPI_Type.FL_LPC_SPI0_BASE/FL_LPC_SPI1_BASEretained as aliases for thepSPIXtemplate parameter (now defined toSPI0_BASE/SPI1_BASEfrom the vendor PAL).Site 7 — PLU raw offsets (clockless_arm_lpc_plu.h):
kPluBase + kOffLutTruth0etc. with vendorPLU->LUT_TRUTH[i],PLU->LUT[i].INP_MUX[j],PLU->OUTPUT_MUX[i].SYSCON->SYSAHBCLKCTRL0for PLU clock enable.LUT_TRUTHat0x000(vendor:0x800),OUTPUT_MUXat0x800(vendor:0xC00),LUT_INP_MUXat0xC00(vendor:0x000). PLU driver had not been hardware-verified yet (hardware: bring up LPC845 + WS2812 + AutoResearch UART (Stages 3.5, 3.6 from #2845) #2880 pending), so latent. Now structurally correct.WAKEINT_CTRL(PLU_BASE + 0xFF8) kept as raw access viapluRawReg()helper — vendorPLU_Typedoesn't include it (struct ends atOUTPUT_MUX[7]).Sites deferred — rationale in
src/platforms/arm/lpc/README.mdfastpin_arm_lpc.halready prefers vendorLPC_GPIO/GPIO(which is now always defined on LPC845/LPC804). The#elseraw-offset fallback path is retained for LPC11Uxx / LPC15xx until those families get full vendor CMSIS coverage. No functional gap on LPC845/LPC804.rx_sct_capture.cpp.hpp(~48 raw register accesses). Opt-in driver (FASTLED_LPC_RX_SCT_DMA), not exercised by default CI builds. Mechanical migration — tracked as a follow-up PR.Doc updates
agents/docs/register-maps.md: retires the "Worked anti-example: LPC845" section. Documents the third latent SCT shim bug uncovered during cross-verification and the three-repo fix chain that resolved it.src/platforms/arm/lpc/README.md: audit list marks sites 1/2/3/4/7 as ✅ done, sites 5/6/8 as ⏳ deferred with per-site rationale.Verification
bash lint --cpppasses (the only warn-only hits are pre-existing PlatformIO-internal-usage flags per ci: sweep PlatformIO build usage and add linters that enforce fbuild-only board builds #2701 and root-platformio.ini-lockdown, unrelated to LPC).lpc845brk,lpcxpresso804,lpcxpresso845max) — verified the new vendor headers compile cleanly with the rest of ArduinoCore-LPC8xx.build_lpc845,build_lpc845brk,build_lpcxpresso845max,build_lpc804,build_lpcxpresso804) only trigger on push-to-master (nopull_request:trigger), so they run only post-merge. Migration discipline: every migrated driver path is opt-in (FASTLED_LPC_PWM_DMA,FASTLED_LPC_PLU, SPI is only used by user-instantiatedAPA102/SK9822/WS2801strips), so the default Blink-style CI builds exercise just the foundation (SHA bump +#include), which can be reverted in a hotfix if needed.Branch history (chronological)
07d4903de— feat(lpc): bump platform SHA to v0.2.0, include vendor CMSIS PAL873caf407— fix(lpc): wrap LPC845.h/LPC804.h includes in IWYU pragma blockcaa0f9226— feat(lpc): migrate PWM+DMA driver + SPI driver to vendor CMSIS PAL (sites 1-4)b4004de6b— feat(lpc): migrate LPC804 PLU driver to vendor CMSIS PAL + protect INPUT/OUTPUT (site 7)9ae6c05c1— feat(lpc): #error guard if vendor PAL missing + docs updatePlus earlier branch commits that landed the audit-list docs and the revert of an experimental in-tree-vendoring approach.
Net effect across the three repos:
agents/docs/register-maps.mdmandatesCross-references
Closes #3437.
🤖 Generated with Claude Code