Segger J-Link User manual

A product of SEGGER Microcontroller GmbH & Co. KG
www.segger.com
J-Link / J-Trace
User Guide
Software Version V6.14
Manual Rev. 0
Document: UM08001
Date: February 23, 2017

2
J-Link / J-Trace (UM08001) © 2004-2017 SEGGER Microcontroller GmbH & Co. KG
Disclaimer
Specifications written in this document are believed to be accurate, but are not guar-
anteed 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 & Co. KG (the manufacturer) assumes no
responsibility for any errors or omissions. The manufacturer makes and you receive
no warranties or conditions, express, implied, statutory or in any communication with
you. The manufacturer 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 the manufacturer. The software described in this doc-
ument is furnished under a license and may only be used or copied in accordance
with the terms of such a license.
©2017 SEGGER Microcontroller GmbH & Co. KG, Hilden / Germany
Trademarks
Names mentioned in this manual may be trademarks of their respective companies.
Brand and product names are trademarks or registered trademarks of their respec-
tive holders.
Contact address
SEGGER Microcontroller GmbH & Co. KG
In den Weiden 11
D-40721 Hilden
Germany
Tel.+49 2103-2878-0
Fax.+49 2103-2878-28
Email: support@segger.com
Internet: http://www.segger.com
Revisions
This manual describes the J-Link and J-Trace device.

J-Link / J-Trace (UM08001) © 2004-2017 SEGGER Microcontroller GmbH & Co. KG
3
For further information on topics or routines not yet specified, please contact us.
Revision Date By Explanation
V6.14 Rev. 3 170220 NV
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"
V6.14 Rev. 2 170216 NV
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.
V6.14 Rev. 1 170210 NV
Chapter "Working with J-Link and J-Trace"
* Section "Exec Commands": Updated
SetResetPulseLen
TraceSampleAdjust
Chapter "Trace"
* Section "Tracing via trace pins": Updated
V6.14 Rev. 0 170201 AG
Chapter "Working with J-Link"
* Section "Exec Commands": Updated
SelectTraceSource
SetRAWTRACEPinDelay
ReadIntoTraceCache
Chapter "Trace" added .
V6.10a Rev. 0 160820 EL
Chapter "Working With J-Link"
* Section "Exec Commands": Updated
ExcludeFlashCacheRanges.
V6.00i Rev. 0 160802 EL
Chapter "Introduction"
* Removed "Model Fature Lists"
Chapter "Adding Support for New Devices":
renamed to "Open Flash Loader"
Chapter "Open Flash Loader" updated.
V6.00 Rev. 1 160617 EL Chapter "J-Flash SPI"
* Added chapter "Custom Command Sequences"
V6.00 Rev. 0 160519 AG Chapter "Adding Support for New Devices" added.
V5.12f Rev. 0 160503 AB
Chapter "Related Software"
* Section "J-Link RTT Viewer" updated and moved
from section "RTT".
V5.12d Rev. 1 160427 AG Chapter "Working with J-Link and J-Trace"
* Section "J-Link script files" updated.
V5.12d Rev. 0 160425 AG Chapter "Working with J-Link and J-Trace"
* Section "J-Link script files" updated.
V5.12c Rev. 1 160418 NG
Chapter "Related Software"
* Section "J-Link Commander"
Typo fixed.

4
J-Link / J-Trace (UM08001) © 2004-2017 SEGGER Microcontroller GmbH & Co. KG
V5.12c Rev. 0 160413 NG
Chapter "Related Software"
* Section "J-Link Commander"
Commands and commandline options added.
Chapter "Working with J-Link and J-Trace"
* Section "Command strings"
Command "SetRTTTelnetPort" added.
Chapter "Flash Download"
* Section "Debugging applications that change
flash contents at runtime" added.
V5.10u Rev. 0 160317 AG
Chapter "Monitor Mode Debugging"
* Section "Target application performs reset"
added.
V5.10t Rev. 0 160314 AG
Chapter "Monitor Mode Debugging"
* Section "Enable Monitor Debugging" updated.
* Section "Forwarding of Monitor Interrupts"
added.
V5.10 Rev. 3 160309 EL Chapter "J-Flash SPI" updated.
V5.10 Rev. 2 160215 AG Chapter "RTT" updated.
V5.10 Rev. 1 151204 AG Chapter "RDI" updated.
Chapter "Semihosting" added.
V5.10 Rev. 0 151127 NG Chapter "Related Software"
* Section "J-Scope" removed.
V5.02m Rev. 0 151125 AG
Chapter "Working with J-Link and J-Trace"
* Section "The J-Link settings file" added.
Chapter "Low Power Debugging" added.
V5.02l Rev. 0 151123 AG Various Chapters
* Some typos corrected.
V5.02i Rev. 1 151106 RH Chapter "J-Flash SPI"
* Section "Send custom commands" added.
V5.02i Rev. 0 151105 RH
Chapter "Related Software"
* Section "J-Link Commander"
exec command added.
Chapter "Working with J-Link and J-Trace"
* Section "Command strings"
New commands added.
V5.02f Rev. 1 151022 NG Chapter "Related Software"
* Section "J-Scope" updated.
V5.02f Rev. 1 151022 EL Chapter "Target interfaces and adapters"
* Section "Reference volatge (VTref)" added.
V5.02f Rev. 0 151007 RH Chapter "Working with J-Link and J-Trace"
* Section "J-Link script files" updated.
V5.02e Rev. 0 151001 AG Chapter "Working with J-Link and J-Trace"
* Section "J-Link script files" updated.
V5.02c Rev. 1 150925 NG
Chapter "Licensing"
* Sectin "Original SEGGER products" updated.
Chapter "Flash download"
* Section "Setup for various debuggers (CFI
flash)" updated.
V5.02c Rev. 0 150916 RH
Chapter "Flash download"
* Section "Setup for various debuggers (SPIFI
flash)" added.
V5.02c Rev. 0 150914 RH
Chapter "Introduction"
* Section "J-Link / J-Trace models" updated.
* Section "Supported OS"
Added Windows 10
V5.02a Rev. 0 150903 AG Chapter "Monitor Mode Debugging" added.
Revision Date By Explanation

