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

Parents
  • Hi Kent, thank you for your willingness to help. Our developer came back with some more suggestion to help us try reproducing this on our end. Can you (or someone else) after your dead line of course:

    • Confirm that you have the M1 version of VS Code and the Toolchain installed, and how you installed them exactly.
    • Send the Support information you can generate with VS code.
    • Keep the developer console open (help > toggle developer tools) while building to look for any potentially related errors

    Best regards,

    Simon

Reply
  • Hi Kent, thank you for your willingness to help. Our developer came back with some more suggestion to help us try reproducing this on our end. Can you (or someone else) after your dead line of course:

    • Confirm that you have the M1 version of VS Code and the Toolchain installed, and how you installed them exactly.
    • Send the Support information you can generate with VS code.
    • Keep the developer console open (help > toggle developer tools) while building to look for any potentially related errors

    Best regards,

    Simon

Children
  • I also had this issue appear on my system, 2021 M1 MacBook, OS X Sonoma 14.4.1, latest VSCode and latest NCS VS Code extension. As I do a lot of work with Zephyr on other MCUs I had intended to do all the development inside a Docker container, but that was unworkable for NCS due to the lack of distributed aarch64/linux binaries for various tools required by SDK 2.6.0. So I had a partial install of the VSCode NCS tools pointing at a Zephyr-ci-docker container at first which failed miserably.

    Attempting to go back and run the builds natively on my OS X host directly inside VSCode is where I got the hangup at the ld.bfd step, which did not seem to be related to which version of the SDK or toolchain was installed, nor did it matter how the SDK and toolchain were installed. After installing command line tools from the distribution DPKG, and NCS Connect for Desktop, I used the UI toolchain manager to install v2.6.0 (appearing in /opt/nordic/ncs/v2.6.0) and then the VSCode extension. This hung.

    Using the VSCode extension interface I installed SDK 2.5.2 and toolchain 2.5.2, switched active toolchain and SDK, still hung on trying to generate a configuration. Attempting to run the exact west command from a terminal and this also hung at the ld.bfd step. The ld.bfd binary is not failing to run, executing it from a terminal outside of west runs correctly and looking at the binary headers the binary is native arm64, so the install of the tools seems to be fine.

    Notably, I had not restarted VSCode or my system in quite a while, and that made the hangup go away. No idea what steps above produced the lockup, nor what cleared it, but for anyone else on an M1 Mac seeing this maybe these steps can help clear it.

Related