Getting stuck at "ld.bfd" tool when generating configuration from nRF Connect SDK for VS Code

Hello,

I am having a strange problem with nRF Connect SDK for VS Code, and would appreciate some help.

I don't know what I did, but suddenly I am not able to "Generate Configuration" from the VS Code extension, as it gets stuck/hangs at "ld.bfd". (see attached for logs).

Building blinky_tutorial
west build --build-dir /Users/minoue/Repository/Playground_Nordic/blinky_tutorial/build /Users/minoue/Repository/Playground_Nordic/blinky_tutorial --pristine --board thingy91_nrf9160_ns --no-sysbuild --cmake-only -- -DNCS_TOOLCHAIN_VERSION=NONE -DCONF_FILE=/Users/minoue/Repository/Playground_Nordic/blinky_tutorial/prj.conf -DBOARD_ROOT=/Users/minoue/Repository/Playground_Nordic/blinky_tutorial

-- west build: generating a build system
Loading Zephyr default modules (Zephyr base).
-- Application: /Users/minoue/Repository/Playground_Nordic/blinky_tutorial
-- 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/minoue/Library/Caches/zephyr
-- Zephyr version: 3.5.99 (/opt/nordic/ncs/v2.6.0/zephyr)
-- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
-- Board: thingy91_nrf9160_ns
-- 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.0/nrf/boards/arm/thingy91_nrf9160/thingy91_nrf9160_ns.dts
-- Generated zephyr.dts: /Users/minoue/Repository/Playground_Nordic/blinky_tutorial/build/zephyr/zephyr.dts
-- Generated devicetree_generated.h: /Users/minoue/Repository/Playground_Nordic/blinky_tutorial/build/zephyr/include/generated/devicetree_generated.h
-- Including generated dts.cmake file: /Users/minoue/Repository/Playground_Nordic/blinky_tutorial/build/zephyr/dts.cmake
Parsing /opt/nordic/ncs/v2.6.0/zephyr/Kconfig
Loaded configuration '/opt/nordic/ncs/v2.6.0/nrf/boards/arm/thingy91_nrf9160/thingy91_nrf9160_ns_defconfig'
Merged configuration '/Users/minoue/Repository/Playground_Nordic/blinky_tutorial/prj.conf'
Configuration saved to '/Users/minoue/Repository/Playground_Nordic/blinky_tutorial/build/zephyr/.config'
Kconfig header saved to '/Users/minoue/Repository/Playground_Nordic/blinky_tutorial/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") 
 *  Terminal will be reused by tasks, press any key to close it. 

Strange things is that:

1. I am able to build from the terminal in VS Code without issues (i.e. "west build --board <board_name>")

2. I am also able to "Generate Configuration" button if I set the tool chain to "Zephyr SDK 0.16.5-1".

Maybe an environmental variable is misconfigured...?

I've attached my environment info (generated via "Generate Support Information" button in the extension).

IMPORTANT: The data below could contain sensitive or confidential information about your environment.
If you do not wish this to be seen by others, please make sure to remove it before sharing.

For help and support, visit the Nordic DevZone at https://devzone.nordicsemi.com/.