J-Link / J-Trace (UM08001) © 2004-2017 SEGGER Microcontroller GmbH & Co. KG
5
V5.02 Rev. 0 150820 AG
Chapter "Working with J-Link and J-Trace"
* Section "Command strings"
"DisableCortexMXPSRAutoCorrectTBit" added.
V5.02 Rev. 0 150813 AG Chapter "Monitor Mode Debugging" added.
V5.00 Rev. 1 150728 NG
Chapter "Related Software"
* Section "J-Link Commander"
Sub-Section "Command line options" updated.
V5.00 Rev. 0 150609 AG
Chapter "Flash download"
* Section "QSPI flash support" added.
Chapter "Flash breakpoints"
* Section "Flash Breakpoints in QSPI flash" added
V5.00 Rev. 0 150520 EL Chapter "J-Flash SPI"
* Initial version added
V4.99b Rev. 0 150520 EL
Chapter "Related Software"
* Section "J-Link STM32 Unlock"
- Added command line options
V4.99a Rev. 0 150429 AG
Chapter "Target interfaces and Adapters"
Chapter "20-pin J-Link connector", section
"Pinout for SPI" added.
V4.98d Rev. 0 150427 EL
Chapter "Related Software"
* Section "Configure SWO output after device
reset" updated.
V4.98b Rev. 0 150410 AG Chapter "Licensing"
* Section "J-Trace for Cortex-M" updated.
V4.98 Rev. 0 150320 NG
Chapter "Related Software"
* Section "J-Link Commander"
Sub-Section "Commands" added.
Chapter "Working with J-Link and J-Trace"
* Section "J-Link script files" updated
V4.96f Rev. 0 150204 JL
Chapter "Related Software"
* Section "GDB Server"
Exit code description added.
V4.96 Rev. 0 141219 JL
Chapter "RTT" added.
Chapter "Related Software"
* Section "GDB Server"
Command line option "-strict" added.
Command line option "-timeout" added.
V4.90d Rev. 0 141112 NG
Chapter "Related Software"
* Section "J-Link Remote Server" updated.
* Section "J-Scope" updated.
V4.90c Rev. 0 140924 JL Chapter "Related Software"
* Section "JTAGLoad" updated.
V4.90b Rev. 1 140813 EL
Chapter "Working with J-Link and J-Trace"
* Section "Connecting multiple J-Links / J-Traces
to your PC" updated
Chapter "J-Link software"
* Section "J-Link Configurator" updated.
V4.90b Rev. 0 140813 NG Chapter "Related Software"
* Section "J-Scope" added.
V4.86 Rev. 2 140606 AG
Chapter "Device specifics"
* Section "Silicon Labs - EFM32 series devices"
added
V4.86 Rev. 1 140527 JL
Chapter "Related Software"
* Section "GDB Server"
Command line options -halt / -nohalt added.
Description for GDB Server CL version added.
Revision Date By Explanation

6
J-Link / J-Trace (UM08001) © 2004-2017 SEGGER Microcontroller GmbH & Co. KG
V4.86 Rev. 0 140519 AG Chapter "Flash download"
Section "Mentor Sourcery CodeBench" added.
V4.84 Rev. 0 140321 EL
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."
V4.82 Rev. 1 140228 EL
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"
V4.82 Rev. 0 140218 JL
Chapter "Related Software"
* Section "GDB Server"
Command line option -notimout added.
V4.80f Rev. 0 140204 JL
Chapter "Related Software"
* Section "GDB Server"
Command line options and remote commands
added.
V4.80 Rev. 1 131219 JL/
NG
Chapter "Related Software"
* Section "GDB Server"
Remote commands and command line options
description improved.
Several corrections.
V4.80 Rev. 0 131105 JL
Chapter "Related Software"
* Section "GDB Server"
SEGGER-specific GDB protocol extensions
added.
V4.76 Rev. 3 130823 JL
Chapter "Flash Download"
* Replaced references to GDB Server manual.
Chapter "Working withc J-Link"
* Replaced references to GDB Server manual.
V4.76 Rev. 2 130821 JL
Chapter "Related Software"
* Section "GDB Server"
Remote commands added.
V4.76 Rev. 1 130819 JL
Chapter "Related Software"
* Section "SWO Viewer"
Sample code updated.
V4.76 Rev. 0 130809 JL
Chapter "Related Software"
* Sections reordered and updated.
Chapter "Setup"
* Section "Using JLinkARM.dll moved here.
V4.71b Rev. 0 130507 JL
Chapter "Related Software"
* Section "SWO Viewer"
Added new command line options.
V4.66 Rev. 0 130221 JL
Chapter "Introduction"
* Section "Supported OS"
Added Linux and Mac OSX
Revision Date By Explanation

