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 Marte,

    Then I've installed 10.15.1 of the command line tools, and also version 7.58b of the Segger JLink.

    Now nrfjprog runs ok, here is the output:


    aeh-mbp:~ alfe$ nrfjprog -v --log
    nrfjprog version: 10.15.1 external
    JLinkARM.dll version: 7.58b
    aeh-mbp:~ alfe$

    But the is still no sign of any connected devices in VSCode, and when I start the Programmer from the desktop tool I get this error:

    13:18:56.159	Failed to get the library versions: JLINKARM_DLL_COULD_NOT_BE_OPENED (Origin: "Failed to get module versions.")
    13:18:56.367	Application data folder: /Users/alfe/Library/Application Support/nrfconnect/pc-nrfconnect-programmer
    13:18:58.012	Error while probing devices, more details in the debug log: JLINKARM_DLL_COULD_NOT_BE_OPENED (Origin: "Error when running nrfdl_enumerate")

    I've re-installed the Programmer, but same error.

    Does this bring us any closer to the problem?

  • Hi Alf,

    Great to hear that nrfjprog runs now. That solves one issue at least.

    What version of nRF Connect for Desktop do you have installed? Version 3.9.2 was released yesterday. Can you try installing it and see if anything changes? The installation is not available on our download page yet, but there should be a pop up asking you to install 3.9.2 when opening nRF Connect for Desktop if you have not already. If not, you can try going to settings -> check for updates, or you can download it from here: https://github.com/NordicSemiconductor/pc-nrfconnect-launcher/releases.

    Best regards,

    Marte

  • Actually, I also installed the newest version of VSCode (Apple Silicon, NOT the Universal), and now it works a little better!

    I can see the nRF9169 board under "Connected Devices", and I'm abel to e.g. debug a program on the board via Actions->Debug.

    However, flashing the device still fails (via Actions->Flash), this is the error message:

    > Executing task: nRF Connect: Flash blinky2/build (active) <
    
    Flashing build to undefined
    west flash -d /Users/alfe/Documents/NRF/blinky2/build --skip-rebuild -r nrfjprog --snr 960004886
    
    -- west flash: using runner nrfjprog
    -- runners.nrfjprog: Flashing file: /Users/alfe/Documents/NRF/blinky2/build/zephyr/merged.hex
    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.
    FATAL ERROR: command exited with status 32: nrfjprog --program /Users/alfe/Documents/NRF/blinky2/build/zephyr/merged.hex --sectorerase -f NRF91 --snr 960004886
    The terminal process terminated with exit code: 32.

    However, flashing the device via the command line directly with nrfjprog works fine:

    aeh-mbp:hello_world3 alfe$ nrfjprog -f NRF91 --program build/zephyr/merged.hex 
    Parsing image file.
    Verified OK.
    

    But running the "west flash"-command fetched from VSCode on the same command line fails (with the same DLL error message).

    BR

    -Alf

  • Ok, still progress...

    I've installed 3.9.2 of the desktop (Settings->Check for updates).
    No visible change (other than the version no), I guess the Programmer has the same version (2.0.1), and that still fails on startup: "Failed to get the library versions: JLINKARM_DLL_COULD_NOT_BE_OPENED (Origin: "Failed to get module versions.")"

    And, as stated above, "west flash" fails, but calling nrfjprog directly works.

    -Alf

  • Hi Alf,

    ArmNewbie said:
    I guess the Programmer has the same version (2.0.1)

    The Programmer version is the same, but there were some updates in the underlying libraries, and I was hoping these updates might fix the problem.

    I will report this to our developers, and I will also ask if there are any workarounds. Could you please generate the support information from VS Code again, to have the updated information now that you have updated some of the tools?

    Best regards,

    Marte

Related