{
  "platform": {
    "os": "darwin",
    "osVersion": "Darwin Kernel Version 23.4.0: Fri Mar 15 00:19:22 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T8112",
    "osKernel": "23.4.0",
    "vscode": "1.88.0",
    "electron": "28.2.8",
    "node": "v18.18.2"
  },
  "system": {
    "date": "2024-04-08T09:29:02.978Z",
    "vscodeRoot": "/Applications/Visual Studio Code.app/Contents/Resources/app",
    "nrfConnectForDesktopInstalled": true,
    "vscodeUptime": "00:16:59",
    "osUptime": "79:34:58",
    "cpu": "Apple M2"
  },
  "workspace": {
    "name": "blinky_tutorial (Workspace)",
    "workspaceFile": "/Users/minoue/Repository/Playground_Nordic/three_threads/src/blinky_tutorial.code-workspace",
    "folders": [
      "/Users/minoue/Repository/Playground_Nordic/blinky_tutorial"
    ]
  },
  "sdks": [
    {
      "version": "v2.6.99",
      "path": "/Users/minoue/Repository/PT-Node-Workspace"
    },
    {
      "version": "v2.6.0",
      "path": "/opt/nordic/ncs/v2.6.0"
    },
    {
      "version": "v2.5.2",
      "path": "/opt/nordic/ncs/v2.5.2"
    }
  ],
  "activeBuild": "/Users/minoue/Repository/Playground_Nordic/blinky_tutorial/build",
  "apps": [
    {
      "workspace": "/Users/minoue/Repository/Playground_Nordic/blinky_tutorial",
      "uri": "/Users/minoue/Repository/Playground_Nordic/blinky_tutorial",
      "buildConfigurations": [
        {
          "id": "/Users/minoue/Repository/Playground_Nordic/blinky_tutorial/build",
          "name": "build",
          "boardId": "thingy91_nrf9160_ns",
          "type": "Zephyr",
          "isChild": false,
          "isStale": true,
          "taskBindings": {
            "build": [],
            "pristineBuild": [],
            "flash": [],
            "eraseAndFlash": []
          }
        }
      ]
    }
  ],
  "topdir": "/opt/nordic/ncs/v2.6.0",
  "workspaceState": "freestanding-ready",
  "toolchains": [
    {
      "version": "2.6.0",
      "path": "/opt/nordic/ncs/toolchains/580e4ef81c"
    },
    {
      "version": "2.5.2",
      "path": "/opt/nordic/ncs/toolchains/20d68df7e5"
    }
  ],
  "connectedDevices": [],
  "deviceProvider": "nrfutil",
  "tools": {
    "/opt/nordic/ncs/toolchains/580e4ef81c/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc": "0.16.5",
    "/Applications/SEGGER/JLink/JLinkExe": "7.96b",
    "/usr/local/bin/nrfjprog": "10.24.1",
    "nrfutil": "Not found",
    "/opt/nordic/ncs/toolchains/580e4ef81c/bin/cmake": "3.21.0",
    "/opt/nordic/ncs/toolchains/580e4ef81c/bin/west": "1.2.0",
    "/opt/nordic/ncs/toolchains/580e4ef81c/bin/python3": "3.9.6",
    "/opt/nordic/ncs/toolchains/580e4ef81c/bin/ninja": "1.10.2",
    "/opt/nordic/ncs/toolchains/580e4ef81c/bin/gperf": "3.1",
    "/opt/nordic/ncs/toolchains/580e4ef81c/bin/dtc": "1.6.1",
    "/opt/nordic/ncs/toolchains/580e4ef81c/bin/gn": "2154",
    "/opt/nordic/ncs/toolchains/580e4ef81c/bin/git": "2.37.3",
    "gdbPath": "/opt/nordic/ncs/toolchains/580e4ef81c/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gdb"
  },
  "nrfutil": {
    "nrfutil-device": {
      "version": "2.0.0",
      "binPath": "/Users/minoue/.vscode/extensions/nordic-semiconductor.nrf-connect-2024.3.25-darwin-arm64/platform/nrfutil/bin/nrfutil-device"
    },
    "nrfutil-toolchain-manager": {
      "version": "0.14.1",
      "binPath": "/Users/minoue/.vscode/extensions/nordic-semiconductor.nrf-connect-2024.3.25-darwin-arm64/platform/nrfutil/bin/nrfutil-toolchain-manager"
    }
  },
  "environment": {
    "westEnv": {
      "ELECTRON_RUN_AS_NODE": "1",
      "GIT_EXEC_PATH": "/opt/nordic/ncs/toolchains/580e4ef81c/Cellar/git/2.37.3/libexec/git-core",
      "HOME": "/Users/minoue",
      "PATH": "/opt/nordic/ncs/toolchains/580e4ef81c/bin:/opt/nordic/ncs/toolchains/580e4ef81c/usr/bin:/opt/nordic/ncs/toolchains/580e4ef81c/usr/local/bin:/opt/nordic/ncs/toolchains/580e4ef81c/opt/bin:/opt/nordic/ncs/toolchains/580e4ef81c/opt/nanopb/generator-bin:/opt/nordic/ncs/toolchains/580e4ef81c/opt/zephyr-sdk/aarch64-zephyr-elf/bin:/opt/nordic/ncs/toolchains/580e4ef81c/opt/zephyr-sdk/x86_64-zephyr-elf/bin:/opt/nordic/ncs/toolchains/580e4ef81c/opt/zephyr-sdk/arm-zephyr-eabi/bin:/opt/nordic/ncs/toolchains/580e4ef81c/opt/zephyr-sdk/riscv64-zephyr-elf/bin:/opt/nordic/ncs/v2.6.0/zephyr/scripts:/Users/minoue/.docker/bin:/usr/local/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/Users/minoue/Repository/go-workspace/bin:/usr/local/opt/go/libexec/bin:/opt/nordic/ncs/v2.6.0/zephyr/scripts:/Users/minoue/.docker/bin:/usr/local/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/Users/minoue/Repository/go-workspace/bin:/usr/local/opt/go/libexec/bin",
      "ZEPHYR_BASE": "/opt/nordic/ncs/v2.6.0/zephyr",
      "ZEPHYR_TOOLCHAIN_VARIANT": "zephyr",
      "ZEPHYR_SDK_INSTALL_DIR": "/opt/nordic/ncs/toolchains/580e4ef81c/opt/zephyr-sdk",
      "USER": "minoue"
    },
    "inherited": {
      "ELECTRON_RUN_AS_NODE": "1",
      "HOME": "/Users/minoue",
      "PATH": "/opt/nordic/ncs/v2.6.0/zephyr/scripts:/Users/minoue/.docker/bin:/usr/local/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/Users/minoue/Repository/go-workspace/bin:/usr/local/opt/go/libexec/bin",
      "ZEPHYR_BASE": "/opt/nordic/ncs/v2.6.0/zephyr",
      "USER": "minoue"
    },
    "toolchainPath": "/opt/nordic/ncs/toolchains/580e4ef81c",
    "toolchainBinPath": "/opt/nordic/ncs/toolchains/580e4ef81c/opt/zephyr-sdk/arm-zephyr-eabi/bin",
    "toolchainVersion": "2.6.0"
  },
  "terminal": {
    "defaultProfile": null
  },
  "config": {
    "nordic-semiconductor.nrf-connect": {
      "topdir": "${nrf-connect.sdk:2.6.0}",
      "toolchain": {
        "path": "${nrf-connect.toolchain:2.6.0}"
      },
      "ozonePath": "",
      "applications": [],
      "applicationOptions": {},
      "kconfig": {
        "interface": "kconfig"
      },
      "west": {
        "env": {
          "$base": "terminal"
        }
      },
      "boardRoots": [],
      "taskBindings": {},
      "buildTerminal": {
        "condensedProgress": true
      },
      "debugging": {
        "flash": true,
        "bindings": {},
        "justMyCode": true
      },
      "activeAppFollowActiveEditor": true,
      "deviceProvider": "",
      "flash": {
        "softreset": false,
        "erase": false,
        "recover": false
      },
      "enableTelemetry": false,
      "thirdpartyIntegration": {},
      "toolchainManager": {
        "indexURL": null,
        "installDirectory": null
      },
      "nrfutil": {
        "home": null
      },
      "defaultOpenAction": "ask",
      "welcome": {
        "showOnStartup": true
      }
    },
    "nordic-semiconductor.nrf-terminal": {
      "terminalMode": "character"
    }
  },
  "extensions": {
    "internal": {
      "nordic-semiconductor.nrf-connect": {
        "version": "2024.3.25",
        "path": "/Users/minoue/.vscode/extensions/nordic-semiconductor.nrf-connect-2024.3.25-darwin-arm64",
        "isActive": true
      },
      "nordic-semiconductor.nrf-terminal": {
        "version": "2024.3.15",
        "path": "/Users/minoue/.vscode/extensions/nordic-semiconductor.nrf-terminal-2024.3.15",
        "isActive": true
      },
      "nordic-semiconductor.nrf-devicetree": {
        "version": "2024.3.78",
        "path": "/Users/minoue/.vscode/extensions/nordic-semiconductor.nrf-devicetree-2024.3.78",
        "isActive": true
      },
      "nordic-semiconductor.nrf-kconfig": {
        "version": "2024.3.21",
        "path": "/Users/minoue/.vscode/extensions/nordic-semiconductor.nrf-kconfig-2024.3.21",
        "isActive": true
      }
    },
    "external": {
      "marus25.cortex-debug": null,
      "ms-vscode.cpptools": "1.19.9",
      "ms-vscode.js-debug": "1.88.0",
      "ms-vscode.js-debug-companion": "1.1.2",
      "ms-vscode.vscode-js-profile-table": "1.0.8",
      "dawhite.mustache": "1.1.1",
      "ecmel.vscode-html-css": "2.0.9",
      "github.vscode-github-actions": "0.26.2",
      "GitHub.vscode-pull-request-github": "0.86.0",
      "GrapeCity.gc-excelviewer": "4.2.59",
      "ms-azuretools.vscode-docker": "1.29.0",
      "ms-python.debugpy": "2024.4.0",
      "ms-python.isort": "2023.10.1",
      "ms-python.python": "2024.4.0",
      "ms-python.vscode-pylance": "2024.4.1",
      "ms-vscode-remote.remote-containers": "0.354.0",
      "qwtel.sqlite-viewer": "0.3.13",
      "samuelcolvin.jinjahtml": "0.20.0",
      "tamasfe.even-better-toml": "0.19.2",
      "trond-snekvik.gnu-mapfiles": "1.1.0",
      "twixes.pypi-assistant": "2.0.3"
    }
  }
}