J-Link / J-Trace (UM08001) © 2004-2017 SEGGER Microcontroller GmbH & Co. KG
7
V4.62b Rev. 0 130219 EL
Chapter "Introduction"
* Section "J-Link / J-Trace models"
Clock rise and fall times updated.
V4.62 Rev. 0 130129 JL
Chapter "Introduction"
* Section "J-Link / J-Trace models"
Sub-section "J-link ULTRA" updated.
V4.62 Rev. 0 130124 EL
Chapter "Target interfaces and adapters"
* Section "9-pin JTAG/SWD connector"
Pinout description corrected.
V4.58 Rev. 1 121206 AG Chapter "Intoduction"
* Section "J-Link / J-Trace models" updated.
V4.58 Rev. 0 121126 JL
Chapter "Working with J-Link"
* Section "J-Link script files"
Sub-section "Executing J-Link script files"
updated.
V4.56b Rev. 0 121112 JL
Chapter "Related Software"
* Section "J-Link SWO Viewer"
Added sub-section "Configure SWO output
after device reset"
V4.56a Rev. 0 121106 JL
Chapter "Related Software"
* Section "J-Link Commander"
Renamed "Commander script files" to
"Commander files" and "script mode" to
"batch mode".
V4.56 Rev. 0 121022 AG Renamed "J-Link TCP/IP Server" to "J-Link Remote
Server".
V4.54 Rev. 1 121009 JL
Chapter "Related Software"
* Section "TCP/IP Server", subsection "Tunneling
Mode" added.
V4.54 Rev. 0 120913 EL
Chapter "Flash Breakpoints"
* Section "Licensing" updated.
Chapter "Device specifics"
* Section "Freescale", subsection "Data flash
support" added.
V4.53c Rev. 0 120904 EL Chapter "Licensing"
* Section "Device-based license" updated.
V4.51h Rev. 0 120717 EL
Chapter "Flash download"
* Section "J-Link commander" updated.
Chapter "Support and FAQs"
* Section "Frequently asked questions" updated.
Chapter "J-Link and J-Trace related software"
* Section "J-Link Commander" updated.
V4.51e Rev. 1 120704 EL
Chapter "Working with J-Link"
* Section "Reset strategies" updated and
corrected. Added reset type 8.
V4.51e Rev. 0 120704 AG Chapter "Device specifics"
* Section "ST" updated and corrected.
V4.51b Rev. 0 120611 EL Chapter "J-Link and J-Trace related software"
* Section "SWO Viewer" added.
V4.51a Rev. 0 120606 EL
Chapter "Device specifics"
* Section "ST", subsection "ETM init"
for some STM32 devices added..
* Section "Texas Instruments" updated.
Chapter "Target interfaces and adapters"
* Section "Pinout for SWD" updated.
V4.47a Rev. 0 120419 AG Chapter "Device specifics"
* Section "Texas Instruments" updated.
Revision Date By Explanation

8
J-Link / J-Trace (UM08001) © 2004-2017 SEGGER Microcontroller GmbH & Co. KG
V4.46 Rev. 0 120416 EL Chapter "Support" updated.
V4.42 Rev. 0 120214 EL Chapter "Working with J-Link"
* Section "J-Link script files" updated.
V4.36 Rev. 1 110927 EL
Chapter "Flash download" added.
Chapter "Flash breakpoints" added.
Chapter "Target interfaces and adapters"
* Section "20-pin JTAG/SWD connector" updated.
Chapter "RDI" added.
Chapter "Setup" updated.
Chapter "Device specifics" updated.
V4.36 Rev. 0 110909 AG Chapter "Working with J-Link"
* Section "J-Link script files" updated.
V4.26 Rev. 1 110513 KN Chapter "Introduction"
* Section "J-Link / J-Trace models" corrected.
V4.26 Rev. 0 110427 KN Several corrections.
V4.24 Rev. 1 110228 AG
Chapter "Introduction"
* Section "J-Link / J-Trace models" corrected.
Chapter "Device specifics"
* Section "ST Microelectronics" updated.
V4.24 Rev. 0 110216 AG
Chapter "Device specifics"
* Section "Samsung" added.
Chapter "Working with J-Link"
* Section "Reset strategies" updated.
Chapter "Target interfaces and adapters"
* Section "9-pin JTAG/SWD connector" added.
V4.23d 110202 AG
Chapter "J-Link and J-Trace related software"
* Section "J-Link software and documentation
package in detail" updated.
Chapter "Introduction"
* Section "Built-in intelligence for
supported CPU-cores" added.
V4.21g 101130 AG
Chapter "Working with J-Link"
* Section "Reset strategies" updated.
Chapter "Device specifics"
* Section "Freescale" updated.
Chapter "Flash download and flash breakpoints
* Section "Supported devices" updated
* Section "Setup for different debuggers
(CFI flash)" updated.
V4.21 101025 AG Chapter "Device specifics"
* Section "Freescale" updated.
V4.20j 101019 AG Chapter "Working with J-Link"
* Section "Reset strategies" updated.
V4.20b 100923 AG Chapter "Working with J-Link"
* Section "Reset strategies" updated.
90 100818 AG
Chapter "Working with J-Link"
* Section "J-Link script files" updated.
* Section "Command strings" upadted.
Chapter "Target interfaces and adapters"
* Section "19-pin JTAG/SWD and Trace
connector" corrected.
Chapter "Setup"
* Section "J-Link configurator added."
89 100630 AG Several corrections.
88 100622 AG Chapter "J-Link and J-Trace related software"
* Section "SWO Analyzer" added.
87 100617 AG Several corrections.
Revision Date By Explanation

