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

    Did you reboot your PC after installing the command line tools? This error can appear when not rebooting the computer after install. You could also try to restart VS Code.

    Let me know if it helps!

    Best regards,

    Maria

  • yes ,i made that the profile is updated (relogin).

    now i doublechecked: boot & login & start vscode : problem persists

  • running  "nRF Connect: Generate Support Information" in vscode does not yield an (error) report, just a toast message "generating support information"

  • Looks like it's jlink that is not working correctly, causing nrfjprog to malfunction, and the VS Code Extension to complain about both of them.

    Here are a few previous DevZone cases regarding this. All of them share a recommendation to reinstall J-Link tools in some way, so I think it should be the fix for you. Please go over them and see if following the exact steps described there helped you.
    RE: JLinkARM DLL load failed on Ubuntu 
    VS Code & nrfjprog (nRF Connect SDK) problem on Linux 
    Ubuntu 20.04 "Installing automatically" broken - nrfjprog not found 

    _rm said:
    running  "nRF Connect: Generate Support Information" in vscode does not yield an (error) report, just a toast message "generating support information"

    If none of the solutions above work, please try this again. It should print the information to the Output tab, and there should also be another toast that have a button for quick copy of the info, like my screenshot below:

  • 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

Reply
  • 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

Children
Related