nrfjprog and jlink not found on linux (ubuntu 22 lts)

i had a up to date segger install before setting up nordic tools.

i have stored the nordic command line tools profile local.

both are in path ~ reachable from command line.

the nordic vs code plugin seems to not use the path.

how to fix the vs code error message?

there is a 2 year old thread "nrfjprog on Linux: support for LD_LIBRARY_PATH broken from 10.5.0 onwards and `/opt/SEGGER/JLink` hardcoded instead" . the mentioned problem might com up also ?

Parents Reply Children
  • point is: jlink is working.

    i use that laptop with a segger jlink succesfu and can show that  eg with teamviewer if needed.

    i showed already that jlink is found in the path. first post -> image -> which

    point is: the nordic vscode extension does say that it does not find jlink - despite i being in the path.

    as a first step i'd suggest to fix the wrong/misleading error message.

    from the links you gave

    "Yes, you need to install the JLink too. You must add the folder containing JLink.exe to your path. This should help you." : that is done.

    "sudo apt remove jlink
    sudo dpkg -i JLink_Linux_<version>.deb"
    well, segger software works, then the vscode extension should be able to use it.

    "VS Code may HAVE FOUND nrfjprog, but it tried running --version flag in order to determine the version number, and it caused the following to appear in its input buffer: ...

    This causes it to return an error that assumed that nrfjprog wasn't installed in $PATH, which is the default assumption. Actually it was missing a shared object library that needed to be installed, which made it malfunction.

    ...

    My solution was to download and install Segger's JLink package, and then I ran:
    "sudo dpkg -i JLink_Linux_*Version*_*platform*.deb""



    a) there seems to be a flaw in the vscode extension. wrong handling of input. that should be fixed.
    b) as  the segger software is installed and not found maybe enabling to explicitly configure the path in the extension should help.

  • I understand fully well that jlink is in your PATH from the first screenshot. Please know that I considered your input carefully. 

    I think it might help if I explain the motivation for my suggestions.

    • I have requested you to compare the path from a regular terminal to that in a toolchain installation to ensure that they are the same. The reason is because the toolchain setup some of the paths itself, and it could have done it somehow incorrectly that causes this issue.

    • The suggestion to run nrfjprog -v is for two purposes: 1. See what version of nrfjprog is installed for further analysis. 2. See whether the nrfjprog failure is due to jlink. We have seen that it is #2. Refer to the error message: libjlinkarm.so: cannot open shared object file.

      This indicates that there is a problem with the J-Link installation. I understand that the Segger software works, but it could also not be dependent on the missing/malfunctioning part. As shown in this DevZone post, not all J-Link installations will give you all the files necessary:  nrfjprog ubuntu JLinkARM DLL load failed

      Therefore, please still try to reinstall J-Link following Håkon's suggestion.

    • We do not rule out the possibility of issues in our tools. However, we will need the Support Information from the extension, as I have requested.

    Please also be informed that it is the Easter holiday here, and I will be out of office from today, returning on Tue Apr 11. My apology for the inconvenience. Please still response if there are any progresses.

  • hi,

    after writing my answer i uninstalled segger jlink.

    i checked for the existence of the libjlinkarm.so before, it existed where SEGGER was installed.


    i previously installed it from source/.tgz as recommended by some in the segger forum to a location in my profile.

    Then i installed it from the .deb. (-> default location) this has the downside that i can not have different profiles with different versions.

    the default .deb installation works.

    my conclusions.

    there are a limited number of quite hardcoded paths where the vscode extension searches for files - not necessarily where the files are installed.

    besides that the error message is misleading. 

    my suggestion would be, that the documentation should point out that the segger offered and working source /.tgz install may cause problems and is not really supported.
    additionally i would suggest to support the source/.tgz install and to handle the search for components from segger more flexible.
    making the error message in the vscode extension more precise could also help.

    thanks for your effort

    best regards

    richard

  • Hi Richard,

    I see. From the information you provided here, I too agree with your conclusion.

    I will inform the VS Code Extension developer of your observations. Right now is not a good time due to the holiday. I will do it after the holiday, next week.

    Thank you for the patience and information.

    Best regards,

    Hieu

Related