J-Link / J-Trace (UM08001) © 2004-2017 SEGGER Microcontroller GmbH & Co. KG
9
86 100504 AG
Chapter "Introduction"
* Section "J-Link / J-Trace models" updated.
Chapter "Target interfaces and adapters"
* Section "Adapters" updated.
85 100428 AG Chapter "Introduction"
* Section "J-Link / J-Trace models" updated.
84 100324 KN
Chapter "Working with J-Link and J-Trace"
* Several corrections
Chapter Flash download & flash breakpoints
* Section "Supported devices" updated
83 100223 KN Chapter "Introduction"
* Section "J-Link / J-Trace models" updated.
82 100215 AG Chapter "Working with J-Link"
* Section "J-Link script files" added.
81 100202 KN
Chapter "Device Specifics"
* Section "Luminary Micro" updated.
Chapter "Flash download and flash breakpoints"
* Section "Supported devices" updated.
80 100104 KN Chapter "Flash download and flash breakpoints
* Section "Supported devices" updated
79 091201 AG
Chapter "Working with J-Link and J-Trace"
* Section "Reset strategies" updated.
Chapter "Licensing"
* Section "J-Link OEM versions" updated.
78 091023 AG Chapter "Licensing"
* Section "J-Link OEM versions" updated.
77 090910 AG Chapter "Introduction"
* Section "J-Link / J-Trace models" updated.
76 090828 KN
Chapter "Introduction"
* Section" Specifications" updated
* Section "Hardware versions" updated
* Section "Common features of the J-Link product
family" updated
Chapter "Target interfaces and adapters"
* Section "5 Volt adapter" updated
75 090729 AG
Chapter "Introduction"
* Section "J-Link / J-Trace models" updated.
Chapter "Working with J-Link and J-Trace"
* Section "SWD interface" updated.
74 090722 KN
Chapter "Introduction"
* Section "Supported IDEs" added
* Section "Supported CPU cores" updated
* Section "Model comparison chart" renamed to
"Model comparison"
* Section "J-Link bundle comparison chart"
removed
73 090701 KN
Chapter "Introduction"
* Section "J-Link and J-Trace models" added
* Sections "Model comparison chart" &
"J-Link bundle comparison chart"added
Chapter "J-Link and J-Trace models" removed
Chapter "Hardware" renamed to
"Target interfaces & adapters"
* Section "JTAG Isolator" added
Chapter "Target interfaces and adapters"
* Section "Target board design" updated
Several corrections
Revision Date By Explanation

10
J-Link / J-Trace (UM08001) © 2004-2017 SEGGER Microcontroller GmbH & Co. KG
72 090618 AG
Chapter "Working with J-Link"
* Section "J-Link control panel" updated.
Chapter "Flash download and flash breakpoints"
* Section "Supported devices" updated.
Chapter "Device specifics"
* Section "NXP" updated.
71 090616 AG Chapter "Device specifics"
* Section "NXP" updated.
70 090605 AG
Chapter "Introduction"
* Section "Common features of the J-Link
product family" updated.
69 090515 AG
Chapter "Working with J-Link"
* Section "Reset strategies" updated.
* Section "Indicators" updated.
Chapter "Flash download and flash breakpoints"
* Section "Supported devices" updated.
68 090428 AG
Chapter "J-Link and J-Trace related software"
* Section "J-Link STM32 Commander" added.
Chapter "Working with J-Link"
* Section "Reset strategies" updated.
67 090402 AG Chapter "Working with J-Link"
* Section "Reset strategies" updated.
66 090327 AG
Chapter "Background information"
* Section "Embedded Trace Macrocell (ETM)"
updated.
Chapter "J-Link and J-Trace related software"
* Section "Dedicated flash programming
utilities for J-Link" updated.
65 090320 AG Several changes in the manual structure.
64 090313 AG Chapter "Working with J-Link"
* Section "Indicators" added.
63 090212 AG
Chapter "Hardware"
* Several corrections.
* Section "Hardware Versions" Version 8.0 added.
62 090211 AG
Chapter "Working with J-Link and J-Trace"
* Section "Reset strategies" updated.
Chapter J-Link and J-Trace related software
* Section "J-Link STR91x Commander
(Command line tool)" updated.
Chapter "Device specifics"
* Section "ST Microelectronics" updated.
Chapter "Hardware" updated.
61 090120 TQ Chapter "Working with J-Link"
* Section "Cortex-M3 specific reset strategies"
60 090114 AG Chapter "Working with J-Link"
* Section "Cortex-M3 specific reset strategies"
59 090108 KN
Chapter Hardware
* Section "Target board design for JTAG"
updated.
* Section "Target board design for SWD" added.
58 090105 AG
Chapter "Working with J-Link Pro"
* Section "Connecting J-Link Pro the first time"
updated.
Revision Date By Explanation

J-Link / J-Trace (UM08001) © 2004-2017 SEGGER Microcontroller GmbH & Co. KG
11
57 081222 AG
Chapter "Working with J-Link Pro"
* Section "Introduction" updated.
* Section "Configuring J-Link Pro
via web interface" updated.
Chapter "Introduction"
* Section "J-Link Pro overview" updated.
56 081219 AG
Chapter "Working with J-Link Pro"
* Section "FAQs" added.
Chapter "Support and FAQs"
* Section "Frequently Asked Questions" updated.
55 081218 AG Chapter "Hardware" updated.
54 081217 AG Chapter "Working with J-Link and J-Trace"
* Section "Command strings" updated.
53 081216 AG Chapter "Working with J-Link Pro" updated.
52 081212 AG
Chapter "Working with J-Link Pro" added.
Chapter "Licensing"
* Section "Original SEGGER products" updated.
51 081202 KN Several corrections.
50 081030 AG Chapter "Flash download and flash breakpoints"
* Section "Supported devices" corrected.
49 081029 AG Several corrections.
48 080916 AG
Chapter "Working with J-Link and J-Trace"
* Section "Connecting multiple J-Links /
J-Traces to your PC" updated.
47 080910 AG Chapter "Licensing" updated.
46 080904 AG
Chapter "Licensing" added.
Chapter "Hardware"
Section "J-Link OEM versions" moved to chapter
"Licensing"
45 080902 AG
Chapter "Hardware"
Section "JTAG+Trace connector" JTAG+Trace
connector pinout corrected.
Section "J-Link OEM versions" updated.
44 080827 AG
Chapter "J-Link control panel" moved to chapter
"Working with J-Link".
Several corrections.
43 080826 AG Chapter "Flash download and flash breakpoints"
Section "Supported devices" updated.
42 080820 AG Chapter "Flash download and flash breakpoints"
Section "Supported devices" updated.
41 080811 AG
Chapter "Flash download and flash breakpoints"
updated.
Chapter "Flash download and flash breakpoints",
section "Supported devices" updated.
40 080630 AG
Chapter "Flash download and flash breakpoints"
updated.
Chapter "J-Link status window" renamed to "J-Link
control panel"
Various corrections.
39 080627 AG
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.
Revision Date By Explanation

