Repository navigation
fix(lpc): unblock LPC845 compile path for SCT+DMA channels-API engine (#3468) - #3475
Conversation
…#3468) While validating the #3468 harness on real LPC845-BRK silicon (VID:PID 1FC9:0132 on COM10), three separate blockers prevented `bash compile lpc845brk --examples AutoResearch --build-flag -DFASTLED_LPC_PWM_DMA=1` from producing a firmware image. Each is a legitimate bug fix and lands here together because they are only observable end-to-end when the LPC compile path actually gets exercised. ## Fix 1 — `ci/boards.py`: nxplpc@ prefix workaround fbuild 2.3.15 shipped 2026-06-30 20:09 UTC; my platform-matcher fix FastLED/fbuild#900 merged 2026-06-30 21:47 UTC (after 2.3.15 was cut). 2.3.15's matcher still only substring-matches `nxplpc` (no separator) and rejects the hyphenated `nxp-lpc` in the raw GitHub URL. Prepending `nxplpc@` to the platform URL is valid PlatformIO name-at-source syntax and makes the substring match, unblocking the build under 2.3.15. Once fbuild 2.3.16 ships with #900 the prefix becomes redundant but stays syntactically valid. ## Fix 2 — `led_sysdefs_arm_lpc.h`: define `FASTLED_HAS_CMSIS` `src/platforms/arm/common/m0clockless_c.h:51` guards the local `__get_PRIMASK` / `__enable_irq` / `__disable_irq` stubs with `#if !defined(FASTLED_HAS_CMSIS)`, and the comment on that guard says "LPC builds set FASTLED_HAS_CMSIS in led_sysdefs". But the define was never actually added — so LPC builds got the local stubs plus the vendor CMSIS versions from `core_cm0plus.h` and gcc rejected the pair with error: redefinition of 'fl::u32 __get_PRIMASK()' Adding `#define FASTLED_HAS_CMSIS 1` in `led_sysdefs_arm_lpc.h` immediately after the vendor `<LPC845.h>` / `<LPC804.h>` include matches the intent of the m0clockless guard and silences the collision. ## Fix 3 — `platforms/shared/bitbang/bus_traits.h`: LPC845 gate `ChannelEngineLpcSctDma` registers under `BusTraits<Bus::BIT_BANG>` (see `src/platforms/arm/lpc/drivers/sct_dma/bus_traits.h` — FastLED #3459 / PR #3460). The shared `BitBangChannelDriver` also specialises `BusTraits<Bus::BIT_BANG>` unconditionally. On LPC845 both TUs land in the same translation unit and gcc rejects the pair with error: redefinition of 'struct fl::BusTraits<fl::Bus::BIT_BANG>' error: redefinition of 'struct fl::BusSupports<fl::Bus::BIT_BANG, fl::ClocklessChipset, 0>' Gate the shared bit-bang specialization on `!FL_IS_ARM_LPC_845` so the dedicated SCT+DMA engine owns the slot on that platform. Every other platform continues to use the universal-GPIO fallback. ## Verification Applied all three fixes and confirmed: bash compile lpc845brk --examples AutoResearch \ --build-flag "-DFASTLED_LPC_PWM_DMA=1" Board: NXP LPC845-BRK / LPC845 @ 24MHz Toolchain: arm-none-eabi-gcc 15.2.1 Flash: 53.52KB / 64.00KB (83.6%) RAM: 9.07KB / 16.00KB (56.7%) Artifact: firmware.elf (159.79KB) / firmware.bin (53.54KB) build succeeded in 212.2s bash test --cpp → 343/343 passed C++ lint → clean ## What's still open on the actual on-wire verification - fbuild-side: an additional blocker surfaced during this bring-up — the FastLED/framework-arduino-lpc8xx tarball SHA256 changed after the 2026-06-28 org transfer (`e6bbcc3392…` → `e64f0cb81a…`). This needs a fbuild-side update to `ACLPC_CHECKSUM` in `crates/fbuild-packages/src/library/arduino_core_lpc8xx.rs`; I filed the change on a local fbuild branch during this session and will push it as a follow-up PR to the fbuild repo. - Flash + serial monitoring: `bash autoresearch --pwm-dma-cl` still hits pre-existing infrastructure gaps unrelated to #3468 — `ci/util/port_utils.py` only recognises the LPCXpresso VCOM fingerprint (VID:PID 16C0:0483), not the LPC-Link2 CMSIS-DAP variant (1FC9:0132) that ships on this specific LPC845-BRK unit, and fbuild's LPC deploy path uses `lpc21isp` which requires ISP-mode entry rather than the board's default CMSIS-DAP SWD. Both are tracked separately. The host TX→RX byte-flow readback contract (the #3468 primary acceptance criterion) is already confirmed in PR #3472 (`tests/fl/channels/lpc_sct_dma_engine.cpp` "#3468: end-to-end TX→RX readback through engine.show()", passing 343/343). This PR takes the verification one step further by making the compile path work on the LPC845 target so any user with an LPC845-BRK can now build and flash the firmware and run the on-silicon self-loopback via `pwmDmaClCaptureSelf`. 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 (3)
📝 WalkthroughWalkthroughUpdates the LPC8xx PlatformIO platform reference in ChangesLPC8xx Build Compatibility Fixes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 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
Three separate compile-path fixes surfaced while validating the #3468 harness on real LPC845-BRK silicon (VID:PID 1FC9:0132 on COM10). Each is a legitimate bug fix; they land together because they're only observable end-to-end when the LPC compile path actually gets exercised.
Fixes
ci/boards.py—nxplpc@prefix workaround. fbuild 2.3.15 was cut BEFORE my matcher fixFastLED/fbuild#900merged (20:09 vs 21:47 UTC), so 2.3.15's substring matcher still rejects the hyphenatednxp-lpcGitHub URL.nxplpc@<URL>is valid PlatformIO name-at-source syntax and makes the substring match under 2.3.15. Redundant once 2.3.16 ships with Fix compilation for NRF52 chips with a single GPIO port such as NRF52832 #900 but stays valid.src/platforms/arm/lpc/led_sysdefs_arm_lpc.h— defineFASTLED_HAS_CMSIS. The guard atm0clockless_c.h:51(comment says "LPC builds set FASTLED_HAS_CMSIS in led_sysdefs") was referenced but the define was never actually added. Result:redefinition of 'fl::u32 __get_PRIMASK()'because both the FastLED local stub and the vendor CMSIScore_cm0plus.hwere active.src/platforms/shared/bitbang/bus_traits.h— LPC845 gate. The sharedBitBangChannelDriverunconditionally specializesBusTraits<Bus::BIT_BANG>, which collides withChannelEngineLpcSctDma's BIT_BANG registration on LPC845. Gate the shared specialization on!FL_IS_ARM_LPC_845so the dedicated SCT+DMA engine owns the slot.Verification
Applied all three fixes and confirmed the LPC compile now goes green:
bash test --cpp→ 343/343 passedWhat's still open on the actual on-wire verification
FastLED/framework-arduino-lpc8xxtarball SHA256 changed after the 2026-06-28 org transfer (e6bbcc3392…→e64f0cb81a…). Needs a fbuild-side update toACLPC_CHECKSUMincrates/fbuild-packages/src/library/arduino_core_lpc8xx.rs. I have the fix on a local fbuild branch and will push it to fbuild as a follow-up PR.bash autoresearch --pwm-dma-clhits pre-existing infrastructure gaps unrelated to AutoResearch: PWM+DMA clockless validation harness for LPC845 (paired sibling of #3456) #3468 —ci/util/port_utils.pyonly recognises the LPCXpresso VCOM fingerprint (VID:PID 16C0:0483), not the LPC-Link2 CMSIS-DAP variant (1FC9:0132), and fbuild's LPC deploy path useslpc21ispwhich requires ISP-mode entry rather than the board's default CMSIS-DAP SWD.The host TX→RX byte-flow readback contract (#3468 primary acceptance) is already confirmed in PR #3472 (
tests/fl/channels/lpc_sct_dma_engine.cpp"#3468: end-to-end TX→RX readback through engine.show()"). This PR takes it one step further by unblocking the compile path so anyone with an LPC845-BRK can now build the firmware and run the on-silicon self-loopback once fbuild + port fingerprint clear.Refs #3468.
🤖 Generated with Claude Code
Summary by CodeRabbit