Thanks!

Makoto

Parents
  • Makoto, did you happen to find a solution to this? It has just happened to me about an hour ago on a MacOS device as well. I was running a debugger session, then everything went haywire with this "Found GnuLd: ld.bfd" message running there forever. I've tried exiting and even wiping out my build configurations and making new ones but it's just stuck... Thinking about removing and reinstalling the extensions.

  • For me, the problem was in the individual .vscode settings in each app directory. I have a number of different workspaces and found that the problem travels with the workspace, so one works, the other doesn't. I compared the <appname>/.vscode/c_cpp_properties.json files between the working and non-working apps and found that the broken apps had lost a specific Mac-only setting. The following is a working example. The problem entry in my case was the "macFrameworkPath" which had just empty brackets for the broken apps. This happened spontaneously while debugging, and I found a few other changes the Debugger makes to these files, apparently automatically (and sometimes disastrously. I suspect only Macs are impacted due to the value I restored, and the disappearance of the problem. After you edit the value, be sure to save and close your workspace, then reopen it from the file to get the extension to process it (you could probably also restart the extension, but I'm not that trusting when I hit a bug like this).

    {
    "configurations": [
    {
    "name": "Mac",
    "includePath": [
    "${workspaceFolder}/**",
    "/opt/nordic/ncs/v2.9.0/zephyr/include/**"
    ],
    "defines": [],
    "macFrameworkPath": [
    "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks"
    ],
    "cStandard": "c17",
    "cppStandard": "c++17"
    }
    ],
    "version": 4
    }
    If all yours have lost the macFrameworkPath, making a brand new workspace should recreate a template for you from your system that you can then copy to the broken projects.
    Hope this helps!
