VS-CODE: build hangs: "Found GnuLd: ld.bfd..."

I am having a recurring problem with NFC-CONNECT: build action. It hangs when building. Gets stuck with the following message in lower-right hand corner of screen:

The procedure I've found to get around this is to cancel the build, and then open a shell in the app directory and do the following:

% rm -rf build*
% export ZEPHYR_BASE=/opt/nordic/ncs/v2.6.0/zephyr
% west build -b nrf52840dk_nrf52840 -p

I can then use the build & build pristine actions.

It might be my environment is not fully supported. The `app` is stand-alone. There is an out-of-the tree module with source i reference with the following CMakeLists.txt fragment:

cmake_minimum_required(VERSION 3.20.0)

set(my-module "${CMAKE_CURRENT_SOURCE_DIR}/../my-module")
set(EXTRA_ZEPHYR_MODULES ${my-module})

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})

This module includes (via settings) board_root, dts_root, & soc_root,  as well as source, library, and include trees picked up from cmake + kconfig variables.

The build environment: Apple M1 Mac, MacOS: 12.6.7 (Monterey), VS-Code: v1.88.1, NRF-Connect: v2024.3.25

The Welcome tab shows SDK + Toolchain: v2.6.0. (I also use stock Zephyr to compile for non-Nordic boards, but am selecting proper SDK + toolchain, and have even removed `.west` directory for stock zephyr installation). 

Sorry to keep complaining about a great tool, but it's frustrating when it stops working.

Thanks. Kent

  • Downgrading should never be required / an option. Myself, as I'm sure others, use VSCode for many other platforms as well. Nordic should find and fix the issue, not require all to downgrade and miss updates that might have fixed other platforms.

  • I am also having this issue issue - hanging on the ld.bfd step when building Matter light_bulb sample with v.2.6.1 of the SDK and toolchain in VSCode on an M1 Mac.

    Here is my terminal output when doing the build configuration:

    Building light_bulb_2.6
    west build --build-dir /Users/ydr/dev/nordic/light_bulb_2.6/build /Users/ydr/dev/nordic/light_bulb_2.6 --pristine --board nrf5340dk_nrf5340_cpuapp --no-sysbuild --cmake-only -- -DNCS_TOOLCHAIN_VERSION=NONE -DBOARD_ROOT=/Users/ydr/dev/nordic;/Users/ydr/dev/nordic/light_bulb_2.6
    
    -- west build: generating a build system
    Loading Zephyr default modules (Zephyr base).
    -- Application: /Users/ydr/dev/nordic/light_bulb_2.6
    -- CMake version: 3.21.0
    -- Found Python3: /opt/nordic/ncs/toolchains/580e4ef81c/opt/[email protected]/bin/python3.9 (found suitable version "3.9.6", minimum required is "3.8") found components: Interpreter 
    -- Cache files will be written to: /Users/ydr/Library/Caches/zephyr
    -- Zephyr version: 3.5.99 (/opt/nordic/ncs/v2.6.1/zephyr)
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
    -- Board: nrf5340dk_nrf5340_cpuapp
    -- Found host-tools: zephyr 0.16.5 (/opt/nordic/ncs/toolchains/580e4ef81c/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.16.5 (/opt/nordic/ncs/toolchains/580e4ef81c/opt/zephyr-sdk)
    -- Found Dtc: /opt/nordic/ncs/toolchains/580e4ef81c/bin/dtc (found suitable version "1.6.1", minimum required is "1.4.6") 
    -- Found BOARD.dts: /opt/nordic/ncs/v2.6.1/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpuapp.dts
    -- Found devicetree overlay: /Users/ydr/dev/nordic/light_bulb_2.6/boards/nrf5340dk_nrf5340_cpuapp.overlay
    -- Generated zephyr.dts: /Users/ydr/dev/nordic/light_bulb_2.6/build/zephyr/zephyr.dts
    -- Generated devicetree_generated.h: /Users/ydr/dev/nordic/light_bulb_2.6/build/zephyr/include/generated/devicetree_generated.h
    -- Including generated dts.cmake file: /Users/ydr/dev/nordic/light_bulb_2.6/build/zephyr/dts.cmake
    Parsing /Users/ydr/dev/nordic/light_bulb_2.6/Kconfig
    Loaded configuration '/opt/nordic/ncs/v2.6.1/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpuapp_defconfig'
    Merged configuration '/Users/ydr/dev/nordic/light_bulb_2.6/prj.conf'
    Configuration saved to '/Users/ydr/dev/nordic/light_bulb_2.6/build/zephyr/.config'
    Kconfig header saved to '/Users/ydr/dev/nordic/light_bulb_2.6/build/zephyr/include/generated/autoconf.h'
    -- Found GnuLd: /opt/nordic/ncs/toolchains/580e4ef81c/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd (found version "2.38") 

    If I switch back to 2.5.3 SDK and toolchain it builds fine.

    All SDKs and toolchains are being installed and managed from within VS Code.

    I wish I could provide you a support information dump, but executing that command within VSCode generates an error as well.

    Would love to help you, Nordic team, to figure out why the ld.bfd step is hanging so we can figure out how to fix it. We want to move to 2.6 of the SDK because of some new Matter capabilities available there. Thanks! Dan.

  • Can you also provide the version of MacOS, and if installed, what version of nrfutil you have installed.

    Best regards,

    Simon

  • Hi Simon - Happy to:

    MacOS - Sonoma 14.5

    nrfutil - does not appear to be installed.

    this is the version info of VS Code:

    Version: 1.90.2 (Universal)
    Commit: 5437499feb04f7a586f677b155b039bc2b3669eb
    Date: 2024-06-18T22:37:41.291Z
    Electron: 29.4.0
    ElectronBuildId: 9728852
    Chromium: 122.0.6261.156
    Node.js: 20.9.0
    V8: 12.2.281.27-electron.0
    OS: Darwin arm64 23.5.0

    Thanks! Dan.

  • Hi

    OK, the fact that we don't see the same issue with almost the same environment points to a bug on our end and we are continuously looking into it. Please install nrfutil though, since this will be necessary at some point either way: https://www.nordicsemi.com/Products/Development-tools/nRF-Util/Download?lang=en#infotabs 

    Best regards,

    Simon

Related