This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF Connect VS Code extension no connected devices

Hello,

I recently installed the nRF Connect extension for VS Code on my Mac M1. I am unable to see my connected board as part of the nRF Connect extension.

Setup

  • nrfjprog version: 10.14.0 external
  • JLinkARM.dll version: 7.54c
  • M1 Macbook

Something odd I noticed is when I ran the nrfjprog command in the terminal I get:

nrfjprog --version --log
ERROR: [SeggerBackend] - The J-Link library does not support execution inside rosetta 2. Try executing with arch -arch arm64 nrfjprog...
ERROR: An internal error has occurred, please try again.

If I run with the suggested option then it completes successfully:

arch -arch arm64 nrfjprog -v
nrfjprog version: 10.14.0 external
JLinkARM.dll version: 7.54c

I am then also able to see the serial number of the debugger connected:

arch -arch arm64 nrfjprog --ids
683511319

Am I missing something in my VS Code setup? Is there a known issue with the VS Code extension on M1 mac?

  • Hi,

    This sounds similar to another issue that we're investigating. We'll hopefully have a fix soon. Just so we have an additional data point to work with, could you please run the following steps:

    1. Open the command palette, and run the "nRF Connect: Generate Support Information" command.

    2. Find the "tools" and "environment" entries in the JSON entry that should have opened up.

    3. Paste that in a reply here

    It would be particularly interesting to see if the extension can find nrfjprog in your PATH.

    Kind regards,

    Dee,

    VS Code Team

  • Hi Dee,

    It looks like the tools section doesn't find the different paths. Why is that?

    "tools": {
    "jlink": null,
    "nrfjprog": null,
    "cmake": null,
    "west": null,
    "python": null,
    "ninja": null,
    "gperf": null,
    "dtc": null,
    "gnuarmemb": null,
    "gn": null
    },

    "environment": {
    "westExe": "/opt/nordic/ncs/v1.6.1/toolchain/bin/west",
    "westEnv": {
    "ELECTRON_RUN_AS_NODE": "1",
    "GIT_EXEC_PATH": "/opt/nordic/ncs/v1.6.1/toolchain/Cellar/git/2.32.0_1/libexec/git-core",
    "HOME": "/Users/user",
    "PATH": "/opt/nordic/ncs/v1.6.1/toolchain/bin:/usr/bin:/bin:/usr/sbin:/sbin",
    "ZEPHYR_BASE": "/opt/nordic/ncs/v1.6.1/zephyr",
    "GNUARMEMB_TOOLCHAIN_PATH": "/opt/nordic/ncs/v1.6.1/toolchain",
    "ZEPHYR_TOOLCHAIN_VARIANT": "gnuarmemb",
    "USER": "user"
    },
    "toolchainPath": "/opt/nordic/ncs/v1.6.1/toolchain",
    "toolchainBinPath": "/opt/nordic/ncs/v1.6.1/toolchain/bin",
    "toolchainVersion": "1.6.1"
    },
    Kind regards
  • Hi,

    It looks like your PATH is missing the /usr/local/bin directory. When I run which on the various tools, they are all located there. If that directory is not in your PATH, please add it and try again.

    If you still have problems, can you confirm which shell you are using? If you're using zsh, please try copying your environment variables to your ~/.profile file.  The extension currently has a few issues with picking up variables defined in .zshrc, which we're working to improve.

    -Dee

  • Hi, 

    My tools are indeed in /usr/local/bin directory which is missing from "PATH": "/opt/nordic/ncs/v1.6.1/toolchain/bin:/usr/bin:/bin:/usr/sbin:/sbin" in westEnv. However, I don't know how this west environemnt path is generated. I know the first part is based on the settings for the toolchain (/opt/nordic/ncs/v1.6.1/toolchain/bin) however I don't know how the second part is picked up (/usr/bin:/bin:/usr/sbin:/sbin). 

    I put in my ~/.profile:

    export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:$PATH

    Which seems to be working fine when I do:

    echo $PATH
    /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/VMware Fusion.app/Contents/Public:/Library/TeX/texbin:/opt/X11/bin

    But still not updating the PATH in westEnv and not seeing the tools picked up.

    Thanks.

  • Hi julien.h,

    Unfortunately there is no fix at the moment to this issue since there are some parts in this setup that have no M1 support. In any case we are aware and we try to work out the solution.

    Bence

    VS Code Team  

Related