Skip to content

nrf52: linker script lookup uses literal name, ignores PIO->Adafruit alias (nrf52_xxaa.ld) #327

Description

@zackees

Symptom

Companion to #325 — same root cause, different artifact. After the variant include path is resolved (#325), the nrf52840_dk integration test now fails at the link step with:

+ "```" +
arm-none-eabi-gcc link failed:
ld: cannot open linker script file
/home/runner/.fbuild/prod/cache/platforms/dl-framework-arduinoadafruitnrf52-1.10601.0/.../cores/nRF5/linker/nrf52_xxaa.ld:
No such file or directory
+ "```" +

Adafruit's BSP ships SoftDevice-flavored scripts only:

+ "```" +
cores/nRF5/linker/nrf52840_s140_v6.ld
cores/nRF5/linker/nrf52832_s132_v6.ld
cores/nRF5/linker/nrf52_common.ld
+ "```" +

Root cause

+ "Nrf52Cores::get_linker_script" + ( + "crates/fbuild-packages/src/library/nrf52_core.rs:98-100" + ) joins + "<linker_dir>/<ldscript_name>" + literally. Board JSONs that track PIO/sandeepmistry upstream (e.g. + "crates/fbuild-config/assets/boards/json/nrf52840_dk.json" + ) declare + "ldscript = "nrf52_xxaa.ld"" + — the bare-metal name from the sandeepmistry/arduino-nRF5 framework. Adafruit's BSP uses different names for the same hardware, gated on MCU.

Fix

Add an MCU-keyed alias resolver mirroring + "resolve_nrf52_variant_dir" + from PR #326 / #325:

input ldscript MCU resolved name
nrf52_xxaa.ld nrf52840 nrf52840_s140_v6.ld
nrf52_xxaa.ld nrf52832 nrf52832_s132_v6.ld
any other literal (no alias)

Literal name wins when it exists on disk so the alias is a strict fallback. Implemented in PR #326 as a follow-up commit.

Impact

Unblocks the + "tests/platform/nrf52840_dk" + integration test and FastLED CI workflow + "build_nrf52840_dk" + (FastLED/FastLED#2631) once the new release is cut and ingested.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions