Repository navigation
fix(nrf52): build Seeed XIAO nRF52840 boards against Seeed's core (#2017) - #2030
Merged
Merged
Conversation
Behaviour-preserving extractions so the #2017 fix does not grow two functions that carry #[expect(clippy::too_many_lines)]: - BoardConfig::from_board_id_in_project: fold the repeated override-then-default Option<String> lookup into an `opt` closure. - Nrf52Orchestrator::build: move the Nordic SDK / SoftDevice / FreeRTOS / SystemView include list into nrf52_core_include_dirs(). Refs #2017
The previous commit brought BoardConfig::from_board_id_in_project back under clippy's 100-line limit, so its baseline #[expect] is unfulfilled and must be deleted (RUST-018). Refs #2017
) xiaoble_adafruit / xiaoblesense_adafruit name the Seeed_XIAO_nRF52840{,_Sense} variants, but fbuild always provisioned Adafruit's nRF52 core 1.10601.0, which does not ship them, so every build stopped at variant.h. maxgerhardt/platform-nordicnrf52 maps these boards by name to framework-arduinoadafruitnrf52-seeed, an unpinned mirror of Seeed's fork. - Board JSON `build.framework_package` (BoardConfig::framework_package, overridable via board_build.framework_package) selects the core; both XIAO JSONs set framework-arduinoadafruitnrf52-seeed and gain upstream's extra_flags (-DARDUINO_Seeed_XIAO_nRF52840[_Sense], used by Seeed's Wire). Unknown values are a ConfigError; default stays Adafruit. - Nrf52Framework pins Seeed nRF52 Boards 1.1.13 from Seeed's board-manager index (SHA-256 5243bd45...e0e93071), cached as nrf52-core-seeed. - SoftDevice API headers follow the resolved linker script (nrf52840_s140_v7.ld -> s140_nrf52_7.3.0_API) instead of a hardcoded 6.1.1; unchanged for Adafruit boards. - Keep only the MCU's nrfx/mdk/system_<mcu>.c: Seeed's core drops the chip guards Adafruit's has, so system_nrf52.c and system_nrf52840.c both define SystemInit and fbuild links core objects directly. Fixes #2017
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
This was referenced Nov 17, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to a conflict with the base branch
Nov 17, 2026
Conflict in crates/fbuild-build-arm/src/nrf52/orchestrator.rs: #2016 (e992e3d) removed the GCC 7 registry-toolchain LTO workaround (for_registry_toolchain / is_gcc7_registry_toolchain / without_release_lto / without_flags) now that no nRF52 profile enables -flto. Keep main's state and retain only this PR's extracted nrf52_core_include_dirs, which the build now calls with the resolved linker script (#2017). Verified after resolution: fbuild-build-arm 296 passed / 0 failed / 2 ignored, fbuild-config 254p, fbuild-library 349p, clippy -p arm/config/library --all-targets --no-deps exit 0, fmt clean, validate_boards 35 tests OK, platform boundary 44/43.
This was referenced Nov 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2017.
Root cause
xiaoble_adafruit(variantSeeed_XIAO_nRF52840) andxiaoblesense_adafruit(variantSeeed_XIAO_nRF52840_Sense) were added to the board DB in #293, but the nRF52 orchestrator always provisions Adafruit'sframework-arduinoadafruitnrf521.10601.0. That core has no XIAO variants.platform = <maxgerhardt URL>changes nothing because fbuild does not runplatform.py.Upstream, maxgerhardt/platform-nordicnrf52's
platform.pyswaps the Arduino package for these two boards by board name, toframework-arduinoadafruitnrf52-seeed, an unpinned git mirror of Seeed's fork of the Adafruit core. That fork ships the XIAO variants, thenrf52840_s140_v7.ldscript the boards name, and the S140 7.3.0 SoftDevice API headers.Fix
build.framework_package(BoardConfig::framework_package, overridable withboard_build.framework_package), names the PlatformIO framework package. Both XIAO JSONs setframework-arduinoadafruitnrf52-seeed. They also gain upstream'sextra_flags(-DARDUINO_Seeed_XIAO_nRF52840[_Sense] -DNRF52840_XXAA), which Seeed'sWire_nRF52.cppuses for pin muxing. Boards without the field keep Adafruit's core. An unknown value is a typedConfigError.ci/validate_boards.pylists the field as an fbuild extension.Nrf52Framework::{Adafruit, Seeed}infbuild-librarypins Seeed nRF52 Boards 1.1.13:https://files.seeedstudio.com/arduino/core/nRF52/Seeed_nRF52_Boards-1.1.13.tar.bz2, SHA-2565243bd456e8b7a3328725e17e6c6efc9712662f5aa27b7dc807911aeb0e93071. The URL and hash come verbatim from Seeed's board-manager index, and I verified the hash against the download. It is cached separately asnrf52-core-seeed.platform_packages/ registry overrides key off the selected package's name, as SAMD does.s140_nrf52_6.1.1_API.core_select::softdevice_api_dirnow selects the newest<sd>_nrf52_<major>.*_APImatching the board's resolved linker script (nrf52840_s140_v7.ldgivess140_nrf52_7.3.0_API). It falls back to 6.1.1, which is the same as before for every Adafruit board.#ifdef NRF52832_XXAA/NRF52840_XXAAguards that Adafruit's has aroundnrfx/mdk/system_nrf52{,840}.c, so both defineSystemInit. Arduino and PIO archive the core, but fbuild links core objects directly, so this was a duplicate-symbol link error.retain_mcu_system_sourcekeeps onlysystem_<mcu>.c. That is what Adafruit's guards already produce, so Adafruit builds are unaffected.No deploy changes: fbuild has no nRF52 deployer. No VID/PID added: Seeed's
hwidswere not copied.Commits
refactor:shrinksBoardConfig::from_board_id_in_project(anoptclosure) and extractsnrf52_core_include_dirsfromNrf52Orchestrator::build, with no behaviour change, so neither#[expect(too_many_lines)]function grows.refactor:drops the loader's now-unfulfilled#[expect].fix:the behaviour change above.Tests
New
crates/fbuild-build-arm/src/nrf52/core_select_tests.rs:xiao_boards_resolve_to_seeed_core: both XIAO boards resolve toframework-arduinoadafruitnrf52-seeed, 1.1.13, with the pinned URL and SHA-256. RED before the board JSON change: it gotframework-arduinoadafruitnrf52.adafruit_boards_still_resolve_to_adafruit_core:adafruit_feather_nrf52840,nrf52840_dkandnrf52840_dk_adafruitresolve to Adafruit 1.10601.0.ConfigError, theboard_build.framework_packageoverride, SoftDevice header selection (v7, v6, newest release, fallback), and the MDK system-file filter.Validation
soldr cargo fmt --all -- --check: cleansoldr cargo clippy --workspace --all-targets -- -D warnings: cleanbash test -ppasses for fbuild-config, fbuild-library, fbuild-build-arm and fbuild-clici/test_validate_boards.py(35 tests) andci/check_usb_vidpid_literals.pypass; ruff is clean onci/validate_boards.py#[expect(too_many_lines)]function grew:Nrf52Orchestrator::buildis net ~26 lines shorter, and the loader'sexpectwas deleted.End-to-end
Built the issue's blink with
FBUILD_DEV_MODE=1 fbuild <proj> build -e <env> --cleanon a freshly built CLI/daemon, using the cached ARM GCC 15.2.Rel1. The nRF52 LTO default is still on, since #2028 is not merged.xiaoble_adafruitvariants/Seeed_XIAO_nRF52840s140_nrf52_7.3.0_APIxiaoblesense_adafruitvariants/Seeed_XIAO_nRF52840_Senses140_nrf52_7.3.0_APIxiaoble_adafruit+platform = https://github.com/maxgerhardt/platform-nordicnrf52adafruit_feather_nrf52840(control)feather_nrf52840_expresss140_nrf52_6.1.1_APIBefore the system-file filter, the XIAO build compiled and then failed to link with
multiple definition of SystemInit(system_nrf52.candsystem_nrf52840.c).FastLED CI (question in the issue)
FastLED's
nrf52_xiaoblesense/adafruit_xiaoblesensejobs never build these boards. Inci/boards.py,xiaoblesenseandxiaoblesense_adafruitsetreal_board_name="nrf52840_dk_adafruit"(Adafruit'spca10056variant, S140 v6), plus-DTARGET_XIAOBLE_NRF52840_SENSEto select FastLED's own XIAO fastpin block and-fno-lto. The jobs only run onworkflow_dispatchor on PRs labelledci-full/ci-platform:xiaoblesense[_adafruit], which is whymastershowsskipped. After this ships, FastLED can drop that stand-in. That is a FastLED change and is not made here.Not changed
fbuild lib-select(crates/fbuild-cli/src/lib_select.rs) is a diagnostic. It still reports Adafruit'slibraries/dir for every nRF52 board, as it does for other platforms' alternate cores.