pylink icon indicating copy to clipboard operation
pylink copied to clipboard

add support Segger tunnel server

Open Sauci opened this issue 5 years ago • 2 comments

I'm not sure if it would be possible, but it would be great to be able to open a device over the Segger's remote server using the name/serial number and optional password parameters.

To launch the server, provide either the serial number or the name, and an optional password:

  • ./JLinkRemoteServerCLExe -UseTunnel -TunnelBySN <serial_number> -TunnelPW <password>
  • ./JLinkRemoteServerCLExe -UseTunnel -TunnelByName <name> -TunnelPW <password>

Once the server is running, it is possible to connect to it using JLinkExe application:

  • JLinkExe ip tunnel:<serial_number>:<password>
  • JLinkExe ip tunnel:<tunnel_name>:<password>

Does anyone knows if this feature is available in the latest version of the DLL? My first guess would be to call the DLL function JLINKARM_SelectIP with "tunnel:<name>:<password>", but I don't know how to handle the second port parameter.

Sauci avatar Sep 06 '19 05:09 Sauci

Someone added open_tunnel(), which takes a serial number and port; I suppose you could pass in the tunnel name in the place of the serial number, and password in place of the port, and it might work?

hkpeprah avatar Sep 09 '19 17:09 hkpeprah

Yes, I've added this feature (issue #36). When we call open_tunnel(), the function internally calls open() and open() calls the JLink API JLINKARM_SelectIP(address=str, port=int). Internally, both address and port parameters are extracted from the ip_addr parameter of the open function using the rsplit function (see file changes of issue #36). However, if the open() function if called with ip_addr=tunnel:<serial_number>:<password>, there is no way to retrieve the integer value of port, which is required in the call of JLINKARM_SelectIP API.

Sauci avatar Sep 11 '19 07:09 Sauci