12
J-Link / J-Trace (UM08001) © 2004-2017 SEGGER Microcontroller GmbH & Co. KG
38 080618 AG
Chapter "Support and FAQs"
Section "Frequently Asked Questions" updated
Chapter "Reset strategies"
Section "Cortex-M3 specific reset strategies"
updated.
37 080617 AG
Chapter "Reset strategies"
Section "Cortex-M3 specific reset strategies"
updated.
36 080530 AG
Chapter "Hardware"
Section "Differences between different versions"
updated.
Chapter "Working with J-Link and J-Trace"
Section "Cortex-M3 specific reset strategies"
added.
35 080215 AG
Chapter "J-Link and J-Trace related software"
Section "J-Link software and documentation
package in detail" updated.
34 080212 AG
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 "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.
33 080207 AG
Chapter "Flash download and flash breakpoints"
added
Chapter "Device specifics:"
Section "ATMEL - AT91SAM7 - Recommended init
sequence" added.
32 0080129 SK
Chapter "Device specifics":
Section "NXP - LPC - Fast GPIO bug" list of
device enhanced.
31 0080103 SK Chapter "Device specifics":
Section "NXP - LPC - Fast GPIO bug" updated.
30 071211 AG
Chapter "Device specifics":
Section "Analog Devices" updated.
Section "ATMEL" updated.
Section "Freescale" added.
Section "Luminary Micro" added.
Section "NXP" updated.
Section "OKI" added.
Section "ST Microelectronics" updated.
Section "Texas Instruments" updated.
Chapter "Related software":
Section "J-Link STR91x Commander" updated
29 070912 SK Chapter "Hardware", section "Target board design"
updated.
28 070912 SK
Chapter "Related software":
Section "J-LinkSTR91x Commander" added.
Chapter "Device specifics":
Section "ST Microelectronics" added.
Section "Texas Instruments" added.
Subsection "AT91SAM9" added.
Revision Date By Explanation

J-Link / J-Trace (UM08001) © 2004-2017 SEGGER Microcontroller GmbH & Co. KG
13
28 070912 AG Chapter "Working with J-Link/J-Trace":
Section "Command strings" updated.
27 070827 TQ Chapter "Working with J-Link/J-Trace":
Section "Command strings" updated.
26 070710 SK
Chapter "Introduction":
Section "Features of J-Link" updated.
Chapter "Background Information":
Section "Embedded Trace Macrocell" added.
Section "Embedded Trace Buffer" added.
25 070516 SK
Chapter "Working with J-Link/J-Trace":
Section "Reset strategies in detail"
- "Software, for Analog Devices ADuC7xxx
MCUs" updated
- "Software, for ATMEL AT91SAM7 MCUs"
added.
Chapter "Device specifics"
Section "Analog Devices" added.
Section "ATMEL" added.
24 070323 SK
Chapter "Setup":
"Uninstalling the J-Link driver" updated.
"Supported ARM cores" updated.
23 070320 SK Chapter "Hardware":
"Using the JTAG connector with SWD" updated.
22 070316 SK Chapter "Hardware":
"Using the JTAG connector with SWD" added.
21 070312 SK
Chapter "Hardware":
"Differences between different versions"
supplemented.
20 070307 SK Chapter "J-Link / J-Trace related software":
"J-Link GDB Server" licensing updated.
19 070226 SK
Chapter "J-Link / J-Trace related software" updated
and reorganized.
Chapter "Hardware"
"List of OEM products" updated
18 070221 SK Chapter "Device specifics" added
Subchapter "Command strings" added
17 070131 SK
Chapter "Hardware":
"Version 5.3": Current limits added
"Version 5.4" added
Chapter "Setup":
"Installating the J-Link USB driver" removed.
"Installing the J-Link software and documentation
pack" added.
Subchapter "List of OEM products" updated.
"OS support" updated
16 061222 SK Chapter "Preface": "Company description" added.
J-Link picture changed.
15 060914 OO
Subchapter 1.5.1: Added target supply voltage and
target supply current to specifications.
Subchapter 5.2.1: Pictures of ways to connect J-
Trace.
14 060818 TQ Subchapter 4.7 "Using DCC for memory reads"
added.
13 060711 OO Subchapter 5.2.2: Corrected JTAG+Trace connec-
tor pinout table.
12 060628 OO Subchapter 4.1: Added ARM966E-S to List of sup-
ported ARM cores.
Revision Date By Explanation

14
J-Link / J-Trace (UM08001) © 2004-2017 SEGGER Microcontroller GmbH & Co. KG
11 060607 SK Subchapter 5.5.2.2 changed.
Subchapter 5.5.2.3 added.
10 060526 SK
ARM9 download speed updated.
Subchapter 8.2.1: Screenshot "Start sequence"
updated.
Subchapter 8.2.2 "ID sequence" removed.
Chapter "Support" and "FAQ" merged.
Various improvements
9 060324 OO
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.
8 060117 OO Chapter "Related Software": Added JLinkARM.dll.
Screenshots updated.
7 051208 OO Chapter Working with J-Link: Sketch added.
6 051118 OO
Chapter Working with J-Link: "Connecting multiple
J-Links to your PC" added.
Chapter Working with J-Link: "Multi core debug-
ging" added.
Chapter Background information: "J-Link firm-
ware" added.
5 051103 TQ Chapter Setup: "JTAG Speed" added.
4 051025 OO
Chapter Background information: "Flash program-
ming" added.
Chapter Setup: "Scan chain configuration" added.
Some smaller changes.
3 051021 TQ Performance values updated.
2 051011 TQ Chapter "Working with J-Link" added.
1 050818 TW Initial version.
Revision Date By Explanation

