How to debug remotely with J-link, Visual Studio, VisualGDB?

Sysprogs forums Forums VisualGDB How to debug remotely with J-link, Visual Studio, VisualGDB?

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #30986
    cabandre
    Participant

    How to debug remotely with J-link, Visual Studio, VisualGDB? What setup steps do I have to do?

    #30987
    support
    Keymaster

    Hi,

    VisualGDB uses the J-Link Software to communicate to Segger J-Link. You can configure it to connect to a remote J-Link by selecting “Connection: TCP/IP” in VisualGDB Project Properties -> Debug Settings. This will pass the “-select IP” argument to JLinkGDBServerCL.exe (expand the Advanced Settings view to preview the command line).

    You can find more details about remote mode of the Segger J-Link GDB Server in the J-Link documentation.

    #30998
    cabandre
    Participant

    do I select Segger J-Link for “debug using” in VisualGDB setting?

    • This reply was modified 3 years, 4 months ago by cabandre.
    #31000
    cabandre
    Participant

    I have J-Link connected to a PC on 10.1.10.99, and I’m trying to connect to it from a different computer. I tried using JLinkRemoteServer which has the following logs:

    Connected to J-Link with S/N

    Waiting for client connections…
    Conn. 1632: Client connected.
    Connected to J-Link with S/N

    Waiting for client connections…
    Conn. 1696: Client connected.
    Connected to J-Link with S/N

    Waiting for client connections…
    Conn. 1696: Client connected.
    Connected to J-Link with S/N

    Waiting for client connections…
    Conn. 1664: Client connected.

     

    and on Visual Studio I get this error in gdb stub log:

    VisualGDB: restarting tool…
    SEGGER J-Link GDB Server V7.50a Command Line Version

    JLinkARM.dll V7.50a (DLL compiled Jul 8 2021 18:21:11)

    Command line: -select IP=10.1.10.99 -device STM32L476RG -speed auto -if SWD -port 61505
    —–GDB Server start settings—–
    GDBInit file: none
    GDB Server Listening port: 61505
    SWO raw output listening port: 2332
    Terminal I/O port: 2333
    Accept remote connection: localhost only
    Generate logfile: off
    Verify download: off
    Init regs on start: off
    Silent mode: off
    Single run mode: off
    Target connection timeout: 0 ms
    ——J-Link related settings——
    J-Link Host interface: IP
    J-Link script: none
    J-Link settings file: none
    ——Target related settings——
    Target device: STM32L476RG
    Target interface: SWD
    Target interface speed: auto
    Target endian: little

    Connecting to J-Link…
    J-Link is connected.
    Firmware: J-Link Ultra V4 compiled Oct 26 2018 12:04:46
    Hardware: V4.00
    S/N:
    Feature(s): RDI, FlashBP, FlashDL, JFlash, GDB
    Checking target voltage…
    Target voltage: 3.26 V
    Listening on TCP/IP port 61505
    Connecting to target…
    Connected to target
    Waiting for GDB connection…Connected to 127.0.0.1
    GDB closed TCP/IP connection (Socket 976)

    • This reply was modified 3 years, 4 months ago by cabandre.
    • This reply was modified 3 years, 4 months ago by cabandre.
    #31003
    cabandre
    Participant

    somehow it always shows the error the first time, then if I click retry then it would work.

    #31005
    support
    Keymaster

    It’s hard to say why the connection between 2 J-Link tools would not always work. Please try reproducing the problem outside VisualGDB by launching JLinkGDBServer manually with the command-line arguments shown in the Advanced view. If the problem persists, please contact Segger support for further help.

    If running JLinkGDBServer manually works, please let us know more details (e.g. successful vs. failing logs and the exact command line used) and we will help you configure VisualGDB to replicate that setup.

    #31006
    cabandre
    Participant

    I didn’t run JLinkGDBServer at all. I ran JLinkRemoteServer in which I selected USB for J-link connection and Use LAN for server settings. Then I change the IP in VisualGDB settings. And just start debugging, and click retry if the error shows as in my last post.

    #31011
    support
    Keymaster

    Unfortunately, it’s hard to suggest anything specific based on this description.

    Please provide the steps we could follow on our side to reproduce the problem per our problem reporting guidelines and we will try to investigate this further.

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.