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

Parents
  • 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,

    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

  • Hello Jev,

    Thank you for the detailed update.
    Is this a work laptop you are working on? Does this laptop have a strict firewall setup?
    Could you open up the folders in the SDK on your work laptop and your personal one, and see if all the folders are there as expected on the work laptop, or if some/all of their contents are missing on the work laptop?
    Please also check the toolchain folder, to see if it's contents are actually there.

    From your description it sounds to me like there might be something like a firewall or other blocker that keeps these programs from installing their necessary components.
    I've also heard about this in the past for especially aggressive firewalls which would prevent certain repos of the SDK to download.

    If we are able to rule out the firewall / organizational network administration as the root cause of this then my last suggestion would be to go through the Installing the nRF Connect SDK Manually to verify that each step successfully completes, so that we may see exactly which part of the setup it is that is failing (and hopefully why it is failing).

    Best regards,
    Karl

  • Hi Karl, 

    Is this a work laptop you are working on?

    Yes, work laptop which fails, while no problems on my personal laptop (installed just to try on different laptop). 

    Does this laptop have a strict firewall setup?

    Don't think so, same as the personal laptop. How it could be a problem?

    Could you open up the folders in the SDK on your work laptop and your personal one, and see if all the folders are there as expected on the work laptop, or if some/all of their contents are missing on the work laptop?

    Folders and files are identical, SDK & toolchain. As I have probably mentioned, I have even tried copying all the folders and files from the personal laptop to the work laptop and still the same. Setting up all the PATHs in the Environment Variables in the same way as on the personal laptop. Reinstalling SDKs with toolchains. Uninstalling the whole lot and installing it back again. Even tried installing a different SDK (one step older). No success.

    From your description it sounds to me like there might be something like a firewall or other blocker that keeps these programs from installing their necessary components.
    I've also heard about this in the past for especially aggressive firewalls which would prevent certain repos of the SDK to download.

    If that is the case, then how I could check what is missing? Taking into account that SDK & toolchain folder and files are correct. Could it be something else somewhere in the Windows file directories (e.g. Temp, Program Files and etc.) missing or not set correctly, or not linked in the way they should? Or is something within the Visual Studio backend missing or set incorrectly?

    If we are able to rule out the firewall / organizational network administration as the root cause of this then my last suggestion would be to go through the Installing the nRF Connect SDK Manually to verify that each step successfully completes, so that we may see exactly which part of the setup it is that is failing (and hopefully why it is failing).

    Ok I might try doing it manually and see if that will work. 

    Thanks,
    Jev

Reply
  • Hi Karl, 

    Is this a work laptop you are working on?

    Yes, work laptop which fails, while no problems on my personal laptop (installed just to try on different laptop). 

    Does this laptop have a strict firewall setup?

    Don't think so, same as the personal laptop. How it could be a problem?

    Could you open up the folders in the SDK on your work laptop and your personal one, and see if all the folders are there as expected on the work laptop, or if some/all of their contents are missing on the work laptop?

    Folders and files are identical, SDK & toolchain. As I have probably mentioned, I have even tried copying all the folders and files from the personal laptop to the work laptop and still the same. Setting up all the PATHs in the Environment Variables in the same way as on the personal laptop. Reinstalling SDKs with toolchains. Uninstalling the whole lot and installing it back again. Even tried installing a different SDK (one step older). No success.

    From your description it sounds to me like there might be something like a firewall or other blocker that keeps these programs from installing their necessary components.
    I've also heard about this in the past for especially aggressive firewalls which would prevent certain repos of the SDK to download.

    If that is the case, then how I could check what is missing? Taking into account that SDK & toolchain folder and files are correct. Could it be something else somewhere in the Windows file directories (e.g. Temp, Program Files and etc.) missing or not set correctly, or not linked in the way they should? Or is something within the Visual Studio backend missing or set incorrectly?

    If we are able to rule out the firewall / organizational network administration as the root cause of this then my last suggestion would be to go through the Installing the nRF Connect SDK Manually to verify that each step successfully completes, so that we may see exactly which part of the setup it is that is failing (and hopefully why it is failing).

    Ok I might try doing it manually and see if that will work. 

    Thanks,
    Jev

Children
No Data
Related