J-Link / J-Trace (UM08001) © 2004-2017 SEGGER Microcontroller GmbH & Co. KG
15
About this document
Assumptions
This document assumes that you already have a solid knowledge of the following:
• The software tools used for building your application (assembler, linker, C com-
piler)
• 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 Program-
ming Language 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 program-
ming is not required.
Typographic conventions for syntax
This manual uses the following typographic conventions:
Style Used for
Body Body text.
Keyword Text that you enter at the command-prompt or that appears on
the display (that is system functions, file- or pathnames).
Parameter Parameters in API functions.
Sample Sample code in program examples.
Sample comment Comments in programm examples.
Reference Reference to chapters, sections, tables and figures or other docu-
ments.
GUIElement Buttons, dialog boxes, menu names, menu commands.
Emphasis Very important sections.
Table 1.1: Typographic conventions

16 CHAPTER
J-Link / J-Trace (UM08001) © 2004-2017 SEGGER Microcontroller GmbH & Co. KG
EMBEDDED SOFTWARE
(Middleware)
emWin
Graphics software and GUI
emWin is designed to provide an effi-
cient, processor- and display control-
ler-independent graphical user
interface (GUI) for any application that
operates with a graphical display.
embOS
Real Time Operating System
embOS is an RTOS designed to offer
the benefits of a complete multitasking
system for hard real time applications
with minimal resources.
embOS/IP
TCP/IP stack
embOS/IP a high-performance TCP/IP
stack that has been optimized for
speed, versatility and a small memory
footprint.
emFile
File system
emFile is an embedded file system with
FAT12, FAT16 and FAT32 support. Var-
ious Device drivers, e.g. for NAND and
NOR flashes, SD/MMC and Compact-
Flash cards, are available.
USB-Stack
USB device/host stack
A USB stack designed to work on any
embedded system with a USB control-
ler. Bulk communication and most stan-
dard device classes are supported.
SEGGER TOOLS
Flasher
Flash programmer
Flash Programming tool primarily for micro con-
trollers.
J-Link
JTAG emulator for ARM cores
USB driven JTAG interface for ARM cores.
J-Trace
JTAG emulator with trace
USB driven JTAG interface for ARM cores with
Trace memory. supporting the ARM ETM (Embed-
ded Trace Macrocell).
J-Link / J-Trace Related Software
Add-on software to be used with SEGGER’s indus-
try standard JTAG emulator, this includes flash
programming software and flash breakpoints.
Table 1.1:
SEGGER Microcontroller GmbH & Co. KG develops
and distributes software development tools and ANSI C
software components (middleware) for embedded sys-
tems in several industries such as telecom, medical
technology, consumer electronics, automotive industry
and industrial automation.
SEGGER’s intention is to cut software development time
for embedded applications by offering compact flexible and easy to use middleware,
allowing developers to concentrate on their application.
Our most popular products are emWin, a universal graphic software package for embed-
ded applications, and embOS, a small yet efficient real-time kernel. emWin, written
entirely in ANSI C, can easily be used on any CPU and most any display. It is comple-
mented by the available PC tools: Bitmap Converter, Font Converter, Simulator and
Viewer. embOS supports most 8/16/32-bit CPUs. Its small memory footprint makes it
suitable for single-chip applications.
Apart from its main focus on software tools, SEGGER develops and produces programming
tools for flash micro controllers, as well as J-Link, a JTAG emulator to assist in develop-
ment, debugging and production, which has rapidly become the industry standard for
debug access to ARM cores.
Corporate Office:
http://www.segger.com
United States Office:
http://www.segger-us.com

J-Link / J-Trace (UM08001) © 2004-2017 SEGGER Microcontroller GmbH & Co. KG
17
1 Introduction....................................................................................................................27
1.1 Requirements..........................................................................................28
1.2 Supported OS ......................................................................................... 29
1.3 J-Link / J-Trace models ............................................................................30
1.3.1 Model comparison....................................................................................31
1.3.2 J-Link BASE ............................................................................................32
1.3.3 J-Link PLUS ............................................................................................34
1.3.4 J-Link ULTRA+ ........................................................................................37
1.3.5 J-Link PRO.............................................................................................. 39
1.3.6 J-Link Lite ARM ....................................................................................... 39
1.3.7 J-Link Lite CortexM .................................................................................. 41
1.3.8 J-Trace ARM ........................................................................................... 42
1.3.9 J-Trace for Cortex-M ................................................................................ 43
1.3.10 Flasher ARM............................................................................................45
1.4 Common features of the J-Link product family .............................................47
1.5 Supported CPU cores ............................................................................... 48
1.6 Built-in intelligence for supported CPU-cores ...............................................49
1.6.1 Intelligence in the J-Link firmware ............................................................. 49
1.6.2 Intelligence on the PC-side (DLL) ...............................................................49
1.6.3 Firmware intelligence per model ................................................................51
1.7 Supported IDEs ....................................................................................... 53
2 Licensing........................................................................................................................55
2.1 ................................................................. Components requiring a license56
2.2 License types ..........................................................................................57
2.2.1 Built-in license ........................................................................................57
2.2.2 Key-based license....................................................................................57
2.3 Legal use of SEGGER J-Link software.......................................................... 58
2.3.1 Use of the software with 3rd party tools......................................................58
2.4 Original SEGGER products......................................................................... 59
2.4.1 J-Link BASE ............................................................................................59
2.4.2 J-Link PLUS ............................................................................................59
2.4.3 J-link ULTRA+ .........................................................................................60
2.4.4 J-Link PRO.............................................................................................. 60
2.4.5 J-Trace for Cortex-M ................................................................................ 61
2.4.6 Flasher ARM............................................................................................62
2.4.7 Flasher RX .............................................................................................. 62
2.4.8 Flasher PPC ............................................................................................63
2.5 J-Link OEM versions ................................................................................. 64
2.5.1 Analog Devices: mIDASLink ......................................................................64
2.5.2 Atmel: SAM-ICE ...................................................................................... 64
2.5.3 Digi: JTAG Link........................................................................................65
2.5.4 IAR: J-Link / J-Link KS .............................................................................65
2.5.5 IAR: J-Link Lite .......................................................................................65
2.5.6 IAR: J-Trace ...........................................................................................66
2.5.7 NXP: J-Link Lite LPC Edition ......................................................................66
2.5.8 SEGGER: J-Link Lite ARM..........................................................................66
2.6 J-Link OBs ..............................................................................................67
2.7 Illegal Clones ..........................................................................................68
3 J-Link software and documentation package.................................................................69
Table of Contents

