nRF Connect for VS Code unable to connect to device

Hi!

I'm trying out the nRF Connect for VS Code on a M1 Mac, and have a nRF9160-DK connected.

The VS Code stuff works fine, I'm able to build sample programs fine, but the nRF9160-DK does not show up as "Connected Devices".
I'm able to flash the nRF9160-DK with the newly built .hex-file via the SEGGER Jlink program from the command line (JLinkExe), but not able to flash via "Actions" in the VSCode extension ("No devices connected").

Also the Programmer (from the Desktop manager) does not connect to the device.

I've read other posts stating some issues with the M1 Mac versions, so have (also) tried installed x86-versions of the tools, but still no change.

This is output of the system report (if it might help):

# nRFConnect System Report - 2022-01-02T17-57-31.753Z

- System:     Apple Inc. MacBookPro17,1
- BIOS:       Apple Inc. null
- CPU:        1 x Apple M1 2.4 GHz 8 cores (8 physical)
- Memory:     39.6 MB free of 16 GB total
- Filesystem: /dev/disk3s1s1 (APFS) 460.4 GB 5.8% used

- OS:         macOS (11.6.1) darwin x64

- Versions
    - kernel: 20.6.0
    - git: 2.30.1
    - node: 14.16.0
    - python: 2.7.16
    - python3: 3.8.9

- Connected devices:
    - /dev/tty.usbmodem0009600048861: 000960004886 PCA10090

