Difference between revisions of "J-Link Remote Server"

From SEGGER Wiki
Jump to: navigation, search
(Troubleshooting)
 
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
  +
[[File: RemoteServer_Direct.PNG | 300px | thumb | right | J-Link Remote Server (direct connection)]]
__TOC__
 
 
 
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.
 
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. <br>
 
The J-Link itself does not need to provide an Ethernet interface, USB is sufficient. <br>
For more information on the J-Link Remote Server as well as a tutorial showing how to use it, refer to the [https://www.segger.com/products/debug-probes/j-link/tools/j-link-remote-server/ SEGGER website].
+
For more information on the J-Link Remote Server as well as a tutorial on how to use it, refer to the [https://www.segger.com/products/debug-probes/j-link/tools/j-link-remote-server/ SEGGER website].
  +
  +
__TOC__
  +
  +
= Command line options =
  +
The table below lists the commands line options accepted by the J-Link Remote Server.
  +
  +
{| class="wikitable"
  +
|-
  +
! 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 <sup>1</sup> || Selects the IP port on which the J-Link Remote Server is listening.
  +
|-
  +
| UseTunnel <sup>1</sup> || Starts J-Link Remote Server in tunneling mode
  +
|-
  +
| SelectEmuBySN <sup>1</sup> || Selects the J-Link to connect to by its serial number.
  +
|-
  +
|}
  +
  +
'''Note''':<br>
  +
<sup>1</sup> These command line options exist because of backwards-compatibility. We suggest to use the command line options that start with a dash (’-’).
  +
  +
= Tunneling mode =
  +
[[File: RemoteServer_Tunnel.PNG | 300px | thumb | right | 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.
  +
  +
[[File: RemoteServer_Schematic.png | 600px ]]
  +
  +
== 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 =
 
= Connecting to J-Link using J-Link Remote Server =
  +
When connecting to J-Link - for example when using the [[J-Link_Commander | J-Link Commander]] - in most cases, a connect string can be entered.
   
  +
[[File: RemoteServer_Commander.PNG ]]
When connecting to J-Link - for example when using the [[J-Link_Commander | J-Link Commander]] - in most cases, a connect string can be entered.<br>
 
   
 
== LAN connection ==
 
== LAN connection ==
 
 
When connecting to a J-Link in LAN via Remote Server, the following syntax applies:
 
When connecting to a J-Link in LAN via Remote Server, the following syntax applies:
  +
IP <RemoteServerIP>
 
IP <SN>
 
   
 
== Tunneled connection ==
 
== Tunneled connection ==
 
 
When connecting to a remote J-Link via a tunneled connection using Remote Server, the following syntax applies:
 
When connecting to a remote J-Link via a tunneled connection using Remote Server, the following syntax applies:
   
Line 29: Line 85:
   
 
'''Variant 2''':
 
'''Variant 2''':
IP tunnel:<SN/Nickname>[:<Password>[:<TunnelServer>]]
+
IP tunnel:<SN/Name>[:<Password>[:<TunnelServer>]]
   
 
{|
 
{|
| <SN/Nickname> || Either the J-Link's serial number or [[J-Link:Nickname | Nickname]].
+
| <SN/Name> || Either the J-Link's serial number or name that the J-Link was registered with at the Remote Server. <br> '''Note''': The name used to register a J-Link at a Remote Server is ''NOT'' the J-Link's [[J-Link Nickname | Nickname]]
 
|-
 
|-
 
| <Password> || Password that was used when setting up the Remote Server.
 
| <Password> || Password that was used when setting up the Remote Server.
Line 40: Line 96:
   
 
'''Examples''':
 
'''Examples''':
 
 
IP tunnel:932000000:MyPassword123:jlink2.segger.com // J-Link was registered by S/N, with a password, at jlink2.segger.com
 
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 nickname, without 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
 
IP tunnel:600100000:MyPassword123 // J-Link was registered by S/N, with a password, at the SEGGER default tunnel server
   
Line 49: Line 104:
 
* [[IAR_EWARM#Connecting_to_J-Link_via_J-Link_Remote_Server | IAR ]]
 
* [[IAR_EWARM#Connecting_to_J-Link_via_J-Link_Remote_Server | IAR ]]
 
* [[Eclipse#Connecting_to_J-Link_via_J-Link_Remote_Server | GDB / Eclipse]]
 
* [[Eclipse#Connecting_to_J-Link_via_J-Link_Remote_Server | GDB / Eclipse]]
  +
  +
= Troubleshooting =
  +
{| class="wikitable"
  +
|-
  +
! Problem !! Solution
  +
|-
  +
| Remote server cannot put socket into listening state ||
  +
#Make sure the server's listener port (19020 by default) is not occupied by any other process running in parallel
  +
  +
|-
  +
| Remote server cannot connect to tunnel server ||
  +
#Make sure the Remote server is not blocked by any firewall.
  +
#Make sure port 19020 is not blocked by any firewall.
  +
#Contact network admin.
  +
|-
  +
| J-Link Commander cannot connect to tunnel server ||
  +
#Make sure Remote server is started correctly.
  +
#Make sure the entered serial number is correct.
  +
#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:
  +
  +
[[File: RemoteServer_Wireshark.gif]]

Latest revision as of 15:27, 31 August 2023

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 put socket into listening state
  1. Make sure the server's listener port (19020 by default) is not occupied by any other process running in parallel
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