Unable to flash / debug device based on nRF52840 with J-LINK in the nRF Connect SDK (VS Code)

Hi, 

I am completely new to the nRF Connect SDK and trying to get used to it and having trouble with flashing / debugging the device using J-Link.

It shows the J-Link in the Connected Devices as 50117619, and displays the correct MCU, I can recover, and erase the device without issues, but when comes to flashing it gives me the error mentioned below. As well as it showing J-Link as J-Link in the nRF Programmer app.

The following error in the Terminal:

Flashing build to 50117619
C:\Windows\system32\cmd.exe /d /s /c "west flash -d c:\Nordic\MyApps\MyCentral\build --skip-rebuild -i 50117619"

-- west flash: using runner jlink
FATAL ERROR: required program JLink.exe not found; install it or add its location to PATH

Where and how should I add the PATH for the JLink.exe, please? Why it is so complicated?

Hardware: Adafruit Feather nRF52840 Express

SDK: nRF Connect SDK v2.3.0

Programmer: J-Link Base

Thanks,
Jev

  • Hello Jev,

    The nRF Command Line Tools should be setup and added to path as part of your toolchain installation (through the Toolchain Manager), but perhaps something failed during the install.
    Are you able to run commands such as nrfjprog --version from a cmd terminal?

    Could you download the nRF Command Line Tools from here, and re-install them to see if this resolves the issue?

    Best regards,
    Karl


  • Hi Karl,


    Yes, I can run the commands.


    nrfjprog --version command gives the following in reply:

    nrfjprog version: 10.19.0 external

    JLinkARM.dll version: 7.80c

    How could I add the path, please?

    Thanks,
    Jev

  • Hi Karl,

    Just a quick update. I did manage to get the J-Link to program the board, but only on another PC. But I am still struggling to get it working on my main PC which I use for work. 


    I have tried deleting and uninstalling everything and install a fresh copy, but with no luck. 


    For some reason it doesn't find toolchain and SDK anymore. Everytime I open Visual Studio it gives me the following notification:

    Warning: This workspace requires version 2.3.0 of the nRF Connect SDK, but it isn't installed. Would you like to open the Toolchain Manager to install it?
    Source: nRF Connect for VS Code (Extension)
    InstallIgnore
    When I try to Setup SDK and toolchain via Quick Setup window, it selects nRF Connect SDK with no issues, but when I am selecting toolchain it tells the following:
    No toolchains found

    Invalid Toolchain Installation
    - jlink is required but not found. Please ensure that SEGGER J-Link Software and Documentation Pack is installed.
    Any advice why is that happening and how I could get it working?

    TIA
  • Hello Jev,

    Thank you for your patience with this, and thank you for the update on the issue.

    Since you are able to run the --version command in the cmd prompt then it means that the commandline tools are successfully added to the path.

    Jev said:

    I have tried deleting and uninstalling everything and install a fresh copy, but with no luck. 

    What is the path to the location of your SDK?

    Jev said:

    For some reason it doesn't find toolchain and SDK anymore. Everytime I open Visual Studio it gives me the following notification:

    Warning: This workspace requires version 2.3.0 of the nRF Connect SDK, but it isn't installed. Would you like to open the Toolchain Manager to install it?
    Source: nRF Connect for VS Code (Extension)
    InstallIgnore
    When I try to Setup SDK and toolchain via Quick Setup window, it selects nRF Connect SDK with no issues, but when I am selecting toolchain it tells the following:

    Could you go to open VSC through the toolchain manager, to see if this message shows up then as well?
    I.e go into the nRF Connect for Desktop application -> Toolchain Manager -> select 'open Visual Studio Code' on the v2.3.0 prompt.
    This way, the toolchain manager will check that all VSC dependencies are set correctly, and report any issues.
    Please try this and let me know if the error message changes when you do this.

    Could you also confirm how you installed the SDK when you did - did you use the nRF Connect for Desktop Toolchain Manager, or did you install it manually?

    Best regards,
    Karl

  • What is the path to the location of your SDK?

    I have tried to install into different folders

    C:\ncs\

    C:\ncs\v2.3.0

    C:\ncs\toolchains\v2.3.0

    As well as into following ones:

    C:\NordicSemi\

    C:\NordicSemi\v2.3.0

    C:\NordicSemi\toolchains\v2.3.0

    None of them working.

    Could you go to open VSC through the toolchain manager, to see if this message shows up then as well?

    I have tried both ways, run separately or through the toolchain manager (mainly toolchain manager) and yes it still there

    This way, the toolchain manager will check that all VSC dependencies are set correctly, and report any issues.

    I always use this VSC opening method. I have also tried to Update SDK and Toolchain from there. Tried to install different SDK (v2.2.0), as well as tried different versions of J-Link versions. Tried to install different versions of Toolchain Manager (32bit as well as 64bit). I have tried completely uninstall and install everything back again with no luck. BTW toolchain manager can see the SDK and toolchain and opens the correct folders. But when I am trying to add during the Quick Setup of nRF Connect in the VSC it fails

    It fails to display the SDK & toolchain in the dropdown menu. As well as it straight away displays the following message.

    Even when manually selected through the browse in the dropdown menu it fails. And when selecting toolchain it doesn't show it's version like with SDK above. 


    Could you also confirm how you installed the SDK when you did - did you use the nRF Connect for Desktop Toolchain Manager, or did you install it manually?

    Everything was installed to the guide provided with the nRF Connect SDK video: 
    nRF Connect for VS Code, part 1: Installation


    Also, I have got another personal laptop, which successfully installed everything and works with no issue including programming using the J-Link. Installed in exactly the same way, the only difference it was installed from fresh, it was never installed on a personal laptop before.

    I hope that answers your questions.

    Thanks,
    Jev

Related