Any hints of how to solve this?

  • Hi,

    What version of nrfjprog and JLink do you have installed? You can find this by running nrfjprog --version in a terminal. Can you check if nrfjprog is able to see your device, using nrfjprog --com?

    Can you share the support information from VS Code? Open Command Palette in VS Code and use the command nRF Connect: Generate Support Information to generate this, then upload the information here.

    Best regards,

    Marte

  • Hi Marte, and thanks for your fast reply!

    I have installed 10.14.0 of the command line tools, and JLink is on version 7.52d.

    And, looks like you're into something:

    aeh-mbp:v1.8.0 alfe$ nrfjprog --version --log
    ERROR: [SeggerBackend] - Dll failed to open.
    ERROR: JLinkARM DLL load failed. Try again. If it keeps failing, please
    ERROR: reinstall latest JLinkARM from Segger webpage.

    aeh-mbp:v1.8.0 alfe$ nrfjprog --com
    ERROR: JLinkARM DLL load failed. Try again. If it keeps failing, please
    ERROR: reinstall latest JLinkARM from Segger webpage.
    NOTE: For additional output, try running again with logging enabled (--log).
    NOTE: Any generated log error messages will be displayed.
    aeh-mbp:v1.8.0 alfe$

    Support info from VSCode:

    {
      "platform": {
        "os": "darwin",
        "osVersion": "Darwin Kernel Version 20.6.0: Tue Oct 12 18:33:38 PDT 2021; root:xnu-7195.141.8~1/RELEASE_ARM64_T8101",
        "osKernel": "20.6.0",
        "vscode": "1.63.2",
        "electron": "13.5.2",
        "node": "v14.16.0"
      },
      "system": {
        "date": "2022-01-03T15:50:33.381Z",
        "vscodeRoot": "/Applications/Visual Studio Code.app/Contents/Resources/app",
        "nrfConnectForDesktopInstalled": true,
        "vscodeUptime": "22:49:07",
        "osUptime": "1131:41:51",
        "cpu": {
          "model": "Apple M1",
          "speed": "24 MHz",
          "count": 4
        },
        "memory": {
          "total": "16.00 GB",
          "free": "0.02 GB"
        }
      },
      "workspace": {
        "name": "workspace (Workspace)",
        "workspaceFile": "/Users/alfe/Documents/NRF/azure_iot_hub/workspace.code-workspace",
        "folders": [
          "/Users/alfe/Documents/NRF",
          "/Users/alfe/Documents/NRF/blinky2",
          "/Users/alfe/Documents/NRF/hello_world3",
          "/Users/alfe/Documents/NRF/azure_iot_hub"
        ]
      },
      "extensions": {
        "internal": {
          "nordic-semiconductor.nrf-connect": {
            "version": "2021.12.137",
            "path": "/Users/alfe/.vscode/extensions/nordic-semiconductor.nrf-connect-2021.12.137",
            "isActive": true
          },
          "nordic-semiconductor.nrf-terminal": {
            "version": "2021.11.7",
            "path": "/Users/alfe/.vscode/extensions/nordic-semiconductor.nrf-terminal-2021.11.7",
            "isActive": true
          },
          "nordic-semiconductor.devicetree": null,
          "nordic-semiconductor.kconfig": null
        },
        "external": {
          "marus25.cortex-debug": "0.4.10",
          "ms-vscode.cpptools": "1.7.1",
          "ms-vscode.js-debug": "1.62.0",
          "ms-vscode.js-debug-companion": "1.0.15",
          "ms-vscode.references-view": "0.0.81",
          "ms-vscode.vscode-js-profile-table": "0.0.18",
          "atlassian.atlascode": "2.10.1",
          "cschlosser.doxdocgen": "1.3.2",
          "janjoerke.jenkins-pipeline-linter-connector": "1.2.0",
          "jeff-hykin.better-cpp-syntax": "1.15.10",
          "ms-azuretools.vscode-azureappservice": "0.23.0",
          "ms-azuretools.vscode-azurefunctions": "1.6.0",
          "ms-azuretools.vscode-azureresourcegroups": "0.4.0",
          "ms-python.python": "2021.12.1559732655",
          "ms-python.vscode-pylance": "2021.12.2",
          "ms-toolsai.jupyter": "2021.11.1001550889",
          "ms-toolsai.jupyter-keymap": "1.0.0",
          "ms-toolsai.jupyter-renderers": "1.0.4",
          "ms-vscode-remote.remote-containers": "0.209.6",
          "ms-vscode-remote.remote-ssh": "0.70.0",
          "ms-vscode-remote.remote-wsl": "0.63.13",
          "ms-vscode.azure-account": "0.9.11",
          "ms-vscode.cmake-tools": "1.9.2",
          "ms-vscode.cpptools-extension-pack": "1.1.0",
          "ms-vscode.cpptools-themes": "1.0.0",
          "redhat.java": "1.2.0",
          "redhat.vscode-yaml": "1.2.2",
          "siegebell.incremental-search": "0.2.1",
          "trond-snekvik.gnu-mapfiles": "1.1.0",
          "twxs.cmake": "0.0.17",
          "VisualStudioExptTeam.vscodeintellicode": "1.2.15",
          "vscjava.vscode-java-debug": "0.37.0",
          "vscjava.vscode-java-dependency": "0.18.9",
          "vscjava.vscode-java-pack": "0.20.0",
          "vscjava.vscode-java-test": "0.33.1",
          "vscjava.vscode-maven": "0.34.2"
        }
      },
      "tools": {
        "/Applications/SEGGER/JLink/JLinkExe": "7.52d",
        "/usr/local/bin/nrfjprog": null,
        "/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": "1959",
        "/opt/nordic/ncs/v1.8.0/toolchain/bin/git": "2.32.0"
      },
      "connectedDevices": [],
      "config": {
        "nordic-semiconductor.nrf-connect": {
          "topdir": "${nrf-connect.sdk:1.8.0}",
          "toolchain": {
            "path": "${nrf-connect.toolchain:1.8.0}"
          },
          "ozonePath": "",
          "applications": [
            "${workspaceFolder}/blinky2",
            "${workspaceFolder}/hello_world3",
            "${workspaceFolder}/azure_iot_hub"
          ],
          "jlink": {
            "rtosPlugin": ""
          },
          "kconfig": {
            "interface": "kconfig"
          },
          "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": ""
        },
        "marus25.cortex-debug": {
          "armToolchainPath": null,
          "armToolchainPrefix": "arm-none-eabi",
          "gdbPath": 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
        }
      },
      "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/alfe",
          "PATH": "/opt/nordic/ncs/v1.8.0/toolchain/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/Visual Studio Code.app/Contents/Resources/app/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": "alfe"
        },
        "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
      }
    }
    
    

    BR

    -Alf

  • Hi Alf,

    Where did you install nRF Command Line Tools, and is it added to PATH? The default location on macOS is /Applications/Nordic Semiconductor/.

    From the support information it looks like VS Code is looking for nrfjprog in /usr/local/bin/nrfjprog, but it does not seem to find anything there, since the version is "null".

    Best regards,

    Marte

  • Hi Marte,

    Yes, the Command Line Tools are installed under /Applications/Nordic Semiconductor, and there are symlinks installed in /usr/local/bin/ (which is in the PATH) pointing to the actual programs:

    aeh-mbp:~ alfe$ ls -ltr /usr/local/bin/nrfjprog 
    lrwxr-xr-x  1 root  admin  47 Jan  2 18:44 /usr/local/bin/nrfjprog -> /Applications/Nordic Semiconductor/bin/nrfjprog
    
    aeh-mbp:~ alfe$ ls -ltr "/Applications/Nordic Semiconductor/bin/"
    total 15952
    -rwxr-xr-x  1 root  wheel  4601664 Aug 27 14:23 jlinkarm_nrf_worker_osx
    -rwxr-xr-x  1 root  wheel  2561584 Aug 27 14:23 nrfjprog
    -rwxr-xr-x  1 root  wheel   997584 Aug 27 14:23 mergehex
    aeh-mbp:~ alfe$ 
    

    If I try to run from the install directory I get the same error (also adding it to the PATH does not seem to help):

    aeh-mbp:~ alfe$ pwd
    /Users/alfe
    aeh-mbp:~ alfe$ echo $PATH
    /Applications/Nordic Semiconductor/bin/:/opt/nordic/ncs/v1.8.0/toolchain/bin/:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/Visual Studio Code.app/Contents/Resources/app/bin/
    aeh-mbp:~ alfe$ 
    aeh-mbp:~ alfe$ nrfjprog -v --log
    ERROR: [SeggerBackend] - Dll failed to open.
    ERROR: JLinkARM DLL load failed. Try again. If it keeps failing, please
    ERROR: reinstall latest JLinkARM from Segger webpage.
    aeh-mbp:~ alfe$ 

  • Hi,

    Can you try updating to version 10.15.1 of nRF Command Line Tools? There is an issue with 10.14.0 on M1, but this should be fixed in 10.15.0.

    Best regards,

    Marte

Related