NRF Connect - Can't Open VS Code from Toolchain

Hi - Recently, the NRF Connect Toolchain manager stopped being able to open VS Code and hangs spinning - screenshot below. It used to work so I'm not sure what's changed...

I am on a Mac M1 MacOS Monterey 12.0.1.

Toolchain manager v.0.10.3

nRF Connect for Desktop v3.10.0; SDK v.1.8.0

I include the output from VS Code  - Generate Support Info below (I ran VS code separately after Toolchain manager failed to open it).

Is there a way to manually set all the proper VS Code extension variable settings so I can develop from within VS Code without relying on the Toolchain manager to launch VS Code, or is there something obvious I'm not doing properly?

I saw someone else report that they encountered a similar error but they mistakenly already had VS Code running - that is not my issue. I made sure VS Code was not already running.

Thanks - appreciate any help or guidance! Dan.

Note: per the installation instructions, I installed the x64 version of VS Code: Version: 1.64.1


Commit: d6ee99e4c045a6716e5c653d7da8e9ae6f5a8b03
Date: 2022-02-07T17:26:08.977Z
Electron: 13.5.2
Chromium: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Darwin x64 21.1.0

[19:59:59] west build --build-dir /Users/me/dev/nordic/blinky/build /Users/me/dev/nordic/blinky --pristine --board nrf5340dk_nrf5340_cpuapp -- -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=On -DNCS_TOOLCHAIN_VERSION:STRING="NONE" -DBOARD_ROOT:STRING="/Users/me/dev/nordic/mylock" -DCONFIG_DEBUG_OPTIMIZATIONS:STRING="y" -DCONFIG_DEBUG_THREAD_INFO:STRING="y" -DCONF_FILE:STRING="/Users/me/dev/nordic/blinky/prj.conf"
[19:59:59] Failure (code 2).
[20:00:09] west build --build-dir /Users/me/dev/nordic/blinky/build /Users/me/dev/nordic/blinky --pristine --board nrf5340dk_nrf5340_cpuapp -- -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=On -DNCS_TOOLCHAIN_VERSION:STRING="NONE" -DBOARD_ROOT:STRING="/Users/me/dev/nordic/mylock" -DCONFIG_DEBUG_OPTIMIZATIONS:STRING="y" -DCONFIG_DEBUG_THREAD_INFO:STRING="y" -DCONF_FILE:STRING="/Users/me/dev/nordic/blinky/prj.conf"
[20:00:09] Failure (code 2).
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 21.1.0: Wed Oct 13 17:33:01 PDT 2021; root:xnu-8019.41.5~1/RELEASE_ARM64_T6000",
    "osKernel": "21.1.0",
    "vscode": "1.64.1",
    "electron": "13.5.2",
    "node": "v14.16.0"
  },
  "system": {
    "date": "2022-02-09T04:02:34.189Z",
    "vscodeRoot": "/Applications/Visual Studio Code.app/Contents/Resources/app",
    "nrfConnectForDesktopInstalled": true,
    "vscodeUptime": "00:03:04",
    "osUptime": "00:13:04",
    "cpu": {
      "model": "Apple M1 Max",
      "speed": "24 MHz",
      "count": 5
    },
    "memory": {
      "total": "32.00 GB",
      "free": "3.65 GB"
    }
  },
  "workspace": {
    "name": "mylock (Workspace)",
    "workspaceFile": "/Users/me/dev/nordic/mylock/src/mylock.code-workspace",
    "folders": [
      "/Users/me/dev/nordic/mylock",
      "/Users/me/dev/nordic/blinky"
    ]
  },
  "extensions": {
    "internal": {
      "nordic-semiconductor.nrf-connect": {
        "version": "2022.1.192",
        "path": "/Users/me/.vscode/extensions/nordic-semiconductor.nrf-connect-2022.1.192",
        "isActive": true
      },
      "nordic-semiconductor.nrf-terminal": {
        "version": "2022.1.30",
        "path": "/Users/me/.vscode/extensions/nordic-semiconductor.nrf-terminal-2022.1.30",
        "isActive": true
      },
      "nordic-semiconductor.devicetree": null,
      "nordic-semiconductor.kconfig": null
    },
    "external": {
      "marus25.cortex-debug": "1.2.2",
      "ms-vscode.cpptools": "1.8.5",
      "ms-vscode.js-debug": "1.64.2",
      "ms-vscode.js-debug-companion": "1.0.15",
      "ms-vscode.references-view": "0.0.81",
      "ms-vscode.vscode-js-profile-table": "0.0.18",
      "cschlosser.doxdocgen": "1.3.2",
      "jeff-hykin.better-cpp-syntax": "1.15.11",
      "ms-azuretools.vscode-docker": "1.19.0",
      "ms-vscode-remote.remote-containers": "0.217.1",
      "ms-vscode-remote.remote-ssh": "0.70.0",
      "ms-vscode-remote.remote-wsl": "0.64.2",
      "ms-vscode.cmake-tools": "1.9.2",
      "ms-vscode.cpptools-extension-pack": "1.1.0",
      "ms-vscode.cpptools-themes": "1.0.0",
      "trond-snekvik.gnu-mapfiles": "1.1.0",
      "twxs.cmake": "0.0.17"
    }
  },
  "tools": {
    "/Applications/SEGGER/JLink/JLinkExe": "7.58b",
    "/usr/local/bin/nrfjprog": "10.15.1",
    "/opt/nordic/ncs/v1.8.0/toolchain/bin/cmake": "3.21.1",
    "/opt/nordic/ncs/v1.8.0/toolchain/bin/west": "0.12.0",
    "/opt/nordic/ncs/v1.8.0/toolchain/bin/python3": "3.9.6",
    "/opt/nordic/ncs/v1.8.0/toolchain/bin/ninja": "1.10.2",
    "/opt/nordic/ncs/v1.8.0/toolchain/bin/gperf": "3.1",
    "/opt/nordic/ncs/v1.8.0/toolchain/bin/dtc": "1.6.1",
    "/opt/nordic/ncs/v1.8.0/toolchain/bin/arm-none-eabi-gcc": "9-2019-q4-major",
    "/opt/nordic/ncs/v1.8.0/toolchain/bin/gn": "1961",
    "/opt/nordic/ncs/v1.8.0/toolchain/bin/git": "2.32.0"
  },
  "connectedDevices": [
    {
      "id": "1050007787"
    }
  ],
  "config": {
    "nordic-semiconductor.nrf-connect": {
      "topdir": "${nrf-connect.sdk:1.8.0}",
      "toolchain": {
        "path": "${nrf-connect.toolchain:1.8.0}"
      },
      "ozonePath": "",
      "applications": [
        "/Users/me/dev/nordic/mylock",
        "/Users/me/dev/nordic/blinky"
      ],
      "jlink": {
        "rtosPlugin": ""
      },
      "kconfig": {
        "interface": "guiconfig"
      },
      "welcome": {
        "showOnStartup": false
      },
      "west": {
        "env": {
          "$base": "terminal"
        }
      },
      "boardRoots": [],
      "enableTelemetry": false
    },
    "nordic-semiconductor.nrf-terminal": {
      "terminalMode": "character"
    },
    "nordic-semiconductor.devicetree": {
      "modules": [
        "${zephyrBase}",
        "${zephyrBase}/../nrf",
        "."
      ],
      "zephyr": "",
      "ctxFile": "",
      "defaultBoard": ""
    },
    "nordic-semiconductor.kconfig": {
      "root": "",
      "env": {},
      "cfiles": true,
      "disable": false,
      "zephyr": {
        "base": ""
      },
      "python": "",
      "liveValue": true
    },
    "marus25.cortex-debug": {
      "armToolchainPath": null,
      "armToolchainPrefix": "arm-none-eabi",
      "gdbPath": null,
      "objdumpPath": null,
      "JLinkGDBServerPath": null,
      "openocdPath": null,
      "pyocdPath": null,
      "PEGDBServerPath": null,
      "stutilPath": null,
      "stlinkPath": null,
      "stm32cubeprogrammer": null,
      "enableTelemetry": true,
      "flattenAnonymous": false,
      "registerUseNaturalFormat": true,
      "variableUseNaturalFormat": true,
      "dbgServerLogfile": null,
      "showDevDebugOutput": "none"
    }
  },
  "environment": {
    "westExe": "/opt/nordic/ncs/v1.8.0/toolchain/bin/west",
    "westEnv": {
      "ELECTRON_RUN_AS_NODE": "1",
      "GIT_EXEC_PATH": "/opt/nordic/ncs/v1.8.0/toolchain/Cellar/git/2.32.0_1/libexec/git-core",
      "HOME": "/Users/me",
      "PATH": "/opt/nordic/ncs/v1.8.0/toolchain/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin",
      "ZEPHYR_BASE": "/opt/nordic/ncs/v1.8.0/zephyr",
      "GNUARMEMB_TOOLCHAIN_PATH": "/opt/nordic/ncs/v1.8.0/toolchain",
      "ZEPHYR_TOOLCHAIN_VARIANT": "gnuarmemb",
      "USER": "me"
    },
    "toolchainPath": "/opt/nordic/ncs/v1.8.0/toolchain",
    "toolchainBinPath": "/opt/nordic/ncs/v1.8.0/toolchain/bin",
    "toolchainVersion": "1.8.0"
  },
  "terminal": {
    "shell": null,
    "defaultProfile": null
  }
}


