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,

    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

  • Hi Karl, 

    I am trying to install it manually and got stuck. Maybe you could help me, please?

    I have got stuck on this step:


    Run the Zephyr SDK bundle setup script:

    cd zephyr-sdk-0.16.0
    setup.cmd

    and getting this in reply:

    C:\Users\Jev\zephyr-sdk-0.16.0>setup.cmd
    Zephyr SDK 0.16.0 Setup

    Zephyr SDK setup requires 'cmake' to be installed and available in the PATH.
    Please install 'cmake' and run this script again.

    Press any key to exit ...



    cmake is installed:

    PS C:\ncs\zephyr-sdk-0.16.0> choco list -lo
    Chocolatey v1.4.0
    7zip 22.1
    7zip.install 22.1
    chocolatey 1.4.0
    chocolatey-compatibility.extension 1.0.0
    chocolatey-core.extension 1.4.0
    chocolatey-windowsupdate.extension 1.0.5
    cmake 3.26.3
    cmake.install 3.26.3
    dtc-msys2 1.5.1
    git 2.40.1
    git.install 2.40.1
    gperf 3.1
    KB2919355 1.0.20160915
    KB2919442 1.0.20160915
    KB2999226 1.0.20181019
    KB3033929 1.0.5
    KB3035131 1.0.3
    ninja 1.11.1
    python 3.11.3
    python3 3.11.3
    python311 3.11.3
    vcredist140 14.36.32532
    vcredist2015 14.0.24215.20170201
    Wget 1.21.4
    24 packages installed.



    cmake is available in the system variables:

    C:\Program Files\CMake\bin - under Path in system variables



    What is wrong?


    Thanks,
    Jev

  • Hello  again, Jev

    Thank you for your patience with this. Last week there were multiple holidays here in Norway, but now we are back in office.

    Thank you for confirming that there are no missing files in the SDK download, this is very helpful to have verified.

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

    It could be a problem if your organization/firm/corporation's IT policy is blocking you from performing certain operations on your computer, such as changing the system variables (path), or stopping packaged from sources that are not pre-approved (like when west attempts to set up all the dependencies of the nRF Connect SDK).

    Jev said:
    What is wrong?

    If you are able to see the installed cmake version in the terminal (i.e cmake --version producing an output) prior to running the setup.cmd script then I am not quite sure how the cmd is not able to find cmake when it is called from the script.
    For good measure, can you make sure to run cmd as administrator before running the script?

    Best regards,
    Karl

  • Hi Karl,

    It could be a problem if your organization/firm/corporation's IT policy is blocking you from performing certain operations on your computer, such as changing the system variables (path), or stopping packaged from sources that are not pre-approved (like when west attempts to set up all the dependencies of the nRF Connect SDK).

    I don't think this is the case. There is no special software installed on the machine, only traffic is monitored, so it would be the same for both laptops connected to the work Wi-Fi network. 

    If you are able to see the installed cmake version in the terminal (i.e cmake --version producing an output) prior to running the setup.cmd script then I am not quite sure how the cmd is not able to find cmake when it is called from the script.
    For good measure, can you make sure to run cmd as administrator before running the script?

    Yes, I do. I run as administrator. That is why I am confused. Both laptops were installed in the same way, but I got it running only on my personal machine, which I am currently using instead of my work machine. But eventually, I will need it sorted on the work machine as well.

    Regards,
    Jev

Related