fix(board-db): add build.extra_flags for nRF52840 boards (Arduino macros)#299
Conversation
…ros) Three nRF52840 board JSONs in the bundled DB were missing `build.extra_flags`, so the Arduino board-detection macros that FastLED's `platforms/arm/nrf52/fastpin_arm_nrf52_variants.h` keys on were never defined. Every nRF52 build fell through to the "Unknown nRF52840 variant" fallback block (which marks many pins invalid), and `examples/Apa102/Apa102.ino` blew up at `fl/system/fastpin_base.h:146` with `static assertion failed: This pin has been marked as an invalid pin`. Restore `extra_flags` from the upstream PlatformIO board JSONs: nrf52840_dk -> -DARDUINO_NRF52_DK nrf52840_dk_adafruit -> -DARDUINO_NRF52840_PCA10056 -DNRF52840_XXAA adafruit_feather_nrf52840_sense -> -DARDUINO_NRF52840_FEATHER_SENSE -DNRF52840_XXAA This unblocks FastLED's `nrf52840_dk`, `nrf52840_supermini` (via `real_board_name="nrf52840_dk_adafruit"`), and `adafruit_feather_nrf52840_sense` workflows. Adds three regression tests (`test_nrf52840_dk_carries_arduino_macro`, `test_nrf52840_dk_adafruit_carries_arduino_macro`, `test_adafruit_feather_nrf52840_sense_carries_arduino_macro`) that assert each board's `get_defines()` includes the expected `ARDUINO_<BOARD>=1` keys. Full board suite passes 56/56. Tracking the broader gap (many other bundled boards also missing `extra_flags` — full nRF52 family, IAP*, LGT8F*, etc.) at #298 so this PR can stay minimal and focused on the immediate FastLED unblock. Refs #298
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughAdds compile-time preprocessor flags ( ChangesnRF52840 Board Configuration Flags
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related issues
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
…298) (#312) PR #299 unblocked FastLED CI for 3 priority nRF52840 boards by patching their JSONs manually. This is the follow-up broader sweep: re-runs enrich_boards (now with proper merge semantics) to restore build.extra_flags on every board family fbuild already shipped without the Arduino macros they need. Changes: * enrich_boards.rs: merge PIO-supplied build/upload fields into the existing fbuild JSON rather than wholesale replacing them. This preserves fbuild-only fields PIO no longer ships (e.g. legacy arduino.ldscript that PIO has moved into SCons builder scripts) while still picking up extra_flags, vid/pid, partitions, etc. * 601 board JSONs touched across 16 platforms: intel_mcs51 (264), atmelsam (81), libretiny (47), nordicnrf52 (45), microchippic32 (39), espressif32 (35), nordicnrf51 (14), timsp430 (13), freescalekinetis (12), maxim32 (9), infineonxmc (8), ststm8 (8), lgt8f (7), nxpimxrt (6), nxplpc (6), siliconlabsefm32 (5). Most gain a full extra_flags string with ARDUINO_<BOARD> / NRF52840_XXAA / etc. * tests: add test_nrf52840_sweep_arduino_macros covering the remaining Adafruit nRF52840 family (feather/clue/itsybitsy/metro/ledglasses/ circuitplay) and test_non_nrf52_sweep_arduino_macros covering SAMD (zero/mkrzero/adafruit_feather_m0), 8051 (AT89S51), and PIC32 (chipkit_uc32). Validation: * uv run python ci/validate_boards.py: 247 drift failures (down from 817 on main) -- remaining "extra in our asset" entries are intentional fbuild-only fields (e.g. build.arduino.ldscript). * soldr cargo check / clippy --workspace --all-targets -D warnings: pass * bash ./test (full workspace): 0 failures across all crates Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Summary
build.extra_flagson three nRF52840 board JSONs that FastLED CI currently exercises. Values mirror upstreamplatformio/platform-nordicnrf52verbatim.platforms/arm/nrf52/fastpin_arm_nrf52_variants.h, which marks pin 1 invalid →static_assert "This pin has been marked as an invalid pin"atfl/system/fastpin_base.h:146onexamples/Apa102/Apa102.ino.nrf52840_dk-DARDUINO_NRF52_DKnrf52840_dk_adafruit-DARDUINO_NRF52840_PCA10056 -DNRF52840_XXAAadafruit_feather_nrf52840_sense-DARDUINO_NRF52840_FEATHER_SENSE -DNRF52840_XXAAThis unblocks FastLED
nrf52840_dk,nrf52840_supermini(viareal_board_name="nrf52840_dk_adafruit"), andadafruit_feather_nrf52840_senseworkflows.The full sweep — every other bundled board missing
extra_flags, including the rest of the nRF52 family — is a separate follow-up tracked at #298 (re-runenrich_boardsend-to-end to importextra_flagsfor everything).Test plan
cargo check -p fbuild-configclean.cargo test -p fbuild-config --lib board::— 56/56 (was 53/53 before; +3 regression tests).nrf52840_dk,nrf52840_supermini,adafruit_feather_nrf52840_senseworkflows should now reach actual compilation past the static_assert.Refs #298
Generated with Claude Code (https://claude.com/claude-code)
Summary by CodeRabbit
Release Notes
New Features
Tests