Specifications written in this document are believed to be accurate, but are not guaranteed to
be entirely free of error. The information in this manual is subject to change for functional or
performance improvements without notice. Please make sure your manual is the latest edition.
While the information herein is assumed to be accurate, SEGGER Microcontroller GmbH (SEGGER) assumes no responsibility for any errors or omissions. SEGGER makes and you receive no
warranties or conditions, express, implied, statutory or in any communication with you. SEGGER
specifically disclaims any implied warranty of merchantability or fitness for a particular purpose.
Copyright notice
You may not extract portions of this manual or modify the PDF file in any way without the prior
written permission of SEGGER. The software described in this document is furnished under a
license and may only be used or copied in accordance with the terms of such a license.
Names mentioned in this manual may be trademarks of their respective companies.
Brand and product names are trademarks or registered trademarks of their respective holders.
This manual describes the current software version. If you find an error in the manual or a
problem in the software, please report it to us and we will try to assist you as soon as possible.
Contact us for further information on topics or functions that are not yet documented.
Print date: November 5, 2019
Manual
version
6.550191105FF
6.540191023AG
6.533191021AG
6.532191016LG
6.532191016LG
6.503190923DL
6.484190813AG
6.483190802DL
6.481190711LG
6.471190511LG
6.444190424AG
6.443190415LG
6.442190408NV
6.441190321EL
6.440190306NV
6.420190215NV
RevisionDateByDescription
Chapter “Working with J-Link and J-Trace”
*Section “J-Link script files”:
Added default return value information for J-Link script file functions.
Chapter “Working with J-Link and J-Trace”
*Section “J-Link WiFi setup” added
Chapter “Semihosting”
*Section “Debugger Support”
Took off Keil MDK-ARM of the list of supported IDEs as MDK does not support semihosting.
Chapter “J-Link software and documentation package”
*Section “J-Link Remote Server”: Updated screenshots
*Section “J-Link Remote Server”: Created examples for the syntax of the
connect-string
Chapter “J-Link software and documentation package”
* Section “J-Link GDB Server”: Command line option “-JLinkDevicesXMLPath” corrected.
Chapter “Target interfaces and adapters”
* Added diagram showing J-Trace PRO connection with target device.
Chapter “J-Link software and documentation package”
* Section “J-Link GDB Server”: Command line options corrected.
Chapter “J-Link software and documentation package”
* Section “J-Link Commander”: Added memory zone example for command “mem”.
Chapter “Working with J-Link and J-Trace”
* Section “J-Link Script Files”: Added new Scripting functions for ETB initialization.
Chapter “Working with J-Link and J-Trace”
Chapter ”Working with J-Link and J-Trace“
* Section ”J-Link Command Strings“: Added new J-Link command string
”SetEnableMemCache“.
Chapter ”Environmental Conditions & Safety“ added
Chapter ”J-Flash SPI“
* Section ”Command Line Interface“: Updated description of CL option jflashlog.
* Section ”Command Line Interface“: Updated description of CL option jlinklog.
Chapter ”Working with J-Link and J-Trace“
* Section ”Script file API functions“: Added new API functions
”JLINK_MEM_Preserve()“, ”JLINK_MEM_Restore()“, ”JLINK_MEM_Fill()“.
Chapter ”Working with J-Link and J-Trace“
* Section ”J-Link Command Strings“: Added new J-Link command string
”MemPreserveOnReset“.
Moved contents of chapter ”Segger-specific GDB protocol extensions“ to
separate manual (UM08036)
Moved J-Link GDB Server to separate chapter
Added Segger specific GDB protocol extension qSeggerSTRACE:caps
Added Segger specific GDB protocol extension qSeggerSTRACE:GetInstStats
Chapter ”Working with J-Link and J-Trace“
* Section ”J-Link Command Strings“: Added new J-Link command string
”SetAllowStopMode“.
Chapter ”Working with J-Link and J-Trace“
* Section ”J-Link Script Files“:
Added new function SWO_EnableTarget();.
* Section ”J-Link Script Files“:
Renamed function GetSWOBaseClock() to SWO_GetSWOBaseClock();
Added unit information of clock speed value.
Chapter ”Working with J-Link and J-Trace“
* Section ”J-Link Script Files“:
Added new function: HandleBeforeFlashProg();
* Section ”J-Link Script Files“:
Added new function HandleAfterFlashProg();
Chapter ”Working with J-Link and J-Trace“
* Section ”J-Link Comamnd Strings“: Updated.
Chapter ”J-Link software and documentation package“
* Section ”J-Link GDB Server“: Added new GDBServer monitor commands:
ReadAP, ReadDP, WriteAP and WriteDP.
Chapter ”Working with J-Link and J-Trace“
* Section ”J-Link Command Strings“: Added new J-Link Command String
to set base addresses of coresight components for tracing
e.g. CORESIGHT_SetETBBaseAddr.
* Section ”J-Link script files“: Added new function GetSWOBaseClock();.
Chapter ”J-Link software and documentation package“
* Section ”J-Link SWO Viewer“: Updated picture of new SWO Viewer GUI
interface with additional explanation of SWO clock setting.
Chapter ”Related Software“
* Section ”JTAGLoad“: PIO commands was listed as supported even though
it is not. Fixed.
* Section ”JTAGLoad“: PIOMAP commands was listed as supported even
though it is not. Fixed.
Chapter ”Open Flashloader“
Added ”AlwaysPresent“ as new attribute to the <FlashBankInfo>
Chapter ”Working with J-Link and J-Trace“
* Section ”J-Link scriptfiles“: Updated
”JLINK_ExecCommand()“ description
Chapter ”J-Flash SPI“
Updated screenshots
Chapter ”Working with J-Link and J-Trace“
* Section ”J-Link scriptfiles“:
Added: ”JLINK_ExecCommand()“
Section ”Keil MDK-ARM“ added for Command string execution
Chapter ”Working with J-Link and J-Trace“
* Section ”J-Link scriptfiles“:
Added: ”OnTraceStart()“ and ”JLINK_TRACE_Portwidth“
Chapter ”Trace“
* Added crossreference to ”JLINK_TRACE_Portwidth“
Chapter ”Introduction“
*Added Subsubsection ”Software and Hardware
Features Overview“ to all device Subsections.
*Edited Subsection ”“J-Trace ARM.
*Section ”Target interfaces and adapters“:
edited ”RESET“ to ”nRESET“ and updated description.
Chapter ”Working with J-Link and J-Trace“
* Section ”Exec Commands“: Updated
SetResetPulseLen
TraceSampleAdjust
Chapter ”Trace“
* Section ”Tracing via trace pins“: Updated
Chapter ”Working with J-Link“
* Section ”Virtual COM Port (VCOM) improved.
Chapter “Target interfaces and adapters”
* Section “Pinout for SWD + Virtual COM Port (VCOM) added.”
Chapter “Related Software”
* Section “Command line options”
Extended command line option -speed.
Chapter “J-Link software and documentation package”
* Section “J-Link STR91x Commander”
Added command line option parameter to specify a customized
scan-chain.
Chapter “Working with J-Link”
* Section “Virtual COM Port (VCOM) added.
Chapter ”Setup“
* Section ”Getting started with J-Link and DS-5“
Chapter “J-Link control panel” moved to chapter “Working with J-Link”.
Several corrections.
Chapter “Flash download and flash breakpoints”
Section “Supported devices” updated.
Chapter “Flash download and flash breakpoints”
Section “Supported devices” updated.
Chapter “Flash download and flash breakpoints” updated.
Chapter “Flash download and flash breakpoints”,
section “Supported devices” updated.
Chapter “Flash download and flash breakpoints” updated.
Chapter “J-Link status window” renamed to “J-Link control panel”
Various corrections.
Chapter “Flash download and flash breakpoints”
Section “Licensing” updated.
Section “Using flash download and flash
breakpoints with different debuggers” updated.
Chapter “J-Link status window” added.
Chapter “Support and FAQs”
Section “Frequently Asked Questions” updated
Chapter “Reset strategies”
Section “Cortex-M3 specific reset strategies” updated.
Chapter “Reset strategies”
Section “Cortex-M3 specific reset strategies” updated.
Chapter “Hardware”
Section “Differences between different versions” updated.
Chapter “Working with J-Link and J-Trace”
Section “Cortex-M3 specific reset strategies” added.
Chapter “J-Link and J-Trace related software”
Section “J-Link software and documentation package in detail” updated.
Chapter “J-Link and J-Trace related software”
Section “J-Link TCP/IP Server (Remote J-Link / J-Trace use)” updated.
Chapter “Working with J-Link and J-Trace”
Section “J-Link Command Strings” updated.
Chapter “Flash download and flash breakpoints”
Section “Introduction” updated.
Section “Licensing” updated.
Section “Using flash download and flash breakpoints with
different debuggers” updated.
Chapter “Literature and references” added.
Chapter “Hardware”:
Added common information trace signals.
Added timing diagram for trace.
Chapter “Designing the target board for trace” added.
This document assumes that you already have a solid knowledge of the following:
•The software tools used for building your application (assembler, linker, C compiler).
•The C programming language.
•The target processor.
•DOS command line.
If you feel that your knowledge of C is not sufficient, we recommend The C Programming Lan-
guage by Kernighan and Richie (ISBN 0--13--1103628), which describes the standard in C programming and, in newer editions, also covers the ANSI C standard.
How to use this manual
This manual explains all the functions and macros that the product offers. It assumes you have
a working knowledge of the C language. Knowledge of assembly programming is not required.
Typographic conventions for syntax
This manual uses the following typographic conventions:
StyleUsed for
BodyBody text.
Keyword
ParameterParameters in API functions.
SampleSample code in program examples.
Sample commentComments in program examples.
Reference
GUIElementButtons, dialog boxes, menu names, menu commands.
EmphasisVery important sections.
Text that you enter at the command prompt or that appears on
the display (that is system functions, file- or pathnames).
Reference to chapters, sections, tables and figures or other documents.
This is the user documentation for owners of SEGGER debug probes, J-Link and J-Trace.
This manual documents the software which with the J-Link Software and Documentation
Package as well as advanced features of J-Link and J-Trace, like Real Time Transfer (RTT),
To use J-Link or J-Trace you need a host system running Windows 2000 or later. For a list
of all operating systems which are supported by J-Link, please refer to Supported OS on
page 30.
Target System
A target system with a supported CPU is required. You should make sure that the emulator
you are looking at supports your target CPU. For more information about which J-Link features are supported by each emulator, please refer to SEGGER debug probes on page 35.
31CHAPTER 1Common features of the J-Link product family
1.3 Common features of the J-Link product family
•USB 2.0 interface (Full-Speed/Hi-Speed, depends on J-Link model)
•Any ARM7/ARM9/ARM11 (including thumb mode), Cortex-A5/A7/A8/A9/A12/A15/A17,
Cortex-M0/M1/M3/M4/M7/M23/M33, Cortex-R4/R5 core supported
•Automatic core recognition
•Maximum interface speed 15/50 MHz (depends on J-Link model)
•Seamless integration into all major IDEs ( List of supported IDEs )
•No power supply required, powered through USB
•Support for adaptive clocking
•All JTAG signals can be monitored, target voltage can be measured
•Support for multiple devices
•Fully plug and play compatible
•Standard 20-pin JTAG/SWD connector, 19-pin JTAG/SWD and Trace connector, standard
38-pin JTAG+Trace connector
•USB and 20-pin ribbon cable included
•Memory viewer (J-Mem) included
•Remote server included, which allows using J-Trace via TCP/IP networks
•RDI interface available, which allows using J-Link with RDI compliant software
•Flash programming software (J-Flash) available
•Flash DLL available, which allows using flash functionality in custom applications
•Software Developer Kit (SDK) available
•14-pin JTAG adapter available
•J-Link 19-pin Cortex-M Adapter available
•J-Link 9-pin Cortex-M Adapter available
•Adapter for 5V JTAG targets available for hardware revisions up to 5.3
•Optical isolation adapter for JTAG/SWD interface available
•Target power supply via pin 19 of the JTAG/SWD interface (up to 300 mA to target
with overload protection), alternatively on pins 11 and 13 of the Cortex-M 19-pin trace
connector
33CHAPTER 1Built-in intelligence for supported CPU-cores
1.5 Built-in intelligence for supported CPU-cores
In general, there are two ways to support a CPU-core in the J-Link software:
1. Intelligence in the J-Link firmware
2. Intelligence on the PC-side (DLL)
Having the intelligence in the firmware is ideal since it is much more powerful and robust.
The J-Link PC software automatically detects which implementation level is supported for
the connected CPU-core. If intelligence in the firmware is available, it is used. If you are
using a J-Link that does not have intelligence in the firmware and only PC-side intelligence
is available for the connected CPU, a warning message is shown.
1.5.1 Intelligence in the J-Link firmware
On newer J-Links, the intelligence for a new CPU-core is also available in the J-Link firmware
which means that for these J-Links, the target sequences are no longer generated on the PCside but directly inside the J-Link. Having the intelligence in the firmware leads to improved
stability and higher performance.
1.5.2 Intelligence on the PC-side (DLL)
This is the basic implementation level for support of a CPU-core. This implementation is
not J-Link model dependent, since no intelligence for the CPU-core is necessary in the JLink firmware. This means, all target sequences (JTAG/SWD/…) are generated on the PCside and the J-Link simply sends out these sequences and sends the result back to the DLL.
Using this way of implementation also allows old J-Links to be used with new CPU cores as
long as a DLL-Version is used which has intelligence for the CPU.
But there is one big disadvantage of implementing the CPU core support on the DLL-side:
For every sequence which shall be sent to the target a USB or Ethernet transaction is
triggered. The long latency especially on a USB connection significantly affects the performance of J-Link. This is true especially when performing actions where J-Link has to wait
for the CPU frequently. An example is a memory read/write operation which needs to be
followed by status read operations or repeated until the memory operation is completed.
Performing this kind of task with only PC-side intelligence requires to either make some
assumption like: Operation is completed after a given number of cycles. Or it requires to
make a lot of USB/Ethernet transactions. The first option (fast mode) will not work under
some circumstances such as low CPU speeds, the second (slow mode) will be more reliable
but very slow due to the high number of USB/Ethernet transactions. It simply boils down
to: The best solution is having intelligence in the emulator itself!
34CHAPTER 1Built-in intelligence for supported CPU-cores
1.5.2.1 Limitations of PC-side implementations
•Instability, especially on slow targets
Due to the fact that a lot of USB transactions would cause a very bad performance of JLink, PC-side implementations are on the assumption that the CPU/Debug interface is
fast enough to handle the commands/requests without the need of waiting. So, when
using the PC-side-intelligence, stability cannot be guaranteed in all cases, especially if
the target interface speed (JTAG/SWD/…) is significantly higher than the CPU speed.
•Poor performance
Since a lot more data has to be transferred over the host interface (typically USB),
the resulting download speed is typically much lower than for implementations with
intelligence in the firmware, even if the number of transactions over the host interface
is limited to a minimum (fast mode).
•No support
Please understand that we cannot give any support if you are running into problems
when using a PC-side implementation.
Note
Due to these limitations, we recommend to use PC-side implementations for evaluation
only.
1.5.3 Firmware intelligence per model
There are different models of J-Link / J-Trace which have built-in intelligence for different
CPU-cores. Please refer to J-Link / J-Trace hardware revisions for further information.
The following items are not the scope of the J-Link / J-Trace User Guide (UM08001) and
therefore documented elsewhere in the respective place described/listed below.
1.6.1 SEGGER debug probes
1.6.1.1 J-Link / J-Trace current model overview
In order to compare features, performance specifications, capabilities and included licenses
of current J-Link / J-Trace or Flasher models, please refer to the SEGGER website:
J-Link Model overview
1.6.1.2 J-Link / J-Trace hardware revisions
For feature comparisons between different hardware revisions of J-Link / J-Trace or Flasher
models, please refer to:
SEGGER Wiki: J-Link / J-Trace / Flasher Software and Hardware features overview
1.6.1.3 J-Link / J-Trace hardware specifications
For detailed general, mechanical and electrical specifications of a specific J-Link / J-Trace
or Flasher model, please refer to:
1.6.2 Using a feature in a specific development environment
For many features described in this manual, detailed explanations on how to use them
with popular debuggers, IDEs and other applications are available in the SEGGER wiki.
Therefore, for information on how to use a feature in a specific development environment,
please refer to:
SEGGER Wiki: Getting Started with Various IDEs.
If an explanation is missing for the IDE used or the IDE used is not listed at all, please
contact us. (see Contact Information )
This chapter describes the different license types of J-Link related software and the legal
use of the J-Link software with original SEGGER and OEM products.
J-Link PLUS and higher are fully featured J-Links and come with all licenses included. Other
models may do not come with all features enabled. For a detailed overview of the included
licenses of the SEGGER debug probes, please refer to:
The software consists of proprietary programs of SEGGER, protected under copyright and
trade secret laws. All rights, title and interest in the software are and shall remain with
SEGGER. For details, please refer to the license agreement which needs to be accepted
when installing the software. The text of the license agreement is also available as entry
in the start menu after installing the software.
Use of software
SEGGER J-Link software may only be used with original SEGGER products and authorized
OEM products. The use of the licensed software to operate SEGGER product clones is prohibited and illegal.
2.2.1 Use of the software with 3rd party tools
For simplicity, some components of the J-Link software are also distributed by partners
with software tools designed to use J-Link. These tools are primarily debugging tools, but
also memory viewers, flash programming utilities as well as software for other purposes.
Distribution of the software components is legal for our partners, but the same rules as
described above apply for their usage: They may only be used with original SEGGER products and authorized OEM products. The use of the licensed software to operate SEGGER
product clones is prohibited and illegal.
Clones are copies of SEGGER products which use the copyrighted SEGGER Firmware without a license. It is strictly prohibited to use SEGGER J-Link software with illegal clones of
SEGGER products. Manufacturing and selling these clones is an illegal act for various reasons, amongst them trademark, copyright and unfair business practice issues. The use of
illegal J-Link clones with this software is a violation of US, European and other international
laws and is prohibited. If you are in doubt if your unit may be legally used with SEGGER
J-Link software, please get in touch with us. End users may be liable for illegal use of JLink software with clones.
The J-Link Software and Documentation Package, which is available for download from
segger.com/jlink-software.html, includes some applications to be used with J-Link. It also
comes with USB-drivers for J-Link and documentations in pdf format.
SoftwareDescription
J-Link CommanderCommand-line tool with basic functionality for target analysis.
The J-Link GDB Server is a server connecting to the GNU De-
J-Link GDB Server
J-Link GDB Server
command line version
J-Link Remote Server
J-Mem
J-Flash
J-Flash Lite
J-Link RTT Viewer
J-Link SWO Viewer
J-Link SWO Analyzer
JTAGLoad
J-Link Configurator
RDI support
Processor specific tools
a
a
bugger (GDB) via TCP/IP. It is required for toolchains using the
GDB protocol to connect to J-Link.
Command line version of the J-Link GDB Server. Same functionality as the GUI version.
Utility which provides the possibility to use J-Link / J-Trace remotely via TCP/IP.
Target memory viewer. Shows the memory content of a running target and allows editing as well.
Stand-alone flash programming application. For more information about J-Flash please refer to J-Flash ARM User’s Guide
(UM08003).
Stand-alone flash programming application. Reduced feature
set of J-Flash
Free-of-charge utility for J-Link. Displays the terminal output
of the target using RTT. Can be used in parallel with a debugger or stand-alone.
Free-of-charge utility for J-Link. Displays the terminal output
of the target using the SWO pin. Can be used in parallel with a
debugger or stand-alone.
Command line tool that analyzes SWO RAW output and stores
it into a file.
Command line tool that opens an svf file and sends the data in
it via J-Link / J-Trace to the target.
GUI-based configuration tool for J-Link. Allows configuration of
USB identification as well as TCP/IP identification of J-Link. For
more information about the J-Link Configurator, please refer
to J-Link Configurator .
Provides Remote Debug Interface (RDI) support. This allows
the user to use J-Link with any RDI-compliant debugger.
Free command-line tools for handling specific processors.
Included are: STR9 Commander and STM32 Unlock.
a
Full-featured J-Link (PLUS, PRO, ULTRA+) or an additional license for J-Link base model
J-Link Commander (JLink.exe) is a tool that can be used for verifying proper installation
of the USB driver and to verify the connection to the target CPU, as well as for simple
analysis of the target system. It permits some simple commands, such as memory dump,
halt, step, go etc. to verify the target connection.
J-Link Commander: JTAG connection
3.2.1 Commands
The table below lists the available commands of J-Link Commander. All commands are
listed in alphabetical order within their respective categories. Detailed descriptions of the
commands can be found in the sections that follow.
Command (short form)Explanation
Basic
clrBPClear breakpoint.
clrWPClear watchpoint.
deviceSelects a device.
eraseErase internal flash of selected device.
execExecute J-Link Command String.
exit (qc, q)Closes J-Link Commander.
exitonerror (eoe)Commander exits after error.
fPrints firmware info.
go (g)Starts the CPU core.
halt (h)Halts the CPU core.
hwinfoShow hardware info.
isScan chain select register length.
loadfileLoad data file into target memory.
logEnables log to file.
memRead memory.
mem8Read 8-bit items.
mem16Read 16-bit items.
mem32Read 32-bit items.
mem64Read 64-bit items.
mrMeasures reaction time of RTCK pin.
msMeasures length of scan chain.
powerSwitch power supply for target.
rResets and halts the target.
readAPReads from a CoreSight AP register.
readcsrReads CSR register on a RISC-V based target.
readDPReads from a CoreSight DP register.
regsShows all current register values.
rnhResets without halting the target.
rregShows a specific register value.
rxReset target with delay.
savebinSaves target memory into binary file.
setBPSet breakpoint.
setPCSet the PC to specified value.
SetTimeoutCmdSet timeout for the stepover command.
setWPSet watchpoint.
sleepWaits the given time (in milliseconds).
speedSet target interface speed.
stShows the current hardware status.
step (s)Single step the target chip.
stepover (so)Execute a stepover.
unlockUnlocks a device.
verifybinCompares memory with data file.
w1Write 8-bit items.
w2Write 16-bit items.
w4Write 32-bit items.
writeAPWrites to a CoreSight AP register.
writecsrWrites CSR register on a RISC-V based target.
writeDPWrites to a CoreSight DP register.
wregWrite register.
Flasher I/O
fdelete (fdel)Delete file on emulator.
flistList directory on emulator.
fread (frd)Read file from emulator.
fshowRead and display file from emulator.
fsize (fsz)Display size of file on emulator.
fwrite (fwr)Write file to emulator.
ipConnect to J-Link Pro via TCP/IP.
usbConnect to J-Link via USB.
Configuration
VTREFSets a fixed value for VTref on J-Link.
WebUSBDisableDisables WebUSB on J-Link.
WebUSBEnableEnables WebUSB on J-Link.
3.2.1.1 clrBP
This command removes a breakpoint set by J-Link.
Syntax
clrBP <BP_Handle>
ParameterMeaning
BP_HandleHandle of breakpoint to be removed.
Example
clrBP 1
3.2.1.2 clrWP
This command removes a watchpoint set by J-Link.
Syntax
clrWP <WP_Handle>
ParameterMeaning
WP_HandleHandle of watchpoint to be removed.
Example
clrWP 0x2
3.2.1.3 device
Selects a specific device J-Link shall connect to and performs a reconnect. In most cases
explicit selection of the device is not necessary. Selecting a device enables the user to make
use of the J-Link flash programming functionality as well as using unlimited breakpoints
in flash memory. For some devices explicit device selection is mandatory in order to allow
the DLL to perform special handling needed by the device. Some commands require that
a device is set prior to use them.
Syntax
device <DeviceName>
ParameterMeaning
DeviceName
Valid device name: Device is selected.
?: Shows a device selection dialog.
Erases all flash sectors of the current device. A device has to be specified previously.
Syntax
erase
3.2.1.5 exec
Execute J-Link Command String. For more information about the usage of J-Link Command
Strings please refer to J-Link Command Strings .
Syntax
exec <Command>
ParameterMeaning
CommandJ-Link Command String to be executed.
Example
exec SupplyPower = 1
3.2.1.6 exit
This command closes the target connection, the connection to the J-Link and exits J-Link
Commander.
Syntax
q
3.2.1.7 exitonerror
This command toggles whether J-Link Commander exits on error or not.
Syntax
ExitOnError <1|0>
ParameterMeaning
<1|0>
1: J-Link Commander will now exit on Error.
0: J-Link Commander will no longer exit on Error.
Example
eoe 1
3.2.1.8 f
Prints firmware and hardware version info. Please notice that minor hardware revisions may
not be displayed, as they do not have any effect on the feature set.
Syntax
f
3.2.1.9 fdelete
On emulators which support file I/O this command deletes a specific file.
EmuFileFile name to read from.
HostFileDestination file on the host.
OffsetSpecifies the offset in the file, at which data reading is started.
NumBytesMaximum number of bytes to read.
Example
fread Flasher.dat C:\Project\Flasher.dat
3.2.1.12 fshow
On emulators which support file I/O this command reads and prints a specific file. Currently,
only Flasher models support file I/O.
Syntax
fshow <FileName> [-a] [<Offset> [<NumBytes>]]
ParameterMeaning
FileNameSource file name to read from the Flasher.
aIf set, Input will be parsed as text instead of being shown as hex.
OffsetSpecifies the offset in the file, at which data reading is started.
NumBytesMaximum number of bytes to read.
Example
fshow Flasher.dat
3.2.1.13 fsize
On emulators which support file I/O this command gets the size of a specific file. Currently,
only Flasher models support file I/O.
FileNameSource file name to read from the Flasher.
Example
fsize Flasher.dat
3.2.1.14 fwrite
On emulators which support file I/O this command writes a specific file. Currently, only
Flasher models support file I/O. NumBytes is limited to 512 bytes at once.
This means, if you want to write e.g. 1024 bytes, you have to send the command twice,
using an appropriate offset when sending it the second time. Offset applies to both destination and source file.
EmuFileFile name to write to.
HostFileSource file on the host
OffsetSpecifies the offset in the file, at which data writing is started.
NumBytesMaximum number of bytes to write.
Example
fwrite Flasher.dat C:\Project\Flasher.dat
3.2.1.15 go
Starts the CPU. In order to avoid setting breakpoints it allows to define a maximum number of instructions which can be simulated/emulated. This is particularly useful when the
program is located in flash and flash breakpoints are used. Simulating instructions avoids
to reprogram the flash and speeds up (single) stepping.
Syntax
Syntax
go [<NumSteps> [<Flags>]]
ParameterMeaning
Maximum number of instructions allowed to be simulated. Instruc-
NumSteps
Flags
tion simulation stops whenever a breakpointed instruction is hit,
an instruction which cannot be simulated/emulated is hit or when
NumSteps is reached.
0: Do not start the CPU if a BP is in range of NumSteps
1: Overstep BPs
Example
go //Simply starts the CPU
go 20, 1
3.2.1.16 halt
Halts the CPU Core. If successful, shows the current CPU registers.
This command can be used to get information about the power consumption of the target (if
the target is powered via J-Link). It also gives the information if an overcurrent happened.
Syntax
hwinfo
3.2.1.18 ip
Closes any existing connection to J-Link and opens a new one via TCP/IP. If no IP Address
is specified, the Emulator selection dialog shows up.
Syntax
ip [<Addr>]
ParameterMeaning
Valid values:
Addr
IP Address: Connects the J-Link with the specified IP-Address
Host Name: Resolves the host name and connects to it.
*: Invokes the Emulator selection dialog.
Example
ip 192.168.6.3
3.2.1.19 is
This command returns information about the length of the scan chain select register.
Syntax
is
3.2.1.20 loadfile
This command programs a given data file to a specified destination address. Currently
supported data files are:
•*.mot
•*.srec
•*.s19
•*.s
•*.hex
•*.bin
Syntax
loadfile <Filename> [<Addr>]
ParameterMeaning
FilenameSource filename
AddrDestination address (Required for *.bin files)
Set path to logfile allowing the DLL to output logging information. If the logfile already
exists, the contents of the current logfile will be overwritten.
Syntax
log <Filename>
ParameterMeaning
FilenameLog filename
Example
log C:\Work\log.txt
3.2.1.22 mem
The command reads memory from the target system. If necessary, the target CPU is halted
in order to read memory. Zone names will be displayed on first connect to target with JLink commander if available.
Syntax
mem [<Zone>:]<Addr>, <NumBytes> (hex)
ParameterMeaning
ZoneName of memory zone to access.
AddrStart address.
NumbytesNumber of bytes to read. Maximum is 0x100000.
Example
mem 0x0, 0x100
or
mem AHB-AP (AP1):0x20000000, 0x100
3.2.1.23 mem8
The command reads memory from the target system in units of bytes. If necessary, the
target CPU is halted in order to read memory.
Syntax
mem [<Zone>:]<Addr>, <NumBytes> (hex)
ParameterMeaning
ZoneName of memory zone to access.
AddrStart address.
NumbytesNumber of bytes to read. Maximum is 0x100000.
Example
mem8 0, 100
3.2.1.24 mem16
The command reads memory from the target system in units of 16-bits. If necessary, the
target CPU is halted in order to read memory.
Measures the number of bits in the specified scan chain.
Syntax
ms <ScanChain>
ParameterMeaning
ScanChainScan chain to be measured.
Example
ms 1
3.2.1.29 power
This command sets the status of the power supply over pin 19 of the JTAG connector. The
KS(Kickstart) versions of J-Link have the 5V supply over pin 19 activated by default. This
feature is useful for some targets that can be powered over the JTAG connector.
Syntax
power <State> [perm]
ParameterMeaning
StateValid values: On, Off
permSets the specified State value as default.
Example
power on perm
3.2.1.30 r
Resets and halts the target.
Syntax
r
3.2.1.31 readAP
Reads from a CoreSight AP register. This command performs a full-qualified read which
means that it tries to read until the read has been accepted or too many WAIT responses
have been received. In case actual read data is returned on the next read request (this is
the case for example with interface JTAG) this command performs the additional dummy
read request automatically.
Reads a specific CSR (Control Status Register) on a RISC-V based target.
Syntax
readcsr <RegIndex>[,<RegSizeBytes>]
ParameterMeaning
RegIndexIndex of CSR register to read
RegSizeBytes
Example
readcsr 0x300
or
Optional. Specifies length of CSR register in bytes. If omitted RegSize
is assumed to be XLEN (32-bit on RV32, 64-bit on RV64).
readcsr 0x300, 8
3.2.1.33 readDP
Reads from a CoreSight DP register. This command performs a full-qualified read which
means that it tries to read until the read has been accepted or too many WAIT responses
have been received. In case actual read data is returned on the next read request (this is
the case for example with interface JTAG) this command performs the additional dummy
read request automatically.
Syntax
ReadDP <RegIndex>
ParameterMeaning
RegIndexIndex of DP register to read
Example
//
// Read DP-CtrlStat
//
ReadDP 1
3.2.1.34 regs
Shows all current register values.
Syntax
regs
3.2.1.35 rnh
This command performs a reset but without halting the device.
The function prints the value of the specified CPU register.
Syntax
rreg <RegIndex>
ParameterMeaning
RegIndexRegister to read.
Example
rreg 15
3.2.1.37 rx
Resets and halts the target. It is possible to define a delay in milliseconds after reset. This
function is useful for some target devices which already contain an application or a boot
loader and therefore need some time before the core is stopped, for example to initialize
hardware, the memory management unit (MMU) or the external bus interface.
Syntax
rx <DelayAfterReset>
ParameterMeaning
DelayAfterReset
Delay in ms.
Example
rx 10
3.2.1.38 savebin
Saves target memory into binary file.
Syntax
savebin <Filename>, <Addr>, <NumBytes> (hex)
ParameterMeaning
FilenameDestination file
AddrSource address.
NumBytesNumber of bytes to read.
Example
savebin C:\Work\test.bin 0x0000000 0x100
3.2.1.39 setBP
This command sets a breakpoint of a specific type at a specified address. Which breakpoint
modes are available depends on the CPU that is used.
Only for MIPS devices:
W: MIPS32 mode (Word)
H: MIPS16 mode (Half-word)
S: Force software BP
H: Force hardware BP
Example
setBP 0x8000036
3.2.1.40 setPC
Sets the PC to the specified value.
Syntax
setpc <Addr>
ParameterMeaning
AddrAddress the PC should be set to.
Example
setpc 0x59C
3.2.1.41 SetTimeoutCmd
Set timeout in milliseconds for a specific command.
Note
Right now only stepover is supported
Syntax
SetTimeoutCmd <Cmd> = <TimeoutMs>
ParameterMeaning
CmdCommand to set timeout for.
TimeoutMsTimeout in milliseconds.
Example
SetTimeoutCmd stepover = 5000
3.2.1.42 setWP
This command inserts a new watchpoint that matches the specified parameters. The enable
bit for the watchpoint as well as the data access bit of the watchpoint unit are set automatically by this command. Moreover the bits DBGEXT, CHAIN and the RANGE bit (used to
connect one watchpoint with the other one) are automatically masked out. In order to use
these bits you have to set the watchpoint by writing the ICE registers directly.
Specifies the control data on which data event has been set:
Accesstype
Size
DataSpecifies the Data on which watchpoint has been set.
DataMask
AddrMask
R: read access
W: write access
Valid values: S8 | S16 | S32
Specifies to monitor an n-bit access width at the selected address.
Specifies data mask used for comparison. Bits set to 1 are masked
out, so not taken into consideration during data comparison. Please
note that for certain cores not all Bit-Mask combinations are supported by the core-debug logic. On some cores only complete bytes can
be masked out (e.g. PIC32) or similar.
Specifies the address mask used for comparison. Bits set to 1 are
masked out, so not taken into consideration during address comparison. Please note that for certain cores not all Bit-Mask combinations
are supported by the core-debug logic. On some cores only complete
bytes can be masked out (e.g. PIC32) or similar.
Example
setWP 0x20000000 W S8 0xFF
3.2.1.43 sleep
Waits the given time (in milliseconds).
Syntax
sleep <Delay>
ParameterMeaning
DelayAmount of time to sleep in ms.
Example
sleep 200
3.2.1.44 speed
This command sets the speed for communication with the CPU core.
Syntax
speed <Freq>|auto|adaptive
ParameterMeaning
FreqSpecifies the interface frequency in kHz.
autoSelects auto detection of the interface speed.
adaptiveSelects adaptive clocking as JTAG speed.
This command prints the current hardware status. Prints the current status of TCK, TDI,
TDO, TMS, TRES, TRST and the interface speeds supported by the target. Also shows the
Target Voltage.
Syntax
st
3.2.1.46 step
Target needs to be halted before calling this command. Executes a single step on the target.
The instruction is overstepped even if it is breakpointed. Prints out the disassembly of the
instruction to be stepped.
Syntax
step
3.2.1.47 stepover
Target needs to be halted before calling this command. Executes a stepover on the target,
similar how a debugger does it. The instruction is overstepped even if it is breakpointed.
Prints out the disassembly of the instruction to be stepped over. By default this command
has a timeout of five seconds.
Note
For more information see SetTimeoutCmd
Syntax
stepover
3.2.1.48 unlock
This command unlocks a device which has been accidentally locked by malfunction of user
software.
Syntax
unlock <DeviceName>
ParameterMeaning
Name of the device family to unlock. Supported Devices:
DeviceName
Example
LM3Sxxx
Kinetis
EFM32Gxxx
unlock Kinetis
3.2.1.49 usb
Closes any existing connection to J-Link and opens a new one via USB. It is possible to
select a specific J-Link by port number.
Verifies if the specified binary is already in the target memory at the specified address.
Syntax
verifybin <Filename>, <Addr>
ParameterMeaning
FilenameSample bin.
AddrStart address of memory to verify.
Example
verifybin C:\Work\test.bin 0x0000000
3.2.1.51 VTREF
Sets a fixed value for VTref on J-Link. The Value of VTref can be set between 1200 mV
and 3300 mV all values that exceed 3300 mV will be limited to 3300 mV, values smaller
than 1200 mV deactivate fixed VTref. Settings of fixed VTref apply nonvolatile after power
cycling the probe.
Syntax
VTREF <ValuemV>
ParameterMeaning
ValuemVvalue in Millivolt
Example
VTREF 3300
3.2.1.52 w1
The command writes one single byte to the target system.
Syntax
w1 [<Zone>:]<Addr>, <Data> (hex)
ParameterMeaning
ZoneName of memory zone to access.
AddrStart address.
Data8-bits of data to write.
Example
w1 0x10, 0xFF
3.2.1.53 w2
The command writes a unit of 16-bits to the target system.
ZoneName of memory zone to access.
AddrStart address.
Data16-bits of data to write.
Example
w2 0x0, 0xFFFF
3.2.1.54 w4
The command writes a unit of 32-bits to the target system.
Syntax
w4 [<Zone>:]<Addr>, <Data> (hex)
ParameterMeaning
ZoneName of memory zone to access.
AddrStart address.
Data32-bits of data to write.
Example
w4 0x0, 0xAABBCCFF
3.2.1.55 WebUSBDisable
Disables WebUSB on J-Link. The WebUSB configuration applies nonvolatile after power
cycling the probe.
Syntax
WebUSBDisable
3.2.1.56 WebUSBEnable
Enables WebUSB on J-Link. The WebUSB configuration applies nonvolatile after power cycling the probe.
Syntax
WebUSBEnable
3.2.1.57 writeAP
Writes to a CoreSight AP register. This command performs a full-qualified write which means
that it tries to write until the write has been accepted or too many WAIT responses have
been received.
Syntax
WriteAP <RegIndex>, <Data32Hex>
ParameterMeaning
RegIndexIndex of AP register to write
Data32HexData to write
Writes a specific CSR (Control Status Register) on a RISC-V based target.
Note
Writes to known CSRs (like X1) may not be written to HW directly but with the next
g or s command.
Syntax
writecsr <RegIndex>, <Data>[,<RegSizeBytes>]
ParameterMeaning
RegIndexIndex of CSR register to write
DataData to write
RegSizeBytes
Optional. Specifies length of CSR register in bytes. If omitted RegSize
is assumed to be XLEN (32-bit on RV32, 64-bit on RV64).
Example
writecsr 0x1001, 0x11223344
or
writecsr 0x1001, 0x11223344, 8
3.2.1.59 writeDP
Writes to a CoreSight DP register. This command performs a full-qualified write which means
that it tries to write until the write has been accepted or too many WAIT responses have
been received.
Syntax
WriteDP <RegIndex>, <Data32Hex>
ParameterMeaning
RegIndexIndex of DP register to write
Data32HexData to write
Example
//
// Write DP SELECT register: Select AP 0 bank 15
//
WriteDP 2, 0x000000F0
3.2.1.60 wreg
Writes into a register. The value is written into the register on CPU start.
RegNameRegister to write to.
DataData to write to the specified register.
Example
wreg R14, 0xFF
3.2.2 Command line options
J-Link Commander can be started with different command line options for test and automation purposes. In the following, the command line options which are available for J-Link
Commander are explained. All command line options are case insensitive.
CommandExplanation
-AutoConnectAutomatically start the target connect sequence
-CommanderScriptPasses a CommandFile to J-Link
-CommandFilePasses a CommandFile to J-Link
-DevicePre-selects the device J-Link Commander shall connect to
-ExitOnErrorCommander exits after error
-IfPre-selects the target interface
-IPSelects IP as host interface
-JLinkScriptFilePasses a JLinkScriptFile to J-Link
-JTAGConfSets IRPre and DRPre
-LogSets logfile path
-RTTTelnetPortSets the RTT Telnetport
USBConnects to a J-Link with a specific S/N over USB.
-SettingsFilePasses a SettingsFile to J-Link
-SpeedStarts J-Link Commander with a given initial speed
3.2.2.1 -AutoConnect
This command can be used to let J-Link Commander automatically start the connect sequence for connecting to the target when entering interactive mode.
Syntax
-autoconnect <1|0>
Example
JLink.exe -autoconnect 1
3.2.2.2 -CommanderScript
Similar to -CommandFile.
3.2.2.3 -CommandFile
Selects a command file and starts J-Link Commander in batch mode. The batch mode of
J-Link Commander is similar to the execution of a batch file. The command file is parsed
line by line and one command is executed at a time.
Pre-selects the device J-Link Commander shall connect to. For some devices, J-Link already
needs to know the device at the time of connecting, since special handling is required for
some of them. For a list of all supported device names, please refer to List of supported
target devices.
Syntax
-Device <DeviceName>
Example
JLink.exe -Device STM32F103ZE
3.2.2.5 -ExitOnError
Similar to the exitonerror command.
3.2.2.6 -If
Selects the target interface J-Link shall use to connect to the target. By default, J-Link
Commander first tries to connect to the target using the target interface which is currently
selected in the J-Link firmware. If connecting fails, J-Link Commander goes through all
target interfaces supported by the connected J-Link and tries to connect to the device.
Syntax
-If <TargetInterface>
Example
JLink.exe -If SWD
Additional information
Currently, the following target interfaces are supported:
•JTAG
•SWD
3.2.2.7 -IP
Selects IP as host interface to connect to J-Link. Default host interface is USB.
Syntax
-IP <IPAddr>
Example
JLink.exe -IP 192.168.1.17
Additional information
To select from a list of all available emulators on Ethernet, please use * as <IPAddr> .
Passes the path of a J-Link script file to the J-Link Commander. J-Link scriptfiles are mainly
used to connect to targets which need a special connection sequence before communication
with the core is possible. For more information about J-Link script files, please refer to J-Link Script Files .
Passes IRPre and DRPre in order to select a specific device in a JTAG-chain. “-1,-1” can be
used to let J-Link select a device automatically.
Syntax
-JTAGConf <IRPre>,<DRPre>
Example
JLink.exe -JTAGConf 4,1
JLink.exe -JTAGConf -1,-1
3.2.2.10 -Log
Set path to LogFilePath allowing the DLL to output logging information. If the logfile already
exists, the contents of the current logfile will be overwritten.
Syntax
-Log <LogFilePath>
Example
JLink.exe -Log C:\Work\log.txt
3.2.2.11 -RTTTelnetPort
This command alters the RTT telnet port. Default is 19021.
Syntax
-RTTTelnetPort <Port>
Example
JLink.exe -RTTTelnetPort 9100
3.2.2.12 USB
Connect to a J-Link with a specific serial number via USB. Useful if multiple J-Links are
connected to the same PC and multiple instances of J-Link Commander shall run and each
connects to another J-Link.
Select a J-Link settings file to be used for the target device. The settings file can contain
all configurable options of the Settings tab in J-Link Control panel.
Syntax
-SettingsFile <PathToFile>
Example
JLink.exe -SettingsFile “C:\Work\settings.txt”
3.2.2.14 -Speed
Starts J-Link Commander with a given initial speed. Available parameters are “adaptive”,
“auto” or a freely selectable integer value in kHz. It is recommended to use either a fixed
speed or, if it is available on the target, adaptive speeds. Default interface speed is 100kHz.
Syntax
-Speed <Speed_kHz>
Example
JLink.exe -Speed 4000
3.2.3 Using J-Link Command Files
J-Link commander can also be used in batch mode which allows the user to use J-Link
commander for batch processing and without user interaction. Please do not confuse JLink Command Files file with J-Link Script Files (please refer to J-Link Script Files for more
information about J-Link script files). When using J-Link commander in batch mode, the
path to a command file is passed to it. The syntax in the command file is the same as
when using regular commands in J-Link commander (one line per command). SEGGER
recommends to always pass the device name via command line option due some devices
need special handling on connect/reset in order to guarantee proper function.
J-Link Remote Server allows using J-Link / J-Trace remotely via TCP/IP. This enables you
to connect to and fully use a J-Link / J-Trace from another computer. Performance is just
slightly (about 10%) lower than with direct USB connection.
J-Link Remote Server
3.3.1 List of available commands
The table below lists the commands line options accepted by the J-Link Remote Server
CommandDescription
?Prints the list of available command line options.
-PortSpecifies listening port of J-Link Remote Server.
-UseTunnelSpecifies if tunneled connection shall be used.
-SelectEmuBySN
-TunnelServer
-TunnelBySN
-TunnelByName
-TunnelPW
-TunnelPort
-TunnelEncrypt
-select
1
port
UseTunnel
SelectEmuBySN
1
1
Specifies to connect to a J-Link with a specific S/N. Only
valid for LAN mode.
Specify a tunnel server to connect to (default: jlink.segger.com:19020). Only valid for tunnel mode.
Specifies to identify at tunnel server via J-Link S/N. Only
valid for tunnel mode.
Specifies to identify at tunnel server via custom name. Only
valid for tunnel mode.
Specifies to protect the connection with a password. Only
valid for tunnel mode.
Specifies to connect to a tunnel server listening on a specific
port. Only valid for tunnel mode.
Specifies to encrypt any transferred data of a tunneled connection
<USB/IP>[=<SN/Hostname>] Specify how to connect to JLink.
Selects the IP port on which the J-Link Remote Server is listening.
Starts J-Link Remote Server in tunneling mode
Selects the J-Link to connect to by its serial number.
: These command line options exist because of backwards-compatibility.
We suggest to use the command line options that start with a dash (’-’).
3.3.2 Tunneling mode
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 the SEGGER tunnel server
via port 19020 and registers with its serial number. To connect to the J-Link from the
remote computer an also simple connection to tunnel:<SerialNo> can be established and
the debugger is connected to the J-Link.
J-Link Remote Server: Connected to SEGGER tunnel server
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
Remote server in tunneling mode. The serial number 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.
Start J-Link Remote Server in tunneling mode
3.3.3 Connecting to J-Link/ J-Trace using J-Link Remote
Server
J-Link Commander can be used to connect to the J-Link over the Remote Server:
1.) Start J-Link Commander
2.) From within J-Link Commander enter:
IP <RemoteServerIP> for a Remote Server running in LAN mode.
IP tunnel:<SN/Nickname>[:<Pasword>[:tunnelserver[:port]]] for a Remote Server
running in tunneling mode.
3.) If the connection was successful it should look like in this screenshot:
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 like:
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.
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.
3.3.3.1 Examples
IP 192.168.178.14 Connect over a Remote Server in your local network (You need to
know the specific local IP).
IP tunnel:ThisIsAName Connect over the default Tunnel Remote Server (The one from
SEGGER) by using the Name you assigned to the J-Link.
IP tunnel:174402383 Connect over the default Tunnel Remote Server by using the Serial
Number of the J-Link.
The J-Link Remote Server V6.53b and later supports encrypted connections in tunnel
mode.
That means that it is possible to have a remote J-Link session where any data transferred
between Client, Tunnel Server and Remote Server is encrypted. The encryption is done by
using end-to-end encryption between the J-Link Remote Server and a client application,
powered by SEGGER’s emCrypt.
For more information on emCrypt, please refer to emCrypt on segger.com .
J-Flash is an application to program data images to the flash of a target device. With JFlash the internal flash of all J-Link supported devices can be programmed, as well as
common external flashes connected to the device. Beside flash programming all other flash
operations like erase, blank check and flash content verification can be done.
J-Flash requires an additional license from SEGGER to enable programming. For license
keys, as well as evaluation licenses got to www.segger.com or contact us directly.
J-Flash Lite is a flash programming application to program data images to the flash of a
target device. In comparison to J-Flash, J-Flash Lite has a reduced feature set but does not
require a J-Link PLUS or higher to operate. J-Flash Lite is also available for J-Link BASE
and EDU.
3.6.1 Limitations in comparison to J-Flash
•No support for external CFI NOR flash
•No support for custom Init steps
•No support for automation via command line
•No project management support (Only the settings from the last session are preselected on startup)
3.6.2 Usage
J-Flash Lite is very simple to use. First, a configuration dialog shows up, in which the target
interface, target device etc. has to be selected. By clicking the O.K. button, the configuration
is applied and the actual main window is shown.
The main window of J-Flash Lite only consists of a few dialog elements that allow programming of the target:
Dialog elementFunction
“…” buttonSelects the application image (bin, hex, mot, …) to program
“Erase chip”
J-Link RTT Viewer is a GUI application available for Windows, MacOS and Linux.
It enables you to use all features of RTT in one application.
It supports:
•Displaying terminal output of Channel 0.
•Up to 16 virtual Terminals on Channel 0.
•Sending text input to Channel 0.
•Interpreting text control codes for colored text and controlling the Terminal.
•Logging terminal data into a file.
•Logging data on Channel 1.
For general information about RTT, please refer to RTT on page 349.
3.7.1 RTT Viewer Startup
Make sure J-Link and target device are connected and powered up.
Start RTT Viewer by opening the executable (JLinkRTTViewer.exe) from the installation
folder of the J-Link Software or the start menu. Unless the command line parameter --
autoconnect is set, the Configuration Dialog will pop up.
Configure the Connection Settings as described below and click OK. The connection settings
and all in app configuration will be saved for the next start of J-Link RTT Viewer.
•Stand-alone, opening an own connection to J-Link and target.
•In attach mode, connecting to an existing J-Link connection of a debugger.
Stand-alone connection settings
In stand-alone mode RTT Viewer needs to know some settings of J-Link and target device.
Select USB or TCP/IP as the connection to J-Link. For USB a specific J-Link serial number
can optionally be entered, for TCP/IP the IP or hostname of the J-Link has to be entered.
Select the target device to connect to. This allows J-Link to search in the known RAM of
the target.
Select the target interface and its speed. The RTT Control Block can be searched for fully
automatically, it can be set to a fixed address or it can be searched for in one or more
specific memory ranges.
Attaching to a connection
In attach mode RTT Viewer does not need any settings. Select Existing Session. For attach
mode a connection to J-Link has to be opened and configured by another application like a
debugger or simply J-Link Commander. If the RTT Control Block cannot be found automatically, configuration of its location has to be done by the debugger / application.
3.7.3 The Terminal Tabs
RTT Viewer allows displaying the output of Channel 0 in different “virtual” Terminals. The
target application can switch between terminals with SEGGER_RTT_SetTerminal() and SEGGER_RTT_TerminalOut(). RTT Viewer displays the Terminals in different tabs.
The All Terminals tab displays the complete output of RTT Channel 0 and can display the
user input (Check Input -> Echo input… -> Echo to “All Terminals”).
Each output line is prefixed by the Terminal it has been sent to. Additionally, output on
Terminal 1 is shown in red, output on Terminals 2 - 15 in gray.
Terminal 0 - 15
Each tab Terminal 0 - Terminal 15 displays the output which has been sent to this Terminal.
The Terminal tabs interpret and display Text Control Codes as sent by the application to
show colored text or erase the screen.
By default, if the RTT application does not set a Terminal Id, the output is displayed in
Terminal 0.
The Terminal 0 tab can additionally display the user input. (Check Input -> Echo input…
-> Echo to “Terminal 0”)
Each Terminal tab can be shown or hidden via the menu Terminals -> Terminals… or their
respective shortcuts as described below.
3.7.4 Sending Input
RTT Viewer supports sending user input to RTT Down Channel 0 which can be read by the
target application with SEGGER_RTT_GetKey() and SEGGER_RTT_Read().
Input can be entered in the text box below the Terminal Tabs.
RTT Viewer can be configured to directly send each character while typing or buffer it until
Enter is pressed (Menu Input -> Sending…).
In stand-alone mode RTT Viewer can retry to send input, in case the target input buffer is
full, until all data could be sent to the target via Input -> Sending… -> Block if FIFO full.
3.7.5 Logging Terminal output
The output of Channel 0 can be logged into a text file. The format is the same as used in the
All Terminals tab. Terminal Logging can be started via Logging -> Start Terminal Logging…
3.7.6 Logging Data
Additionally to displaying output of Channel 0, RTT Viewer can log data which is sent on
RTT Channel 1 into a file. This can for example be used to sent instrumented event tracing
data. The data log file contains header and footer and the binary data as received from
the application.
Data Logging can be started via Logging -> Start Data Logging…
Note
Data Logging is only available in stand-alone mode.
3.7.7 Command line options
J-Link RTT Viewer can be configured via command line parameters. In the following, the
command line options which are available for J-Link RTT Viewer are explained. All command
line options are case insensitive. Short and long command names have the same syntax.
Command line optionExplanation
-b, --brightBright theme for GUI
-d, --deviceSelect the connected target device.
-ct, --connectionSets the connection type
-if, --interfaceSets the interface type
-ip, --hostThe IP address of the J-Link
-s, --speedInterface speed in kHz
-sf, --scriptfileExecutes a command script on start up
-sn, --serialnumberSelect the J-Link with a specific S/N.
-ra, --rttaddrSets the address of the RTT control block
-rr, --rttrangeSpecify RTT search range
-a, --autoconnectAutomatically connect to target, suppress settings dialog
3.7.7.1 --bright
Starts the RTT Viewer in bright theme
Syntax
--bright
Example
JLinkRTTViewer.exe --bright
3.7.7.2 --device
Selects the device J-Link RTT Viewer shall connect to.
Syntax
--device <DeviceName>
Example
JLinkRTTViewer.exe --device STM32F103ZE
3.7.7.3 --connection
Sets the connection type. The connection to the J-Link can either be made directly over
USB, IP or using an existing running session (e.g. the IDE’s debug session). In case of using
an existing session, no further configuration options are required.
Sets the interface J-Link shall use to connect to the target. As interface types FINE, JTAG
and SWD are supported.
Syntax
--interface <fine|jtag|swd>
Example
JLinkRTTViewer.exe --interface swd
3.7.7.5 --host
Enter the IP address or hostname of the J-Link. This option only applies, if connection type
IP is used. Use * as <IPAddr> for a list of available J-Links in the local subnet.
Syntax
--host <IPAddr>
Example
JLinkRTTViewer.exe --host 192.168.1.17
3.7.7.6 --speed
Sets the interface speed in kHz for target communication.
Syntax
--speed <speed>
Example
JLinkRTTViewer.exe --speed 4000
3.7.7.7 --scriptfile
Executes a JLink command script on startup, setting options in advance (e.g. Device =
AT91SAM7S256)
Connect to a J-Link with a specific serial number via USB. Useful if multiple J-Links are
connected to the same PC and multiple instances of J-Link RTT Viewer shall run and each
connects to another J-Link.
-> Clear TerminalClears the displayed output of this Terminal Tab.Alt-R
3.7.9 Using "virtual" Terminals in RTT
For virtual Terminals the target application needs only Up Channel 0. This is especially
important on targets with low RAM.
If nothing is configured, all data is sent to Terminal 0.
The Terminal to output all following via Write, WriteString or printf can be set with SEG-
GER_RTT_SetTerminal().
Output of only one string via a specific Terminal can be done with SEGGER_RTT_Termi-
nalOut().
The sequences sent to change the Terminal are interpreted by RTT Viewer. Other applica-
tions like a Telnet Client will ignore them.
3.7.10 Using Text Control Codes
RTT allows using Text Control Codes (ANSI escape codes) to configure the display of text.
RTT Viewer supports changing the text color and background color and can erase the Terminal. These Control Codes are pre-defined in the RTT application and can easily be used
in the application.
Example 1
SEGGER_RTT_WriteString(0,
RTT_CTRL_RESET"Red: " \
RTT_CTRL_TEXT_BRIGHT_RED"This text is red. " \
RTT_CTRL_TEXT_BLACK"" \
RTT_CTRL_BG_BRIGHT_RED"This background is red. " \
RTT_CTRL_RESET"Normal text again."
);
Free-of-charge utility for J-Link. Displays the terminal output of the target using the SWO
pin. The stimulus port(s) from which SWO data is received can be chosen by using the
port checkboxes 0 to 31. Can be used in parallel with a debugger or stand-alone. This is
especially useful when using debuggers which do not come with built-in support for SWO
such as most GDB / GDB+Eclipse based debug environments.
3.8.1 J-Link SWO Viewer CL
Command line-only version of SWO Viewer. All commands available for J-Link SWO Viewer
can be used with J-Link SWO Viewer Cl. Similar to the GUI Version, J-Link SWO Viewer CL
asks for a device name or CPU clock speed at startup to be able to calculate the correct
SWO speed or to connect to a running J-Link GDB Server.
Using the syntax given below(see List of available command line options ), J-Link SWO
Viewer CL can be directly started with parameters.
J-Link SWO Viewer is available via the start menu. It asks for a device name or CPU clock
speed at startup to be able to calculate the correct SWO speed or to connect to a running
J-Link GDB Server.
Optionally you can select the preferred SWO clock speed from a drop down list. If nothing
is selected for SWO clock speed then the debug probe will calculate the optimal value. To
populate the drop down list the device needs to be selected or CPU clock speed must be
measured once per session.
When running in normal mode J-Link SWO Viewer automatically performs the necessary
initialization to enable SWO output on the target, in GDB Server mode the initialization
has to be done by the debugger. Should you have a target connection already open e.g. a
debug session in your IDE we recommend defining the parameters device name, CPU clock
frequency and SWO clock frequency via CL to avoid connection errors.
3.8.3 List of available command line options
J-Link SWO Viewer can also be controlled from the command line if used in a automated
test environment etc. When passing all necessary information to the utility via command
line, the configuration dialog at startup is suppressed. Minimum information needed by JLink SWO Viewer is the device name (to enable CPU frequency auto detection) or the CPU
clock speed. The table below lists the commands accepted by the J-Link SWO View
CommandDescription
-cpufreqSelect the CPU frequency.
-deviceSelect the target device.
-ipConfigure connection settings to IP IPAddress.
-itmmask
-itmportSelects a itm stimulus port which should be used to listen to.
-outputfilePrint the output of SWO Viewer to the selected file.
-settingsfileSpecify a J-Link settings file.
-swofreqSelect the SWO frequency.
-usbConfigure connection settings to USB S/N.
Selects a set of itm stimulus ports which should be used to
listen to.
3.8.3.1 -cpufreq
Defines the current CPU speed in Hz that the CPU is running at. If the CPU is for example
running at 96 MHz, the command line should look as below.
Select the target device to enable the CPU frequency auto detection of the J-Link DLL. To
select a ST STM32F207IG as target device, the command line should look as below. For a
list of all supported device names, please refer to:
List of supported target devices
Syntax
-device <DeviceID>
Example
-device STM32F207IG
3.8.3.3 -ip
Selects IP as host interface to connect to J-Link. Default host interface is USB.
Syntax
-ip <IPAddr>
Example
-ip 192.168.1.17
3.8.3.4 -itmmask
Defines a set of stimulusports from which SWO data is received and displayed by SWO
Viewer. If itmmask is given, itmport will be ignored.
Syntax
-itmmask <Mask>
Example
Listen on ports 0 and 2
-itmmask 0x5
3.8.3.5 -itmport
Defines the stimulus port from which SWO data is received and displayed by the SWO
Viewer. Default is stimulus port 0. The command line should look as below.
Syntax
-itmport <ITMPortIndex>
Example
-itmport 0
3.8.3.6 -outputfile
Define a file to which the output of SWO Viewer is printed.
Select a J-Link settings file to use for the target device.
Syntax
-settingsfile <PathToFile>
Example
-settingsfile “C:\Temp\Settings.jlink”
3.8.3.8 -swofreq
Defines the SWO frequency that shall be used by J-Link SWO Viewer for sampling SWO
data. Usually not necessary to define since optimal SWO speed is calculated automatically
based on the CPU frequency and the capabilities of the connected J-Link. If the targeted
SWO speed is 6 MHz the command line should look as follows.
Syntax
-swofreq <SWOFreq>
Example
-swofreq 6000000
3.8.3.9 -usb
Configures the connection settings according to defined USB S/N. Usually not necessary to
define if only one debug device is connected to the PC.
Syntax
-usb <S/N>
Example
-usb 01234567
3.8.4 Configure SWO output after device reset
In some situations it might happen that the target application is reset and it is desired to log
the SWO output of the target after reset during the booting process. For such situations, the
target application itself needs to initialize the CPU for SWO output, since the SWO Viewer
is not restarted but continuously running.
Example code for enabling SWO out of the target application
#define DWT_CTRL (*(volatileunsignedint*)0xE0001000) // DWT Control Register
#define FFCR (*(volatileunsignedint*)0xE0040304) // Formatter and flush
// Control Register
U32 _ITMPort = 0; // The stimulus port from which SWO data is received// and displayed.
U32 TargetDiv = 1; // Has to be calculated according to// the CPU speed and the output baud rate
staticvoid _EnableSWO() {
U32 StimulusRegs;
//// Enable access to SWO registers//
DEMCR |= (1 << 24);
ITM_LSR = 0xC5ACCE55;
//// Initially disable ITM and stimulus port// To make sure that nothing is transferred via SWO// when changing the SWO prescaler etc.//
StimulusRegs = ITM_ENA;
StimulusRegs &= ~(1 << _ITMPort);
ITM_ENA = StimulusRegs; // Disable ITM stimulus port
ITM_TCR = 0; // Disable ITM//// Initialize SWO (prescaler, etc.)//
TPIU_SPPR = 0x00000002; // Select NRZ mode
TPIU_ACPR = TargetDiv - 1; // Example: 72/48 = 1,5 MHz
ITM_TPR = 0x00000000;
DWT_CTRL = 0x400003FE;
FFCR = 0x00000100;
//// Enable ITM and stimulus port//
ITM_TCR = 0x1000D; // Enable ITM
ITM_ENA = StimulusRegs | (1 << _ITMPort); // Enable ITM stimulus port
}
---------------------------------------------------------------------File : SWO.c
Purpose : Simple implementation for output via SWO for Cortex-M processors.
It can be used with any IDE. This sample implementation ensures
that output via SWO is enabled in order to guarantee that the
application does not hang.
/*********************************************************************
*
* SWO_PrintChar()
*
* Function description
* Checks if SWO is set up. If it is not, return,
* to avoid program hangs if no debugger is connected.
* If it is set up, print a character to the ITM_STIM register
* in order to provide data for SWO.
* Parameters
* c: The character to be printed.
* Notes
* Additional checks for device specific registers can be added.
*/
void SWO_PrintChar(char c) {
//// Check if ITM_TCR.ITMENA is set//if ((ITM_TCR & 1) == 0) {
return;
}
//// Check if stimulus port is enabled//if ((ITM_ENA & 1) == 0) {
return;
}
//// Wait until STIMx is ready,// then send data//while ((ITM_STIM_U8 & 1) == 0);
ITM_STIM_U8 = c;
}
/*********************************************************************
*
* SWO_PrintString()
*
* Function description
* Print a string via SWO.
*
*/
void SWO_PrintString(constchar *s) {
//// Print out character per character//while (*s) {
SWO_PrintChar(*s++);
}
}
SWO Analyzer (SWOAnalyzer.exe) is a tool that analyzes SWO output. Status and summary
of the analysis are output to standard out, the details of the analysis are stored in a file.
Usage
SWOAnalyzer.exe <SWOfile> This can be achieved by simply dragging the SWO output file
created by the J-Link DLL onto the executable.
Creating an SWO output file
In order to create the SWO output file, which is the input file for the SWO Analyzer, the JLink config file needs to be modified. It should contain the following lines:
JTAGLoad is a tool that can be used to open and execute an svf (Serial vector format) file for
JTAG boundary scan tests. The data in the file will be sent to the target via J-Link / J-Trace.
SVF is a standard format for boundary scan vectors to be used with different tools and
targets. SVF files contain human-readable ASCII SVF statements consisting of an SVF command, the data to be sent, the expected response, a mask for the response or additional
information.
JTAGLoad supports following SVF commands:
•ENDDR
•ENDIR
•FREQUENCY
•HDR
•HIR
•RUNTEST
•SDR
•SIR
•STATE
•TDR
•TIR
A simple SVF file to read the JTAG ID of the target can look like following:
! Set JTAG frequency
FREQUENCY 12000000HZ;
! Configure scan chain
! For a single device in chain, header and trailer data on DR and IR are 0
! Set TAP to IDLE state
STATE IDLE;
! Configure end state of DR and IR after scan operations
ENDDR IDLE;
ENDIR IDLE;
! Start of test
! 32 bit scan on DR, In: 32 0 bits, Expected out: Device ID (0x0BA00477)
SDR 32 TDI (0) TDO (0BA00477) MASK (0FFFFFFF);
! Set TAP to IDLE state
STATE IDLE;
! End of test
SVD files allow even more complex tasks, basically everything which is possible via JTAG
and the devices in the scan chain, like configuring an FPGA or loading data into memory.
The J-Link RDI software is a remote debug interface for J-Link. It makes it possible to use
J-Link with any RDI compliant debugger. The main part of the software is an RDI-compliant
DLL, which needs to be selected in the debugger. here are two additional features available
which build on the RDI software foundation. Each additional feature requires an RDI license
in addition to its own license. Evaluation licenses are available free of charge. For further
information go to our website or contact us directly.
Note
The RDI software (as well as flash breakpoints and flash downloads) do not require a
license if the target device is an LPC2xxx. In this case the software verifies that the
target device is actually an LPC 2xxx and have a device-based license.
3.11.1 Flash download and flash breakpoints
Flash download and flash breakpoints are supported by J-Link RDI. For more information about flash download and flash breakpoints, please refer to J-Link RDI User’s Guide
(UM08004) , chapter Flash download and chapter Breakpoints in flash memory .
The J-Link Software and Documentation Package includes some tools which support processor specific functionalities, like unlocking a device.
3.12.1 J-Link STR91x Commander (Command line tool)
J-Link STR91x Commander (JLinkSTR91x.exe) is a tool that can be used to configure
STR91x cores. It permits some STR9 specific commands like:
•Set the configuration register to boot from bank 0 or 1.
•Erase flash sectors.
•Read and write the OTP sector of the flash.
•Write-protect single flash sectors by setting the sector protection bits.
•Prevent flash from communicate via JTAG by setting the security bit.
All of the actions performed by the commands, excluding writing the OTP sector and erasing
the flash, can be undone. This tool can be used to erase the flash of the controller even if
a program is in flash which causes the CPU core to stall.
When starting the STR91x commander, a command sequence will be performed which
brings MCU into Turbo Mode.
“While enabling the Turbo Mode, a dedicated test mode signal is set and controls the GPIOs
in output. The IOs are maintained in this state until a next JTAG instruction is sent.” (ST
Microelectronics)
Enabling Turbo Mode is necessary to guarantee proper function of all commands in the
STR91x Commander.
showconfShow configuration register content and security status
mem
erase
erase bank0Erase flash bank 0
erase bank1Erase flash bank 1
erase allPerform a full chip erase
setb
setLVDthSet the LVD threshold to 2.7 V.
clrLVDthSet the LVD threshold to 2.4 V.
setLVDresetLVD Reset Out is generated by VDD or VDDQ inputs.
clrLVDresetLVD Reset Out is generated by VDD input only.
setLVDwarnLVD warning is generated by VDD or VDDQ inputs.
clrLVDwarnLVD warning is generated by VDD input only.
blankBlank check all flash sectors
secure
unsecureUnsecure the device. Content of configuration register is saved.
protect
unprotect
readotpRead OTP sectors
writeotp
qQuit
Syntax: fsize 0|1|2|3, where 0 selects a 256 Kbytes device,
1 a 512 Kbytes device, 2 a 1024 KBytes device
and 3 a 2048 Kbytes device
Read memory
Syntax: mem <Addr>, <NumBytes>
Erase flash sectors (OTP can not be erased).
Syntax: erase <SectorMaskL>, <SectorMaskH>
SectorMaskL = Bits 0-%d mask sectors 0-%d of bank 0
SectorMaskH = Bits 0-%d mask sectors 0-%d of bank 1
Bit 17 masks the configuration sector
Bit 18 masks the User-Code sector
All other bits are ignored
Boot from flash bank x (0 and 1 are available)
Syntax: setb <int>
Set the security bit. Protects device from read or debug access
through the JTAG port (can only be cleared by a full chip erase).
Protect flash sectors.
Syntax: protect <Bank0SectorMask>, <Bank1SectorMask>
Bank0SectorMask: Bits 0-%d mask flash sectors 0-%d of bank 0
Bank1SectorMask: Bits 0-%d mask flash sectors 0-%d of bank 1
Unprotect flash sectors.
Syntax: unprotect <Bank0SectorMask>, <Bank1SectorMask>
Bank0SectorMask: Bits 0-%d mask flash sectors 0-%d of bank 0
Bank1SectorMask: Bits 0-%d mask flash sectors 0-%d of bank 1
Write words to the OTP sectors.
Syntax: writeotp <Word1>, [<Word2>, …, <Word8>]
Command line options
J-Link STR91x Commander can be started with different command line options for test and
automation purposes. In the following, the command line options which are available for
J-Link Commander are explained. All command line options are case insensitive.
-USBConnects to a J-Link with a specific S/N over USB
-IRPreScan-Chain Configuration
-IRPostScan-Chain Configuration
-DRPreScan-Chain Configuration
-DRPostScan-Chain Configuration
3.12.1.1 -CommandFile
Selects a command file and starts J-Link STR91x Commander in batch mode. The batch
mode of J-Link STR91x Commander is similar to the execution of a batch file. The command
file is parsed line by line and one command is executed at a time.
Syntax
-CommandFile <CommandFilePath>
Example
See Using J-Link Command Files .
3.12.1.2 -DRPre, -DRPost, -IRPre and -IRPost (Scan-Chain Configuration )
STR91x allows to configure a specific scan-chain via command-line. To use this feature four
command line options have to be specified in order to allow a proper connection to the proper device. In case of passing an incomplete configuration, the utility tries to auto-detect.
Connect to a J-Link with a specific serial number via USB. Useful if multiple J-Links are
connected to the same PC and multiple instances of J-Link Commander shall run and each
connects to another J-Link.
Syntax
-USB <SerialNo>
Example
JLinkSTR91x.exe -USB 580011111
3.12.2 J-Link STM32 Unlock (Command line tool)
J-Link STM32 Unlock (JLinkSTM32.exe) is a free command line tool which can be used
to disable the hardware watchdog of STM32 devices which can be activated by programming the option bytes. Moreover the J-Link STM32 Commander unsecures a read-protected
STM32 device by re-programming the option bytes.
Note
Unprotecting a secured device or will cause a mass erase of the flash memory.
Command Line Options
Command line optionExplanation
-IP
-SelectEmuBySNConnects to a J-Link with a specific S/N over USB
-Speed
-SetPowerTargetEnables target power supply via pin 19.
Selects IP as host interface to connect to J-Link. Default host
interface is USB.
Starts the J-Link STM32 Unlock Utility with a given initial interface speed.
Page 95
95CHAPTER 3Processor specific tools
Command line optionExplanation
-ExitJ-Link STM32 Unlock will close automatically
3.12.2.1 -IP
Selects IP as host interface to connect to J-Link. Default host interface is USB.
Syntax
-IP <IPAddr>
Example
JLinkSTM32.exe -IP 192.168.1.17
Note
To select from a list of all available emulators on Ethernet, please use * as <IPAddr>.
3.12.2.2 -SelectEmuBySN
Connect to a J-Link with a specific serial number via USB. Useful if multiple J-Links are
connected to the same PC.
Syntax
-SelectEmuBySN <SerialNo>
Example
JLinkSTM32.exe -SelectEmuBySN 580011111
3.12.2.3 -Speed
Starts J-Link STM32 Unlock Utility with a given initial speed. Available parameters are
“adaptive”, “auto” or a freely selectable integer value in kHz. It is recommended to use
either a fixed speed or, if it is available on the target, adaptive speeds. Default interface
speed is 1000 kHz.
Syntax
-Speed <Speed_kHz>
Example
-Speed 1000
3.12.2.4 -SetPowerTarget
The connected debug probe will power the target via pin 19 of the debug connector.
Syntax
-SetPowerTarget <Mode>
Example
JLinkSTM32.exe -SetPowerTarget 1 // Target power will be set
3.12.2.5 -SetDeviceFamily
This command allows to specify a device family, so that no user input is required to start
the unlocking process.
There are two different options to specify the device family to be used:
a) Pass the list index from the list which shows all supported families on start up
b) Pass the defined device name
JLinkSTM32.exe -SetDeviceFamily 10 // Selects STM32L1 series
JLinkSTM32.exe -SetDeviceFamily STM32F2xxxx // Selects STM32F2 series
3.12.2.6 -Exit
In general, the J-Link STM32 utility waits at the end of the unlock process for any user
input before application closes. This option allows to skip this step, so that the utility closes
automatically.
The J-Link Software Developer Kit is needed if you want to write your own program with JLink / J-Trace. The J-Link DLL is a standard Windows DLL typically used from C programs
(Visual Basic or Delphi projects are also possible). It makes the entire functionality of JLink / J-Trace available through its exported functions, such as halting/stepping the CPU
core, reading/writing CPU and ICE registers and reading/writing memory. Therefore it can
be used in any kind of application accessing a CPU core. The standard DLL does not have
API functions for flash programming. However, the functionality offered can be used to
program flash. In this case, a flash loader is required. The table below lists some of the
included files and their respective purpose.
Further information can be found on the SEGGER website:
J-Link SDK
The J-Link SDK requires an additional license and is available upon request from www.seg-
The GNU Project Debugger (GDB) is a freely available and open source debugger. It can
be used in command line mode, but is also integrated in many IDEs like emIDE or Eclipse.
J-Link GDB Server is a remote server for GDB making it possible for GDB to connect to and
communicate with the target device via J-Link. GDB Server and GDB communicate via a
TCP/IP connection, using the standard GDB remote protocol. GDB Server receives the GDB
commands, does the J-Link communication and replies with the answer to GDB.
With J-Link GDB Server debugging in ROM and Flash of the target device is possible and the
Unlimited Flash Breakpoints can be used. It also comes with some functionality not directly
implemented in the GDB. These can be accessed via monitor commands, sent directly via
GDB, too.
The GNU Project Debugger (GDB) is a freely available debugger, distributed under the terms
of the GPL. The latest Unix version of the GDB is freely available from the GNU committee
under: http://www.gnu.org/software/gdb/download/
100CHAPTER 4J-Link GDB Server CL (Windows, Linux, Mac)
4.1 J-Link GDB Server CL (Windows, Linux, Mac)
J-Link GDB Server CL is a commandline-only version of the GDB Server. The command
line version is part of the Software and Documentation Package and also included in the
Linux and MAC versions.
Except for the missing GUI, J-Link GDB Server CL is identical to the normal version. All
sub-chapters apply to the command line version, too.