18
J-Link / J-Trace (UM08001) © 2004-2017 SEGGER Microcontroller GmbH & Co. KG
3.1 Software overview................................................................................... 70
3.2 J-Link Commander (Command line tool)..................................................... 71
3.2.1 Commands............................................................................................. 72
3.2.2 Command line options ............................................................................. 88
3.2.3 Using command files................................................................................ 91
3.3 J-Link GDB Server ................................................................................... 92
3.3.1 J-Link GDB Server CL (Windows, Linux, Mac) .............................................. 92
3.3.2 Debugging with J-Link GDB Server ............................................................ 93
3.3.3 Supported remote (monitor) commands ..................................................... 98
3.3.4 SEGGER-specific GDB protocol extensions .................................................110
3.3.5 Command line options ............................................................................115
3.3.6 Program termination...............................................................................126
3.3.7 Semihosting ..........................................................................................127
3.4 J-Link Remote Server .............................................................................128
3.4.1 List of available commands......................................................................128
3.4.2 Tunneling mode .....................................................................................129
3.5 J-Mem Memory Viewer............................................................................132
3.6 J-Flash..................................................................................................133
3.7 J-Link RTT Viewer...................................................................................134
3.7.1 RTT Viewer Startup ................................................................................134
3.7.2 Connection Settings................................................................................135
3.7.3 The Terminal Tabs..................................................................................135
3.7.4 Sending Input........................................................................................136
3.7.5 Logging Terminal output .........................................................................136
3.7.6 Logging Data .........................................................................................137
3.7.7 Command line options ............................................................................137
3.7.8 Menus and Shortcuts ..............................................................................139
3.7.9 Using "virtual" Terminals in RTT ...............................................................141
3.7.10 Using Text Control Codes ........................................................................141
3.8 J-Link SWO Viewer .................................................................................142
3.8.1 Usage...................................................................................................143
3.8.2 List of available command line options ......................................................143
3.8.3 Configure SWO output after device reset ...................................................145
3.8.4 Target example code for terminal output ...................................................145
3.9 SWO Analyzer........................................................................................148
3.10 JTAGLoad (Command line tool) ................................................................149
3.11 J-Link RDI (Remote Debug Interface)........................................................150
3.11.1 Flash download and flash breakpoints .......................................................150
3.12 Processor specific tools ...........................................................................151
3.12.1 J-Link STR91x Commander (Command line tool) ........................................151
3.12.2 J-Link STM32 Unlock (Command line tool) .................................................152
3.13 J-Link Software Developer Kit (SDK).........................................................155
4 Setup............................................................................................................................157
4.1 Installing the J-Link software and documentation pack ................................158
4.1.1 Setup procedure ....................................................................................158
4.2 Setting up the USB interface....................................................................161
4.2.1 Verifying correct driver installation ...........................................................161
4.2.2 Uninstalling the J-Link USB driver.............................................................162
4.3 Setting up the IP interface.......................................................................164
4.3.1 Configuring J-Link using J-Link Configurator...............................................164
4.3.2 Configuring J-Link using the webinterface..................................................164
4.4 FAQs ....................................................................................................166
4.5 J-Link Configurator .................................................................................167
4.5.1 Configure J-Links using the J-Link Configurator ..........................................167
4.6 J-Link USB identification..........................................................................169
4.6.1 Connecting to different J-Links connected to the same host PC via USB .........169
4.7 Using the J-Link DLL ...............................................................................171
4.7.1 What is the JLink DLL? ............................................................................171
4.7.2 Updating the DLL in third-party programs..................................................171
4.7.3 Determining the version of JLink DLL ........................................................172

