You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
nRF52: Wire and SPI are only include paths, so Wire.begin() fails to link #2072
The nRF52 orchestrator (crates/fbuild-build-arm/src/nrf52/orchestrator.rs, "Framework library includes") adds the core's Wire and SPI folders as include paths only. It never compiles Wire.cpp or SPI.cpp. So a sketch that calls Wire.begin() fails to link with undefined reference to TwoWire::begin(), even though lib-select picks Wire. It's the same on main.
PlatformIO compiles the framework's built-in libraries through LDF when they're included. fbuild should compile the libraries it selects for nRF52, as other platforms do.
Reproduced on main (installed CLI 2.5.50) with tests/platform/nrf52840_dk plus a five-line Wire sketch (Wire.begin(), beginTransmission, write, endTransmission):
undefined reference to `TwoWire::begin()'
undefined reference to `TwoWire::beginTransmission(unsigned char)'
undefined reference to `TwoWire::endTransmission()'
undefined reference to `Wire'
collect2: error: ld returned 1 exit status
So the include path is there (the sketch compiles) and only the library's translation units are missing — exactly as reported.
Fix is up as #2077: the orchestrator now resolves the core's libraries/ tree with the same shared LDF finder the Teensy/STM32/RP2040/ESP8266/Renesas orchestrators use, adds the reached libraries' include dirs and sources, excludes Adafruit_TinyUSB_Arduino (already compiled by the TinyUSB block) and de-duplicates sources already in the core set (the SPI.cpp the TinyUSB host adapter needs). Unit receipts: soldr cargo test -p fbuild-build-arm --lib 307 passed / 0 failed / 2 ignored, with 7 new tests in nrf52/framework_libs_tests.rs covering the flat 1.0 layout the Adafruit BSP uses (libraries/Wire/Wire_nRF52.cpp, libraries/SPI/SPI.cpp + SPI_nrf52832.cpp).
Keeping this open until the end-to-end fbuild build on the fix (not just the unit selection) is attached — that build is queued behind the host's current load (~90-120/16).
Closing: the defect is fixed on main by #2077 (0aad6801, merged 2026-11-18T08:15:27Z).
What landed — crates/fbuild-build-arm/src/nrf52/framework_libs.rs runs the shared LDF
(resolve_framework_library_selection_active_declared_with_extra) over Nrf52Cores::get_libraries_dir()
(the same directory fbuild lib-select already inspects) and contributes the include dirs and the
sources of the libraries a sketch actually reaches, instead of only pushing libraries/{SPI,Wire} onto
the include path. Adafruit_TinyUSB_Arduino stays excluded (the orchestrator compiles that stack itself),
and sources already in the core set (the manual SPI.cpp) are filtered out by NormalizedPath. The
orchestrator's step 6b now hoists lib_deps above the library selection.
Receipts
Before (installed CLI 2.5.50, tests/platform/nrf52840_dk + a five-line Wire sketch) the sketch
compiled and the link died on undefined reference to TwoWire::begin()/beginTransmission/endTransmission/Wire.
After: fbuild build -e nrf52840_dk → build succeeded in 59.0s (flash: 48208, ram: 8776), with Wire_nRF52.cpp in compile_commands.json (102 TUs), SPI.cpp compiled exactly once, and no Bluefruit52Lib/Adafruit_LittleFS pulled in.
Activity
zackees commentedon Nov 18, 2026
Reproduced on
main(installed CLI 2.5.50) withtests/platform/nrf52840_dkplus a five-lineWiresketch (Wire.begin(),beginTransmission,write,endTransmission):So the include path is there (the sketch compiles) and only the library's translation units are missing — exactly as reported.
Fix is up as #2077: the orchestrator now resolves the core's
libraries/tree with the same shared LDF finder the Teensy/STM32/RP2040/ESP8266/Renesas orchestrators use, adds the reached libraries' include dirs and sources, excludesAdafruit_TinyUSB_Arduino(already compiled by the TinyUSB block) and de-duplicates sources already in the core set (theSPI.cppthe TinyUSB host adapter needs). Unit receipts:soldr cargo test -p fbuild-build-arm --lib307 passed / 0 failed / 2 ignored, with 7 new tests innrf52/framework_libs_tests.rscovering the flat 1.0 layout the Adafruit BSP uses (libraries/Wire/Wire_nRF52.cpp,libraries/SPI/SPI.cpp+SPI_nrf52832.cpp).Keeping this open until the end-to-end
fbuild buildon the fix (not just the unit selection) is attached — that build is queued behind the host's current load (~90-120/16).zackees commentedon Nov 18, 2026
Claimed by the fbuild-74 coordinator. A sub-agent is working on this now (meta #2035).
zackees commentedon Nov 18, 2026
Correction: another session already has this in PR #2077, so fbuild-74 is not working on it.
zackees commentedon Nov 18, 2026
Closing: the defect is fixed on
mainby #2077 (0aad6801, merged 2026-11-18T08:15:27Z).What landed —
crates/fbuild-build-arm/src/nrf52/framework_libs.rsruns the shared LDF(
resolve_framework_library_selection_active_declared_with_extra) overNrf52Cores::get_libraries_dir()(the same directory
fbuild lib-selectalready inspects) and contributes the include dirs and thesources of the libraries a sketch actually reaches, instead of only pushing
libraries/{SPI,Wire}ontothe include path.
Adafruit_TinyUSB_Arduinostays excluded (the orchestrator compiles that stack itself),and sources already in the core set (the manual
SPI.cpp) are filtered out byNormalizedPath. Theorchestrator's step 6b now hoists
lib_depsabove the library selection.Receipts
tests/platform/nrf52840_dk+ a five-lineWiresketch) the sketchcompiled and the link died on
undefined reference to TwoWire::begin()/beginTransmission/endTransmission/Wire.fbuild build -e nrf52840_dk→build succeeded in 59.0s (flash: 48208, ram: 8776), withWire_nRF52.cppincompile_commands.json(102 TUs),SPI.cppcompiled exactly once, and noBluefruit52Lib/Adafruit_LittleFSpulled in.soldr cargo test -p fbuild-build-arm --lib→ 307 passed / 0 failed / 2 ignored (7 new tests: flat BSPlayout, unreached library, TinyUSB exclusion, dedup,
lib_deps, missing library dir).0aad6801: 37 check-runs success / 16 skipped / 10 running / 0 failure; the Nordic samplebuilds (nRF52840 DK, SuperMini, nRFMicro, Feather) are green.
Meta #2035 stays open for the rest of its batch.