J Link Specific Configuration - Marus/cortex-debug GitHub Wiki

Please make sure you are using the correct version of the JLink gdb-server. It should be JLinkGDBServerCL.exe or JLinkGDBServerCLExe (depending on OS) and not the GUI versions.

Example launch.json:

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "cortex-debug",
            "request": "launch",
            "servertype": "jlink",
            "cwd": "${workspaceRoot}",
            "executable": "./firmware.elf",
            "name": "Debug (J-Link)",
            "device": "STM32F103RB",
            "interface": "swd",
            "serverArgs": [
                // "-gui"
            ],
            "ipAddress": null,
            "serialNumber": null,
        }
    ]
}

device

Model number of your microcontroller.

rtos

An rtos is a JLink GDB Server plugin and is passed directly to the server with the -rtos option. The value of the rtos should conform to JLinkGDBServer expected format. See section 4.2.5 in the Users Manual

ipAddress

If your J-Link probe is connected via Ethernet instead of USB you need to supply the IP Address for the probe in this configuration parameter.

serialNumber

If you have multiple J-Link probes connected via USB then you can supply the serial number for the J-Link probe to use. If only one J-Link probe is connected this option can be omitted.

interface

Select the debug connection type to your microcontroller. This can be either "swd" (the default) or "jtag".

serverArgs

Optionally specify a list of command line arguments to send to the J-Link GDB Server.

Note, in some cases, Cortex Debug overrides the JLinkGDBServer defaults. For example, as of V0.4.4, the default is -nogui, which suppresses the JLinkGDBServer graphical progress bar at launch.