J-Link / J-Trace (UM08001) © 2004-2017 SEGGER Microcontroller GmbH & Co. KG
19
4.7.4 Determining which DLL is used by a program ............................................ 172
4.8 Getting started with J-Link and ARM DS-5................................................. 173
4.8.1 Replacing the RDDI DLL manually ............................................................ 173
4.8.2 Using J-Link in DS-5 Development Studio ................................................. 173
5 Working with J-Link and J-Trace..................................................................................175
5.1 Connecting the target system.................................................................. 176
5.1.1 Power-on sequence................................................................................ 176
5.1.2 Verifying target device connection ........................................................... 176
5.1.3 Problems .............................................................................................. 176
5.2 Indicators............................................................................................. 177
5.2.1 Main indicator ....................................................................................... 177
5.2.2 Input indicator ...................................................................................... 179
5.2.3 Output indicator .................................................................................... 179
5.3 JTAG interface....................................................................................... 180
5.3.1 Multiple devices in the scan chain ............................................................ 180
5.3.2 Sample configuration dialog boxes ........................................................... 180
5.3.3 Determining values for scan chain configuration......................................... 183
5.3.4 JTAG Speed .......................................................................................... 184
5.4 SWD interface ....................................................................................... 185
5.4.1 SWD speed........................................................................................... 185
5.4.2 SWO .................................................................................................... 185
5.5 Multi-core debugging ............................................................................. 187
5.5.1 How multi-core debugging works ............................................................. 187
5.5.2 Using multi-core debugging in detail ........................................................ 188
5.5.3 Things you should be aware of ................................................................ 189
5.6 Connecting multiple J-Links / J-Traces to your PC ...................................... 191
5.6.1 How does it work? ................................................................................. 191
5.7 J-Link control panel................................................................................ 193
5.7.1 Tabs .................................................................................................... 193
5.8 Reset strategies .................................................................................... 199
5.8.1 Strategies for ARM 7/9 devices................................................................ 199
5.8.2 Strategies for Cortex-M devices ............................................................... 201
5.9 Using DCC for memory access ................................................................. 204
5.9.1 What is required? .................................................................................. 204
5.9.2 Target DCC handler ............................................................................... 204
5.9.3 Target DCC abort handler ....................................................................... 204
5.10 The J-Link settings file............................................................................ 205
5.10.1 SEGGER Embedded Studio...................................................................... 205
5.10.2 Keil MDK-ARM (uVision).......................................................................... 205
5.10.3 IAR EWARM .......................................................................................... 205
5.10.4 Mentor Sourcery CodeBench for ARM........................................................ 205
5.11 J-Link script files ................................................................................... 206
5.11.1 Actions that can be customized ............................................................... 206
5.11.2 Script file API functions .......................................................................... 208
5.11.3 Global DLL variables .............................................................................. 213
5.11.4 Global DLL constants.............................................................................. 217
5.11.5 Script file language ................................................................................ 219
5.11.6 Script file writing example ...................................................................... 220
5.11.7 Executing J-Link script files ..................................................................... 220
5.12 Command strings .................................................................................. 223
5.12.1 List of available commands ..................................................................... 223
5.12.2 Using command strings .......................................................................... 241
5.13 Switching off CPU clock during debug ....................................................... 243
5.14 Cache handling...................................................................................... 244
5.14.1 Cache coherency ................................................................................... 244
5.14.2 Cache clean area ................................................................................... 244
5.14.3 Cache handling of ARM7 cores................................................................. 244
5.14.4 Cache handling of ARM9 cores................................................................. 244
5.15 Virtual COM Port (VCOM) ........................................................................ 245
5.15.1 Configuring Virtual COM Port ................................................................... 245

20
J-Link / J-Trace (UM08001) © 2004-2017 SEGGER Microcontroller GmbH & Co. KG
6 Flash download............................................................................................................247
6.1 Introduction ..........................................................................................248
6.2 Licensing...............................................................................................249
6.3 Supported devices..................................................................................250
6.4 Setup for various debuggers (internal flash) ..............................................251
6.4.1 IAR Embedded Workbench ......................................................................251
6.4.2 Keil MDK ...............................................................................................251
6.4.3 Mentor Sourcery CodeBench ....................................................................254
6.4.4 J-Link GDB Server ..................................................................................254
6.4.5 J-Link Commander .................................................................................255
6.4.6 J-Link RDI .............................................................................................256
6.5 Setup for various debuggers (CFI flash) ....................................................257
6.5.1 IAR Embedded Workbench / Keil MDK .......................................................257
6.5.2 J-Link GDB Server ..................................................................................258
6.5.3 J-Link commander..................................................................................258
6.6 Setup for various debuggers (SPIFI flash)..................................................259
6.7 QSPI flash support .................................................................................260
6.7.1 Setup the DLL for QSPI flash download .....................................................260
6.8 Using the DLL flash loaders in custom applications......................................261
6.9 Debugging applications that change flash contents at runtime ......................262
7 Flash breakpoints.........................................................................................................263
7.1 Introduction ..........................................................................................264
7.2 Licensing...............................................................................................265
7.2.1 Free for evaluation and non-commercial use ..............................................265
7.3 Supported devices..................................................................................266
7.4 Setup & compatibility with various debuggers ............................................267
7.4.1 Setup ...................................................................................................267
7.4.2 Compatibility with various debuggers ........................................................267
7.5 Flash Breakpoints in QSPI flash ................................................................268
7.5.1 Setup ...................................................................................................268
7.6 FAQ......................................................................................................269
8 Monitor Mode Debugging.............................................................................................271
8.1 Introduction ..........................................................................................272
8.2 Enable Monitor Debugging.......................................................................273
8.2.1 GDB based debug solutions .....................................................................273
8.2.2 IAR EWARM...........................................................................................273
8.2.3 Keil MDK-ARM (uVision) ..........................................................................274
8.2.4 J-Link Commander .................................................................................274
8.2.5 Generic way of enabling ..........................................................................274
8.3 Availability and limitations of monitor mode ...............................................275
8.3.1 Cortex-M3.............................................................................................275
8.3.2 Cortex-M4.............................................................................................275
8.4 Monitor code .........................................................................................276
8.5 Debugging interrupts ..............................................................................277
8.6 Having servicing interrupts in debug mode ................................................278
8.7 Forwarding of Monitor Interrupts ..............................................................279
8.8 Target application performs reset (Cortex-M) .............................................280
9 Low Power Debugging.................................................................................................281
9.1 Introduction ..........................................................................................282
9.2 Activating low power mode handling for J-Link ...........................................283
9.2.1 SEGGER Embedded Studio ......................................................................283
9.2.2 Keil MDK-ARM........................................................................................283
9.2.3 IAR EWARM...........................................................................................283
9.2.4 Mentor Sourcery CodeBench for ARM ........................................................283
9.2.5 GDB + GDBServer based setups (Eclipse etc.)............................................283
9.3 Restrictions ...........................................................................................284
Other manuals for J-Link
8
This manual suits for next models
1
Table of contents
Other Segger Adapter manuals