[SOLVED] Getting JLink to work without GUI

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [SOLVED] Getting JLink to work without GUI

    Hi,

    I have a Nordic NRF52840 DK board with a PCA10056.
    It works fine in Visual Studio Code.
    I connect it via USB.

    I'm currently looking into automated testing. This means that I want to send commands via RTT/UART to the device to execute some part of the firmware functionality.
    For this I'm using a Raspberry Pi, which is installed with the bare minimum (so no X11 libraries and stuff).

    But when I want to use JLink without GUI, it somehow forces it to use GUI, which is not working because I don't use X11 libraries:

    Source Code

    1. pi@raspberrypi:/opt/SEGGER/JLink $ sudo ./JLinkExe -NoGUI 1
    2. SEGGER J-Link Commander V7.80c (Compiled Sep 27 2022 16:10:59)
    3. DLL version V7.80c, compiled Sep 27 2022 16:10:35
    4. Connecting to J-Link via USB...O.K.
    5. Firmware: J-Link OB-nRF5340-NordicSemi compiled Nov 7 2022 16:22:01
    6. Hardware version: V1.00
    7. J-Link uptime (since boot): 0d 00h 01m 44s
    8. S/N: *******
    9. USB speed mode: Full speed (12 MBit/s)
    10. VTref=3.300V
    11. Type "connect" to establish a target connection, '?' for help
    12. J-Link>connect
    13. Please specify device / core. <Default>: Unspecified
    14. Type '?' for selection dialog
    15. Device>nrf52840
    16. Please specify target interface:
    17. J) JTAG (Default)
    18. S) SWD
    19. F) FINE
    20. I) ICSP
    21. C) C2
    22. T) cJTAG
    23. TIF>S
    24. Specify target interface speed [kHz]. <Default>: 4000 kHz
    25. Speed>
    26. ./JLinkGUIServerExe: error while loading shared libraries: libSM.so.6: cannot open shared object file: No such file or directory
    27. No valid device has been selected.
    28. J-Link>
    Display All
    I tried both JTAG and SWD but both have the same result.

    I actually want to use pytest, and I want to know if this is possible via the USB interface?
    Otherwise I have to wire 2 additional I/O for an additional UART.

    Visual Studio Code somehow manages to communicate with this device over RTT without any GUI. Probably by using the Nordic plugins.
  • Hi,

    The reason for J-Link to try to start the GUI is that you selected an invalid device name.
    Here a list of supported device names for the nRF52840 series:
    segger.com/supported-devices/search/nrf52840

    ephimee wrote:

    I actually want to use pytest, and I want to know if this is possible via the USB interface?
    I do not see why it should not.
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.