Parents Reply Children
  • I also am having this issue on an M1 Mac, just as Dan and Griffin described. 

    In addition, Griffin and I are having build issues that might be resolved if we can launch VS Code via Toolchain Manager, assuming it sets up environment variables necessary to build a project with MCUBOOT. 

    https://devzone.nordicsemi.com/f/nordic-q-a/84157/sudden-build-errors-in-visual-studio-code

    Thanks,

    Steve

  • Hi Steve,

    I have conveyed this internally. As far as I know, the Toolchain Manager does not set any environment variables, so you don't necessarily have to open it through the VS Code. But an improper west installation can cause the the variables to not be set. It would be helpful if you could provide the information from "Generate Support Information" in VS Code.

    Regards,

    Priyanka

  • Hi Priyanka,

    Thanks for your reply. 

    Hopefully sometime you or your colleagues can try using VS Code and the nRF extensions on an M1 Mac to build either the ble_dfu_peripheral_lbs app or the asset_tracker_v2 app. If you can reproduce the issue there, that would make a solution much more possible. 

    I listed my repro sequence in this thread: 

    https://devzone.nordicsemi.com/f/nordic-q-a/84157/sudden-build-errors-in-visual-studio-code

    Here's my support info, this time attempting to use the asset_tracker_v2 sample app, which Dejans recommended in our other support thread. 

    Best,

    Steve

    [10:52:05] west build --build-dir /Users/Steve/Projects/asset_tracker_v2/build /Users/Steve/Projects/asset_tracker_v2 --pristine --board nrf52840dk_nrf52840 -- -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=On -DNCS_TOOLCHAIN_VERSION:STRING="NONE" -DCONFIG_DEBUG_OPTIMIZATIONS=y -DCONFIG_DEBUG_THREAD_INFO=y -DBOARD_ROOT:STRING="/Users/Steve/Projects/asset_tracker_v2"
    [10:52:08] Failure (code 1).
    [10:53:43] west build --build-dir /Users/Steve/Projects/asset_tracker_v2/build /Users/Steve/Projects/asset_tracker_v2 --pristine --board nrf52840dk_nrf52840 -- -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=On -DNCS_TOOLCHAIN_VERSION:STRING="NONE" -DBOARD_ROOT:STRING="/Users/Steve/Projects/asset_tracker_v2" -DCONFIG_DEBUG_OPTIMIZATIONS:STRING="y" -DCONFIG_DEBUG_THREAD_INFO:STRING="y" -DCONF_FILE:STRING="/Users/Steve/Projects/asset_tracker_v2/prj.conf"
    [10:53:46] Failure (code 1).
    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 20.6.0: Wed Jun 23 00:26:27 PDT 2021; root:xnu-7195.141.2~5/RELEASE_ARM64_T8101",
        "osKernel": "20.6.0",
        "vscode": "1.65.2",
        "electron": "13.5.2",
        "node": "v14.16.0"
      },
      "system": {
        "date": "2022-03-14T19:00:57.210Z",
        "vscodeRoot": "/Applications/Visual Studio Code.app/Contents/Resources/app",
        "nrfConnectForDesktopInstalled": true,
        "vscodeUptime": "01:09:16",
        "osUptime": "72:27:32",
        "cpu": {
          "model": "Apple M1",
          "speed": "24 MHz",
          "count": 4
        },
        "memory": {
          "total": "16.00 GB",
          "free": "0.05 GB"
        }
      },
      "workspace": {
        "name": "asset_tracker_v2",
        "workspaceFile": null,
        "folders": [
          "/Users/Steve/Projects/asset_tracker_v2"
        ]
      },
      "extensions": {
        "internal": {
          "nordic-semiconductor.nrf-connect": {
            "version": "2022.3.70",
            "path": "/Users/Steve/.vscode/extensions/nordic-semiconductor.nrf-connect-2022.3.70",
            "isActive": true
          },
          "nordic-semiconductor.nrf-terminal": {
            "version": "2022.3.16",
            "path": "/Users/Steve/.vscode/extensions/nordic-semiconductor.nrf-terminal-2022.3.16",
            "isActive": true
          },
          "nordic-semiconductor.devicetree": null,
          "nordic-semiconductor.kconfig": null
        },
        "external": {
          "marus25.cortex-debug": "1.2.2",
          "ms-vscode.cpptools": "1.8.4",
          "ms-vscode.js-debug": "1.65.0",
          "ms-vscode.js-debug-companion": "1.0.15",
          "ms-vscode.references-view": "0.0.85",
          "ms-vscode.vscode-js-profile-table": "0.0.18",
          "trond-snekvik.gnu-mapfiles": "1.1.0",
          "twxs.cmake": "0.0.17"
        }
      },
      "tools": {
        "/Applications/SEGGER/JLink/JLinkExe": "7.58b",
        "/usr/local/bin/nrfjprog": "10.15.4",
        "nrfutil": "Not found",
        "/opt/nordic/ncs/v1.9.1/toolchain/bin/cmake": "3.21.1",
        "/opt/nordic/ncs/v1.9.1/toolchain/bin/west": "0.12.0",
        "/opt/nordic/ncs/v1.9.1/toolchain/bin/python3": "3.9.6",
        "/opt/nordic/ncs/v1.9.1/toolchain/bin/ninja": "1.10.2",
        "/opt/nordic/ncs/v1.9.1/toolchain/bin/gperf": "3.1",
        "/opt/nordic/ncs/v1.9.1/toolchain/bin/dtc": "1.6.1",
        "/opt/nordic/ncs/v1.9.1/toolchain/bin/arm-none-eabi-gcc": "9-2019-q4-major",
        "/opt/nordic/ncs/v1.9.1/toolchain/bin/gn": "1977",
        "/opt/nordic/ncs/v1.9.1/toolchain/bin/git": "2.32.0"
      },
      "sdks": [
        {
          "version": "1.8.0",
          "path": "/opt/nordic/ncs/v1.8.0"
        },
        {
          "version": "1.9.1",
          "path": "/opt/nordic/ncs/v1.9.1"
        }
      ],
      "toolchains": [
        {
          "version": "1.9.1",
          "path": "/opt/nordic/ncs/v1.9.1/toolchain"
        },
        {
          "version": "1.8.0",
          "path": "/opt/nordic/ncs/v1.8.0/toolchain"
        }
      ],
      "connectedDevices": [],
      "deviceProviders": [
        "nrfjprog"
      ],
      "config": {
        "nordic-semiconductor.nrf-connect": {
          "topdir": "/opt/nordic/ncs/v1.9.1",
          "toolchain": {
            "path": "/opt/nordic/ncs/v1.9.1/toolchain"
          },
          "ozonePath": "",
          "applications": [
            "/Users/Steve/Projects/asset_tracker_v2"
          ],
          "kconfig": {
            "interface": "kconfig"
          },
          "welcome": {
            "showOnStartup": true
          },
          "west": {
            "env": {
              "$base": "terminal"
            }
          },
          "boardRoots": [],
          "enableTelemetry": true
        },
        "nordic-semiconductor.nrf-terminal": {
          "terminalMode": "character"
        },
        "nordic-semiconductor.devicetree": {
          "modules": [
            "${zephyrBase}",
            "${zephyrBase}/../nrf",
            "."
          ],
          "zephyr": "",
          "ctxFile": "",
          "defaultBoard": ""
        },
        "nordic-semiconductor.kconfig": {
          "root": "",
          "env": {},
          "cfiles": true,
          "disable": false,
          "zephyr": {
            "base": ""
          },
          "python": "",
          "liveValue": true
        },
        "marus25.cortex-debug": {
          "armToolchainPath": null,
          "armToolchainPrefix": "arm-none-eabi",
          "gdbPath": null,
          "objdumpPath": null,
          "JLinkGDBServerPath": null,
          "openocdPath": null,
          "pyocdPath": null,
          "PEGDBServerPath": null,
          "stutilPath": null,
          "stlinkPath": null,
          "stm32cubeprogrammer": null,
          "enableTelemetry": true,
          "flattenAnonymous": false,
          "registerUseNaturalFormat": true,
          "variableUseNaturalFormat": true,
          "dbgServerLogfile": null,
          "showDevDebugOutput": "none"
        }
      },
      "environment": {
        "westExe": "/opt/nordic/ncs/v1.9.1/toolchain/bin/west",
        "westEnv": {
          "ELECTRON_RUN_AS_NODE": "1",
          "GIT_EXEC_PATH": "/opt/nordic/ncs/v1.9.1/toolchain/Cellar/git/2.32.0_1/libexec/git-core",
          "HOME": "/Users/Steve",
          "PATH": "/opt/nordic/ncs/v1.9.1/toolchain/bin:$/Applications/Visual Studio Code.app/Contents/Resources/app/bin:/Users/Steve/share/bin:/usr/local/bin:/Users/Steve/.fastlane/bin:/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Developer/usr/bin:/Users/Steve/bin:/bin:/usr/sbin:/sbin:/usr/bin:/usr/X11/bin:/Users/Steve/bin/svn-scripts/:.:/Users/Steve/Library/Android/sdk/platform-tools:/Applications/Xcode.app/Contents/Applications/Application Loader.app/Contents/Frameworks/ITunesSoftwareService.framework/Versions/A/Support:/Users/Steve/Library/Android/sdk/tools/:/Users/Steve/Library/Android/sdk/build-tools/current",
          "ZEPHYR_BASE": "/opt/nordic/ncs/v1.9.1/zephyr",
          "GNUARMEMB_TOOLCHAIN_PATH": "/opt/nordic/ncs/v1.9.1/toolchain",
          "ZEPHYR_TOOLCHAIN_VARIANT": "gnuarmemb",
          "USER": "Steve"
        },
        "toolchainPath": "/opt/nordic/ncs/v1.9.1/toolchain",
        "toolchainBinPath": "/opt/nordic/ncs/v1.9.1/toolchain/bin",
        "toolchainVersion": "1.9.1"
      },
      "terminal": {
        "shell": null,
        "defaultProfile": null
      }
    }
    
    
     

  • Hi Steve,

    Thank you very much for the information. I will pass this on.

    .Priyanka

Related