J-Link Remote Server

From SEGGER Wiki
Jump to: navigation, search
J-Link Remote Server (direct connection)

J-Link Remote Server is a utility (available as command line or GUI application) that makes a J-Link accessible via IP, be it in the local network or from anywhere on the world. The J-Link itself does not need to provide an Ethernet interface, USB is sufficient.
For more information on the J-Link Remote Server as well as a tutorial on how to use it, refer to the SEGGER website.

Command line options

The table below lists the commands line options accepted by the J-Link Remote Server.

Command Description
? Prints the list of available command line options.
-Port Specifies listening port of J-Link Remote Server.
-UseTunnel Specifies if tunneled connection shall be used.
-SelectEmuBySN Specifies to connect to a J-Link with a specific S/N. Only valid for LAN mode.
-TunnelServer Specify a tunnel server to connect to (default: jlink.segger.com:19020). Only valid for tunnel mode.
-TunnelBySN Specifies to identify at tunnel server via J-Link S/N. Only valid for tunnel mode.
-TunnelByName Specifies to identify at tunnel server via custom name. Only valid for tunnel mode.
-TunnelPW Specifies to protect the connection with a password. Only valid for tunnel mode.
-TunnelPort Specifies to connect to a tunnel server listening on a specific port. Only valid for tunnel mode.
-TunnelEncrypt Specifies to encrypt any transferred data of a tunneled connection
-select <USB/IP>[=<SN/Hostname>] Specify how to connect to J-Link.
port 1 Selects the IP port on which the J-Link Remote Server is listening.
UseTunnel 1 Starts J-Link Remote Server in tunneling mode
SelectEmuBySN 1 Selects the J-Link to connect to by its serial number.

Note:
1 These command line options exist because of backwards-compatibility. We suggest to use the command line options that start with a dash (’-’).

Tunneling mode

J-Link Remote Server (tunnel connection)

The Remote server provides a tunneling mode which allows remote connection to a J-Link / J-Trace from any computer, even from outside the local network. To give access to a J-Link neither a remote desktop or VPN connection nor changing some difficult firewall settings is necessary. When started in tunneling mode, the Remote server connects to a tunnel server via port 19020 and registers with its serial number or custom name. After that, a remote computer can established a connection to that J-Link from within a debugger, for example. After successfully connecting, the debugger is connected to the J-Link.

RemoteServer Schematic.png

Example scenario

A device vendor is developing a new device which shall be supported by J-Link. Because there is only one prototype, a shipment to SEGGER is not possible. Instead, the vendor can connect the device via J-Link to a local computer and start the J-Link Remote Server in tunneling mode. The connection parameters (e.g. serial number or custom name, etc.) of the J-Link is then sent to a to an engineer at SEGGER. The engineer at SEGGER can use J-Link Commander or a debugger to test and debug the new device without the need to have the device on the desk.

Connecting to J-Link using J-Link Remote Server

When connecting to J-Link - for example when using the J-Link Commander - in most cases, a connect string can be entered.

RemoteServer Commander.PNG

LAN connection

When connecting to a J-Link in LAN via Remote Server, the following syntax applies:

IP <RemoteServerIP>

Tunneled connection

When connecting to a remote J-Link via a tunneled connection using Remote Server, the following syntax applies:

Variant 1:

IP tunnel:SN

This variant can be used in the default case: When connecting to the SEGGER default tunnel server (jlink.segger.com) where the serial number has been used to register a J-Link.

Examples:

IP tunnel:600100000
IP tunnel:932000000

Variant 2:

IP tunnel:<SN/Name>[:<Password>[:<TunnelServer>]]
<SN/Name> Either the J-Link's serial number or name that the J-Link was registered with at the Remote Server.
Note: The name used to register a J-Link at a Remote Server is NOT the J-Link's Nickname
<Password> Password that was used when setting up the Remote Server.
<TunnelServer> Address or hostname of the tunnel server. This is only needed if a tunnel server other than the SEGGER default tunnel server (jlink.segger.com) is used.

Examples:

 IP tunnel:932000000:MyPassword123:jlink2.segger.com  // J-Link was registered by S/N, with a password, at jlink2.segger.com
 IP tunnel:MyJLink::jlink2.segger.com                 // J-Link was registered by Name, without a password, at jlink2.segger.com
 IP tunnel:600100000:MyPassword123                    // J-Link was registered by S/N, with a password, at the SEGGER default tunnel server

Usage with different clients

Troubleshooting

Problem Solution
Remote server cannot connect to tunnel server
  1. Make sure the Remote server is not blocked by any firewall.
  2. Make sure port 19020 is not blocked by any firewall.
  3. Contact network admin.
J-Link Commander cannot connect to tunnel server
  1. Make sure Remote server is started correctly.
  2. Make sure the entered serial number is correct.
  3. Make sure port 19020 is not blocked by any firewall. Contact network admin.

To test whether a connection to the tunnel server can be established or not a network protocol analyzer like Wireshark can help. The network transfer of a successful connection should look similar to this:

RemoteServer Wireshark.gif