The documentation for the JLinkGDBServer
command line options is incomplete. Getting multiple debug sessions running using JLinkGDBServer
is a trial/error/google and repeat process. Here are bare-bones instructions for getting multiple JLinkGDBServer
sessions over USB running on an OSX host. An ethernet configuration will differ. These instructions should work for Linux and Windows as well but have not been tested in those environments.
The serial number is printed whenever the JLinkGDBServer
program is started and it attaches to a SEGGER JLink debug interface (either a USB connected pod or on-boad SWO interface). Attach only one of the units for debugging and run the JLinkGDBServer
program. The serial number of the JLink debug interface is a 9 digit number prefixed with the text S/N:
.
The Serial Number may also be printed on the debug interface itself.
Once the serial numbers of the debug interfaces are known, the GDB server can be started with the following example command line:
JLinkGDBServerCLExe -device NRF52 -if swd -endian little -port 2431 -swoport 2432 -telnetport 2433 -RTTTelnetport 2434 -vd -noir -localhostonly 1 -strict -timeout 0 -select USB=XXXXXXXXX
Where XXXXXXXXX
is the SEGGER JLink debug interface serial number. This example is for the Nordic Semiconductor nRF52832
which is identified by the --device
parameter.
- Each GDB server instance needs to have the SEGGER serial number specified.
- Each GDB server will require a unique set of IP ports. Here
[2431, 2434]
are specified. I find it useful to increment the port set by 100 for each GDB server instance started. The next instance would use the port set[2531, 2534]
.
The gdb debugger can be started and attached to the GDB server with the command line option:
target remote localhost:2431
Where 2431
matches the GDB server -port XXXX
command line option.
JLinkRTTClient
is actually a telnet program. You can use telnet
instead and get the same results.
Start the JLinkRTTClient
with the command line option:
JLinkRTTClient -RTTTelnetPort 2434
or, using Telnet:
telnet localhost 2434
Where the port number 2434
must match the -RTTTelnetport 2434
command line option when the GDB server was started.
You should now have simultaneous GDB debug sessions and JLinkRTTClient
sessions running at the same time.
The command line parameter -RTTTelnetport
is case insensetive and can be specified as -rtttelnetport
.
This is great! Very helpful, thanks for sharing!