[ABANDONED] JLinkGDBServer connects to JLinkRemoteServer but not to the J-Link

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

  • [ABANDONED] JLinkGDBServer connects to JLinkRemoteServer but not to the J-Link

    I am attempting to fix a problem with a system that, up until today, was working fine (not perfectly, but fine).

    My system is configured as such:
    I am developing for an ARM target using Linux build tools running under WSL. WSL has no ability to use or see USB devices. However, the Segger tools run fine under WSL.

    I have my J-Link Ultra+ connected via USB to my machine. I launch J-Link Remote Server with the "Use LAN" option selected. The Remote Server indicates that it detects my J-Link.
    Next, I attempt to launch a debug session. I have configured my launch to invoke JLinkGDBServer in WSL with the "-select ip=localhost" option (among the other, more standard options). When the GDB server is launched, I see that the Remote Server recognizes a connection. However, GDB is unable to connect to the J-Link itself. The exact output from the J-Link GDB Server is:


    Source Code

    1. SEGGER J-Link GDB Server V6.56a Command Line Version
    2. JLinkARM.dll V6.56a (DLL compiled Nov 25 2019 16:58:26)
    3. Command line: -if swd -port 50000 -swoport 50001 -telnetport 50002 -device STM32F756IG -select ip=localhost
    4. -----GDB Server start settings-----
    5. GDBInit file: none
    6. GDB Server Listening port: 50000
    7. SWO raw output listening port: 50001
    8. Terminal I/O port: 50002
    9. Accept remote connection: yes
    10. Generate logfile: off
    11. Verify download: off
    12. Init regs on start: off
    13. Silent mode: off
    14. Single run mode: off
    15. Target connection timeout: 0 ms
    16. ------J-Link related settings------
    17. J-Link Host interface: IP
    18. J-Link script: none
    19. J-Link settings file: none
    20. ------Target related settings------
    21. Target device: STM32F756IG
    22. Target interface: SWD
    23. Target interface speed: 4000kHz
    24. Target endian: little
    25. Connecting to J-Link...
    26. Connecting to J-Link failed. Connected correctly?
    27. GDBServer will be closed...
    28. Shutting down...
    29. Could not connect to J-Link.
    Display All
    Note, that while this snippet shows V6.56a, I have tried this with the most up-to-date segger tools on both ends, and it doesn't fix the problem. This capture was from an attempt at downgrading to a version that used to work.

    One last thing to note: it seems that when the GDB session fails, the connection does not detach properly from JLinkRemoteServer. This happens with all versions of the tools that I tried.

    Can anyone provide suggestions on how to debug this problem?
  • After doing some further testing, I have determined that it is possible to connect to both the J-Link and the target using 'JLinkExe ip localhost' from inside WSL. This verifies that I am not, in fact, a crazy person and everything is physically configured as it should be. I am beginning to think there is a problem with JLinkGDBServer itself, and it for whatever reason cannot connect to the J-Link reliably through the ip connection.
  • Hi,
    Thank you for your inquiry.
    We are not aware of any issues related to the J-Link GDB Server in combination with the J-Link Remote Server.

    When using the J-Link GDB Server in combination with the J-Link Remote Server, the GDB server is supposed to connect to the remote server.
    The connection should be established like this:
    Client side (GDB client <-> GDB server) <-> Host side (Remote server <-> J-Link).

    Could you please make sure that
    1) the J-Link Remote Server is connected to the J-Link correctly
    2) the J-Link GDB Server is connected to the J-Link Remote Server correctly.
    3) the GDB Client is connected to the J-Link GDB Server correctly

    After checking your setup and points 1-3:
    Could you please send us a screenshot of each of these applications' and their outputs?
    Could you please send us a J-Link log file? How to enable:
    wiki.segger.com/J-Link_DLL#Enable_J-Link_Log_File

    Best regards,
    Fabian
    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.