Reply
  • For me, the problem was in the individual .vscode settings in each app directory. I have a number of different workspaces and found that the problem travels with the workspace, so one works, the other doesn't. I compared the <appname>/.vscode/c_cpp_properties.json files between the working and non-working apps and found that the broken apps had lost a specific Mac-only setting. The following is a working example. The problem entry in my case was the "macFrameworkPath" which had just empty brackets for the broken apps. This happened spontaneously while debugging, and I found a few other changes the Debugger makes to these files, apparently automatically (and sometimes disastrously. I suspect only Macs are impacted due to the value I restored, and the disappearance of the problem. After you edit the value, be sure to save and close your workspace, then reopen it from the file to get the extension to process it (you could probably also restart the extension, but I'm not that trusting when I hit a bug like this).

    {
    "configurations": [
    {
    "name": "Mac",
    "includePath": [
    "${workspaceFolder}/**",
    "/opt/nordic/ncs/v2.9.0/zephyr/include/**"
    ],
    "defines": [],
    "macFrameworkPath": [
    "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks"
    ],
    "cStandard": "c17",
    "cppStandard": "c++17"
    }
    ],
    "version": 4
    }
    If all yours have lost the macFrameworkPath, making a brand new workspace should recreate a template for you from your system that you can then copy to the broken projects.
    Hope this helps!
Children
No Data
Related