Page 1
J-Link / J-Trace User Guide Software Version V6.14 Manual Rev. 0 Date: February 23, 2017 Document: UM08001 A product of SEGGER Microcontroller GmbH & Co. KG www.segger.com...
Page 2
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.
Page 3
160519 Chapter "Adding Support for New Devices" added. Chapter "Related Software" V5.12f Rev. 0 160503 * Section "J-Link RTT Viewer" updated and moved from section "RTT". Chapter "Working with J-Link and J-Trace" V5.12d Rev. 1 160427 * Section "J-Link script files" updated.
Page 4
V5.10 Rev. 0 151127 * Section "J-Scope" removed. Chapter "Working with J-Link and J-Trace" V5.02m Rev. 0 151125 * Section "The J-Link settings file" added. Chapter "Low Power Debugging" added. Various Chapters V5.02l Rev. 0 151123 * Some typos corrected.
Page 6
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 "Related Software" V4.82 Rev. 0 140218 * Section "GDB Server"...
Page 16
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.
J-Trace ARM ................... 42 1.3.9 J-Trace for Cortex-M ................43 1.3.10 Flasher ARM.................... 45 Common features of the J-Link product family ..........47 Supported CPU cores ................48 Built-in intelligence for supported CPU-cores ..........49 1.6.1 Intelligence in the J-Link firmware ............. 49 1.6.2...
Page 18
Command line options ................88 3.2.3 Using command files................91 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...
Page 19
4.7.4 Determining which DLL is used by a program ..........172 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 Connecting the target system..............
Page 20
Having servicing interrupts in debug mode ..........278 Forwarding of Monitor Interrupts ..............279 Target application performs reset (Cortex-M) ..........280 9 Low Power Debugging....................281 Introduction ..................282 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...
Page 24
J-Trace integration example - IAR Embedded Workbench for ARM....439 17.3 Embedded Trace Buffer (ETB) ..............443 17.4 Flash programming ................444 17.4.1 How does flash programming via J-Link / J-Trace work? ......444 17.4.2 Data download to RAM ................444 17.4.3 Data download via DCC................444 17.4.4 Available options for flash programming ............444...
Introduction Requirements Host System 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 29. Target System A target system with a supported CPU is required.
Supported OS J-Link/J-Trace can be used on the following operating systems: • Microsoft Windows 2000 • Microsoft Windows XP • Microsoft Windows XP x64 • Microsoft Windows Vista • Microsoft Windows Vista x64 • Windows 7 • Windows 7 x64 •...
J-Links / J-Traces have the hardware version printed on the back label. If this is not the case with your J-Link / J-Trace, start JLink.exe. As part of the initial message, the hardware version is displayed.
A9/R4 JTAG ETM Trace Software features Software features are features implemented in the software running on the host. Software features can either come with the J-Link or be added later using a license string from Segger. J-Trace J-Link J-Link J-Link...
Introduction 1.3.2 J-Link BASE J-Link BASE is a JTAG emulator designed for ARM cores. It con- nects via USB to a PC running Microsoft Windows 2000 or later. For a complete list of all operating systems which are sup- ported, please refer to Supported OS on page 29. J-Link BASE has a built-in 20-pin JTAG connector, which is compatible with the standard 20-pin connector defined by ARM.
Page 33
5V target supply (pin 19) of Kick-Start versions of J-Link is current monitored and limited. J-Link automatically switches off 5V supply in case of over-current to protect both J-Link and host computer. Peak current (<= 10 ms) limit is 1A, operating current limit is 300mA.
• Pin 1 (VTref) is used for measuring target reference voltage only. Buffers on J- Link side are no longer powered through this pin but via the J-Link internal volt- age supplied via USB. 1.3.2.4 Software and Hardware Features Overview...
Page 36
• Pin 1 (VTref) is used for measuring target reference voltage only. Buffers on J- Link side are no longer powered through this pin but via the J-Link internal volt- age supplied via USB. 1.3.3.4 Software and Hardware Features Overview...
CPU core etc. 1.3.4.2 Specifications The following table gives an overview about the specifications (general, mechanical, electrical) for J-link ULTRA+. All values are valid for J-link ULTRA hardware version 1. Note: Some specifications, especially speed, are likely to be improved in the future with newer versions of the J-Link software (freely available).
Page 38
Identical to version 4 with the following exception: Pin 1 (VTref) is used for measuring target reference voltage only. Buffers on J-Link side are no longer powered through this pin but via the J-Link internal voltage sup- plied via USB.
• Pin 1 (VTref) is used for measuring target reference voltage only. Buffers on J- Link side are no longer powered through this pin but via the J-Link internal volt- age supplied via USB. 1.3.5.3 Software and Hardware Features Overview...
Page 40
Standard 20-pin 0.1 inch JTAG connector (compatible to J-Link) 1.3.6.2 Specifications The following table gives an overview about the specifications (general, mechanical, electrical) for J-Link Lite ARM. All values are valid for J-Link hardware version 8. General For a complete list of all operating sys-...
1.3.7 J-Link Lite CortexM J-Link Lite CortexM is a specific OEM-version of SEGGER J-Link Lite which is designed to be used with Cortex-M devices. If you are selling evaluation-boards, J-Link Lite CortexM is an inex- pensive emulator solution for you. Your customer receives a widely acknowledged JTAG/SWD-emulator which allows to start right away with development.
CHAPTER 1 Introduction 1.3.7.2 Software and Hardware Features Overview For detailed information about hardware and software features of your J-Link/J-Trace model and version see: https://wiki.segger.com/Software_and_Hardware_Features_Overview 1.3.8 J-Trace ARM The J-Trace ARM model is an older J-Trace model that has been discontinued. It is referenced here for completeness.
J-Trace for Cortex-M is a JTAG/SWD emulator designed for Cor- tex-M cores which includes trace (ETM) support. J-Trace for Cortex-M can also be used as a J-Link and it also supports ARM7/9 cores. Tracing on ARM7/9 targets is not supported.
Page 44
Voltage range for trace signals extended to 1.2 - 3.3 V • Higher download speed 1.3.9.5 Software and Hardware Features Overview For detailed information about hardware and software features of your J-Link/J-Trace model and version see: • https://wiki.segger.com/Software_and_Hardware_Features_Overview J-Link / J-Trace (UM08001)
J-Flash soft- ware or stand-alone. In addition to that Flasher ARM has all of the J-Link functionality. For more information about Flasher ARM, please refer to UM08007, Flasher ARM User’s Guide. 1.3.10.1 Specifications The following table gives an overview about the specifications (general, mechanical, electrical) for Flasher ARM.
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 •...
CHAPTER 1 Introduction Supported CPU cores J-Link / J-Trace has been tested with the following cores, but should work with any ARM7/9/11, Cortex-M0/M1/M3/M4 and Cortex-A5/A8/A9/R4 core. If you experience problems with a particular core, do not hesitate to contact Segger.
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.
Page 50
Instability, especially on slow targets Due to the fact that a lot of USB transactions would cause a very bad perfor- mance of J-Link, 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.
1.6.3 Firmware intelligence per model There are different models of J-Link / J-Trace which have built-in intelligence for dif- ferent CPU-cores. In the following, we will give you an overview about which model of J-Link / J-Trace has intelligence for which CPU-core.
Page 52
CHAPTER 1 Introduction 1.6.3.2 Older models The table below lists the firmware CPU support for older J-Link & J-Trace models which are not sold anymore. Cortex- Renesas Cortex-M J-Link / J-Trace RX600 model JTAG JTAG JTAG JTAG JTAG not sup- J-Link "...
J-Link / J-Trace can be used with different IDEs. Some IDEs support J-Link directly, for other ones additional software (such as J-Link RDI) is necessary in order to use J- Link. The following tables list which features of J-Link / J-Trace can be used with the different IDEs.
Page 56
CHAPTER 2 Licensing Components requiring a license The following programs/features require a full-featured J-Link (PLUS, ULTRA+, PRO, J-Trace) or an additional license for the J-Link base model: • J-Flash • J-Link RDI • J-Link Debugger • Flash breakpoints (FlashBP) J-Link / J-Trace (UM08001)
Link PLUS, J-Link ULTRA+ and J-Link Pro. Key-based license This type of license is used if you already have a J-Link, but order a license for a J- Link software component at a later time. In addition to that, the key-based license is used for trial licenses.
Use of software SEGGER J-Link software may only be used with original SEGGER products and autho- rized OEM products. The use of the licensed software to operate SEGGER product clones is prohibited and illegal.
Original SEGGER products All of the follwing SEGGER products are supported by the OSs stated in Chapter 1.2 Supported OS The following products are original SEGGER products for which the use of the J-Link software is allowed: 2.4.1 J-Link BASE J-Link BASE is a JTAG emulator designed for ARM cores.
J-link ULTRA+ is a JTAG/SWD emulator designed for ARM/Cor- tex and other supported CPUs. It is fully compatible to the stan- dard J-Link and works with the same PC software. Based on the highly optimized and proven J-Link, it offers even higher speed as well as target power measurement capabilities due to the faster CPU, built-in FPGA and High speed USB interface.
2.4.5 J-Trace for Cortex-M J-Trace for Cortex-M is a JTAG/SWD emulator designed for Cor- tex-M cores which include trace (ETM) support. J-Trace for Cor- tex-M can also be used as a regular J-Link. Included Licenses J-Link Flashloaders J-Link GDB Server...
Renesas RX core. Flasher RX is designed for programming flash targets with the J-Flash software or stand-alone. In addition to that Flasher RX has all of the J-Link RX functionality. Flasher RX connects via Ethernet, USB or via RS232 interface to a PC run- ning Microsoft Windows 2000 or later.
J-Flash soft- ware or stand-alone. In addition to that Flasher PPC has all of the J-Link functionality. Flasher PPC connects via USB or via RS232 interface to a PC running Microsoft Windows 2000 or later.
Licensing J-Link OEM versions There are several different OEM versions of J-Link on the market. The OEM versions look different, but use basically identical hardware. Some of these OEM versions are limited in speed, some can only be used with certain chips and some of these have certain add-on features enabled, which normally requires a license.
Limitations Digi JTAG Link works with Digi devices only. This limitation can NOT be lifted; if you would like to use J-Link with a device from an other manufacturer, you need to buy a separate J-Link. Licenses License for GDB Server is included. Other licenses can be added.
No licenses are included. All licenses can be added. Note J-Link Lite ARM is only delivered and supported as part of Starter Kits. It is not sold to end customers and not guaranteed to work with custom hardware. J-Link / J-Trace (UM08001)
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.
J-Link Commander (Command line tool) J-Link Commander (JLink.exe) is a tool that can be used for verifying proper instal- lation 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.
J-Link software and documentation package 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 descrip- tions of the commands can be found in the sections that follow.
Page 74
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.
Page 75
Command Example exec SupplyPower = 1 3.2.1.6 exit (qc, q) This command closes the target connection, the connection to the J-Link and exits J- Link Commander. Syntax 3.2.1.7 exitonerror (eoe) This command toggles whether J-Link Commander exits on error or not.
Page 77
Syntax halt 3.2.1.17 hwinfo 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 over- current happened. Syntax hwinfo J-Link / J-Trace (UM08001)
Page 78
CHAPTER 3 J-Link software and documentation package 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>] Parameter Meaning Valid values:...
Page 81
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.
Page 85
DeviceName Kinetis EFM32Gxxx Example unlock Kinetis 3.2.1.46 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. Syntax usb [<Port>] Parameter Meaning Valid values: 0..3...
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.
Page 89
(eoe) 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.
Page 90
-RTTTelnetPort <Port> Example JLink.exe -RTTTelnetPort 9100 3.2.2.12 -SettingsFile Select a J-Link settings file to be used for the target device. The settings file can con- tain all configurable options of the Settings tab in J-Link Control panel. Syntax -SettingsFile <PathToFile>...
3.2.3 Using 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 command file with J-Link script files (please refer to J-Link script files on page 206 for more information about J-Link script files).
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 commu- nicate via a TCP/IP connection, using the standard GDB remote protocol.
If the target device option (-device) is given, the configuration dialog will not pop 3.3.2.2 Setting up GDB Server CL version The command line version of GDB Server is part of the J-Link Software Package for all supported platforms. On Windows its name is JLinkGDBServerCL.exe, on Linux and Mac it is JLinkGDB- Server.
Page 94
Stay on top • Show log window. • Generate logfile: If checked, a log file with the GDB <-> GDB Server <-> J-Link communication will be created. • Verify download: If checked, the memory on the target will be verified after download.
3.3.3 Supported remote (monitor) commands J-Link GDB Server comes with some functionalities which are not part of the standard GDB. These functions can be called either via a gdbinit file passed to GDB Server or via monitor commands passed directly to GDB, forwarding them to GDB Server.
Page 99
-device instead. Select the target interface. interface Note: Use command line option instead. Sets the JTAG speed of J-Link / J-Trace. Note: For the initial connection speed, use com- speed mand line option instead. -speed Table 3.4: GDB remote commands Note: The remote commands are case-insensitive.
Page 102
Deprecated. Use command line option instead. Syntax interface <InterfaceIdentifier> Description Selects the target interface used by J-Link / J-Trace. 3.3.3.11 jtagconf Syntax jtagconf <IRPre> <DRPre> Description Configures a JTAG scan chain with multiple devices on it. <IRPre> is the sum of IRLens of all devices closer to TDI, where IRLen is the number of bits in the IR (Instruction Register) of one device.
Page 104
Add. information There are different reset strategies for different CPUs. Moreover, the reset strategies which are available differ from CPU core to CPU core. J-Link can perform various reset strategies and always selects the best fitting strategy for the selected device.
Page 107
<kHz>|auto|adaptive Description Sets the JTAG speed of J-Link / J-Trace. Speed can be either fixed (in kHz), automatic recognition or adaptive. In general, Adaptive is recommended if the target has an RTCK signal which is connected to the corresponding RTCK pin of the device (S-cores only).
Page 108
SWO EnableTarget <CPUFreq[Hz]> <SWOFreq[Hz]> <PortMask[0x01-0xFFFFFFFF] <Mode[0]> Description Configures the target to be able to output SWO data and starts J-Link to capture it. CPU and SWO frequency can be 0 for auto-detection. If CPUFreq is 0, J-Link will measure the current CPU speed.
Page 109
Syntax SWO GetSpeedInfo Description Prints the base frequency and the minimum divider of the connected J-Link. With this information, the available SWO speeds for J-Link can be calculated and the matching one for the target CPU frequency can be selected.
3.3.4 SEGGER-specific GDB protocol extensions J-Link GDB Server implements some functionality which are not part of the standard GDB remote protocol in general query packets. These SEGGER-specific general query packets can be sent to GDB Server on the low-level of GDB, via maintanace com- mands, or with a custom client connected to GDB Server.
Page 111
Configures STRACE for usage. Configuration for example includes specification of the trace port width to be used for tracing (1-bit, 2-bit, 4-bit (default) Port- Width=%Var%. Note: For more information please refer to UM08002 (J-Link SDK user guide), chapter STRACE. Response <ReturnValue>...
Page 112
Description Read the last recently called instruction addresses. The addresses are returned LIFO, meaning the last recent address is returned first. Note: For more information please refer to UM08002 (J-Link SDK user guide), chapter STRACE. Response <ReturnValue>[<Item0><Item1>...] ReturnValue is a 4 Byte signed integer.
Page 114
Enc: Encoding type, only 0 ("UART encoding") is allowed. Hexadecimal. Description Returns the base frequency and the minimum divider of the connected J-Link. With this information, the available SWO speeds for J-Link can be calculated and the matching one for the target CPU frequency can be selected.
3.3.5 Command line options There are several command line options available for the GDB Server which allow configuration of the GDB Server before any connection to a J-Link is attempted or any connection from a GDB client is accepted. Note:...
Page 116
Selects a RTOS plugin (DLL file) -rtos Starts GDB Server in single run mode. -singlerun Uses a J-Link scriptfile. -scriptfile Selects the interface to connect to J-Link (USB/IP). -select Selects the J-Link Settings File. -settingsfile Starts GDB Server in strict mode. -strict Executes a gdb file on first connection.
Page 117
3.3.5.2 -device Description Tells GDBServer to which device J-Link is connected before the connect sequence is actually performed. It is recommended to use the command line option to select the device instead of using the remote command since for some devices J-Link already needs to know the device at the time of connecting to it since some devices need special connect sequences (e.g.
Page 118
Example jlinkgdbserver -endian little 3.3.5.4 -if Description Selects the target interface which is used by J-Link to connect to the device. The default value is JTAG. Note: Using GDB Server CL this option is mandatory to correctly connect to the target, and should be given before connection via GDB.
Page 122
This command line option prevents GDB Server from closing, to allow connecting a target after starting GDB Server. Note: The recommended order is to power the target, connect it to J-Link and then start GDB Server. Syntax -notimeout 3.3.5.19 -novd...
Page 123
3.3.5.24 -settingsfile Description Select a J-Link settings file to be used for the target device. The settings fail can con- tain all configurable options of the Settings tab in J-Link Control panel. Syntax -SettingsFile <PathToFile>...
Page 124
In normal run mode GDB Server will stay open and wait for new connections. When started in single run mode GDB Server will close immediately when connecting to the target fails. Make sure it is powered and connected to J-Link before starting GDB Server.
Page 125
Note: The recommended order is to power the target, connect it to J-Link and then start GDB Server. Syntax -timeout <Timeout[ms]> Example Allow target connection within 10 seconds. jlinkgdbserver -timeout 10000 3.3.5.30 -strict Description Starts GDB Server in sctrict mode. When strict mode is active GDB Server checks the correctness of settings and exits in case of a failure.
3.3.6 Program termination J-Link GDB Server is normally terminated by a close or Ctrl-C event. When the single run mode is active it will also close when an error occurred during start or after all connections to GDB Server are closed.
Table 3.11: GDB Server exit codes 3.3.7 Semihosting Semihosting can be used with J-Link GDBServer and GDB based debug environments but needs to be explicitly enabled. For more information, please refer to Enabling semihosting in J-Link GDBServer on page 463.
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. Perfor- mance is just slightly (about 10%) lower than with direct USB connection.
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.
Page 130
J-Link software and documentation package Start J-Link Remote Server in tunneling mode Connect to the J-Link / J-Trace via J-Link commander J-Link Commander can be used to verify a connection to the J-Link can be estab- lished as follows: Start J-Link Commander From within J-Link Commander enter ip tunnel:<SerialNo>...
J-Flash is an application to program data images to the flash of a target device. With J-Flash 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.
CHAPTER 3 J-Link software and documentation package J-Link RTT Viewer J-Link RTT Viewer is a Windows GUI application 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.
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.
Page 138
Example JLinkRTTViewer.exe --interface swd 3.7.7.4 --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 -rttaddr 0x20000000 3.7.7.8 --rttrange Sets one or more memory ranges, where the J-Link DLL shall search for the RTT con- trol block. Syntax --rttrange <RangeStart[Hex]> <RangeSize >[, <Range1Start [Hex]> <Range1Size>]> Example JLinkRTTViewer.exe -rttrange "20000000 400" 3.7.7.9 --autoconnect Let J-Link RTT Viewer connect automatically to the target without showing the Con- nection Settings (see Connection Settings on page 135).
Command line-only version of SWO Viewer. All commands avaible 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...
3.8.2 List of available command line options J-Link SWO Viewer can also be controlled from the command line if used in a auto- mated test environment etc. When passing all necessary information to the utility via command line, the configu- ration dialog at startup is suppressed.
Page 144
Example -settingsfile "C:\Temp\Settings.jlink" 3.8.2.7 swofreq Define 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.
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 th input file for the SWO Analyzer, the J-Link config file needs to be modified.
J-Link software and documentation package 3.11 J-Link RDI (Remote Debug Interface) 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.
Selects a command file and starts J-Link STR91x Commander in batch mode. The batch mode of J-Link Commander is similar to the execution of a batch file. The com- mand file is parsed line by line and one command is executed at a time.
To select from a list of all available emulators on Ethernet, please use * as <IPAddr>. -SelectEmuBySN 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 STR91x Commander shall run and each connects to another J-Link.
Page 153
Additional information To select from a list of all available emulators on Ethernet, please use * as <IPAddr>. -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>...
Page 154
JLinkSTM32.exe -SetDeviceFamily STM32L1xxxx // Selects STM32L1 series -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 J-Link / 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...
Chapter 4 Setup This chapter describes the setup procedure required in order to work with J-Link / J- Trace. Primarily this includes the installation of the J-Link software and documenta- tion package, which also includes a kernel mode J-Link USB driver in your host sys- tem.
J-Link USB driver. Some of the applications require an additional license, free trial licenses are available upon request from www.segger.com. Refer to chapter J-Link software and documentation package on page 69 for an over- view of the J-Link software and documentation pack. 4.1.1...
Page 159
Next > button. The Choose options dialog is opened. The Install J-Link Serial Port Driver installs the driver for J-Links with CDC functionality. It is not preselected since J-Links without CDC functionality do not need this driver.
Page 160
Setup The installation process will start. The J-Link DLL Updater pops up, which allows you to update the DLL of an installed IDE to the DLL verion which is included in the installer. For further infor- mation about the J-Link DLL updater, please refer to J-Link DLL updater on page 171.
In addition you can verify the driver installation by consulting the Windows device manager. If the driver is installed and your J-Link / J-Trace is connected to your com- puter, the device manager should list the J-Link USB driver as a node below "Univer- sal Serial Bus controllers"...
4.2.2 Uninstalling the J-Link USB driver If J-Link / J-Trace is not properly recognized by Windows and therefore does not enu- merate, it makes sense to uninstall the J-Link USB driver. This might be the case when: •...
J-Link Configurator which auto-detects all J-Links that are connected to the host PC via USB & Ethernet. The J-Link Configurator allows the user to setup the IP interface of J-Link. For more information about how to use the J-Link Configurator, please refer to J-Link Configurator on page 167.
Page 165
The Network configuration page allows configuration of network related settings (IP address, subnet mask, default gateway) of J-Link. The user can choose between automatic IP assignment (settings are provided by a DHCP server in the network) and manual IP assignment by selecting the appropriate radio button.
PC. This is the default identification method for current J- Links (J-Link with hardware version 8 or later). For re-configuration of old J-Links or for configuration of the IP settings (use DHCP, IP address, subnet mask, ...) of a J- Link supporting the Ethernet interface, SEGGER provides a GUI-based tool, called J- Link Configurator.
Page 168
CHAPTER 4 Setup In order to configure an old J-Link, which uses the old USB 0 - 3 USB identification method, to use the new USB identification method (reporting the real serial number) simply select "Real SN" as USB identification method and click the OK button. The same dialog also allows configuration of the IP settings of the connected J-Link if it supports the Ethernet interface.
J-Link USB identification In general, when using USB, there are two ways in which a J-Link can be identified: • By serial number • By USB address Default configuration of J-Link is: Identification by serial number. Identification via USB address is used for compatibility and not recommended.
Page 170
J-Links are connected to the PC and shows a selection dialog which allows the user to select the appropriate J-Link to connect to. So even in IDEs which do not have an selection option for the J-Link, it is possible to connect to different J-Links.
4.7.2.1 Updating the J-Link DLL in the IAR Embedded Workbench for ARM (EWARM) It is recommended to use the J-Link DLL updater to update the J-Link DLL in the IAR Embedded Workbench. The IAR Embedded Workbench IDE is a high-performance integrated development environment with an editor, compiler, linker, debugger.
RDDI DLL in DS-5. An backup of the original DLL is made automatically. 4.8.1 Replacing the RDDI DLL manually If J-Link DLL Updater is unable to find a DS-5 installation and does not list it for updating, the RDDI DLL can always be replaced manually. For more information about...
5.1.2 Verifying target device connection If the USB driver is working properly and your J-Link / J-Trace is connected with the host system, you may connect J-Link / J-Trace to your target hardware. Then start JLink.exe which should now display the normal J-Link / J-Trace related information and in addition to that it should report that it found a JTAG target and the target’s...
5.2.1 Main indicator For J-Links up to V7, the main indicator is single color (Green). J-Link V8 comes with a bi-color indicator (Green & Red LED), which can show multiple colors: green, red and orange.
Page 178
GREEN, constant Emulator has enumerated and is in idle mode. GREEN, switched off for J-Link heart beat. Will be activated after the emulator 10ms once per second has been in idle mode for at least 7 seconds. Emulator has a fatal error. This should not normally hap- GREEN, flashing at 1 Hz pen.
5.2.2 Input indicator Some newer J-Links such as the J-Link Pro/Ultra come with additional input/output indicators. The input indicator is used to give the user some information about the status of the target hardware. 5.2.2.1 Bi-color input indicator Indicator status...
IAR C-SPY® debugger, ARM’s AXD using RDI, a flash programming application such as SEGGER’s J-Flash, or any other application using J-Link / J-Trace. It is the applica- tion’s responsibility to supply a way to configure the scan chain. Most applications offer a dialog box for this purpose.
If only one device is connected to the scan chain, the default configuration can be used. In other cases, J-Link / J-Trace may succeed in automatically recognizing the devices on the scan chain, but whether this is possible depends on the devices present on the scan chain.
Table 5.6: J-Link supported SWO input speeds 5.4.2.2 Configuring SWO speeds The max. SWO speed in practice is the max. speed which both, target and J-Link can handle. J-Link can handle the frequencies described in SWO on page 185 whereas the max.
Page 186
Example 2 Target CPU running at 10 MHz. Possible SWO output speeds are: 10MHz, 5MHz, 3.33MHz, ... J-Link V7: Supported SWO input speeds are: 6MHz / n, n>= 1: 6MHz, 3MHz, 2MHz, 1.5MHz, ... Permitted combinations are: SWO output SWO input...
Multi-core debugging J-Link / J-Trace is able to debug multiple cores on one target system connected to the same scan chain. Configuring and using this feature is described in this section. 5.5.1 How multi-core debugging works Multi-core debugging requires multiple debuggers or multiple instances of the same debugger.
Working with J-Link and J-Trace 5.5.2 Using multi-core debugging in detail Connect your target to J-Link / J-Trace. Start your debugger, for example IAR Embedded Workbench for ARM. Choose Project|Options and configure your scan chain. The picture below shows the configuration for the first CPU core on your target.
J-Links connected to the same host at the same time. In order to connect to the correct J-Link, the user has to make sure that the correct J-Link is selected (by SN or IP). In cases where no specific J-Link is selected, following pop up will shop and allow the user to select the proper J-Link: The sketch below shows a host, running two application programs.
Page 192
For example, old IAR EWARM versions supports connecting to a J-Link via the USB0-3 method only. As soon as more than one J-Link is connected to the pc, there is no oppertunity to pre-select the J-Link which should be used for a debug session.
J-Link features such as flash download, flash breakpoints and instruction set simulation. The J-Link control panel window can be accessed via the J-Link tray icon in the tray icon list. This icon is available when the debug session is started.
Page 194
Section: Flash download In this section, settings for the use of the J-Link FlashDL feature and related set- tings can be configured. When a license for J-Link FlashDL is found, the color indi- cator is green and "License found"...
Page 195
Save settings: When this button is pushed, the current settings in the Settings tab will be saved in a configuration file. This file is created by J-Link and will be created for each project and each project configuration (e.g. Debug_RAM, Debug_Flash).
Page 196
Note: It is possible for the debugger to bypass the breakpoint functionality of the J-Link software by writing to the debug registers directly. This means for ARM7/ ARM9 cores write accesses to the ICE registers, for Cortex-M3 devices write accesses to the memory mapped flash breakpoint registers and in general simple write accesses for software breakpoints (if the program is located in RAM).
Page 198
In this section SWV information are shown. • Status: Shows the encoding and the baudrate of the SWV data received by the target (Manchester/UART, currently J-Link only supports UART encoding). • Bytes in buffer: Shows how many bytes are in the DLL SWV data buffer.
Some CPUs can actually be halted before executing any instruction, because the start of the CPU is delayed after reset release. If a pause has been specified, J-Link waits for the specified time before trying to halt the CPU. This can be useful if a bootloader which resides in flash or ROM needs to be started after reset.
Page 200
No reset is performed. Nothing happens. 5.8.1.5 Type 4: Hardware, halt with WP The hardware RESET pin is used to reset the CPU. After reset release, J-Link continu- ously tries to halt the CPU using a watchpoint. This typically halts the CPU shortly after reset release;...
It is recommended that the correct device is selected in the debugger so the debugger can pass the device name to the J-Link DLL which makes it possible for J-Link to detect what is the best reset strategy for the device. Moreover, we recom- mend that the debugger uses reset type 0 to allow J-Link to dynamically select what reset is the best for the connected device.
Page 202
Clear VC_CORERESET. This type of reset may fail if: • J-Link has no connection to the debug interface of the CPU because it is in a low power mode. • The debug interface is disabled after reset and needs to be enabled by a device internal bootloader.
Page 203
This reset strategy is only guaranteed to work on "modern" J-Links (J-Link V8, J-Link Pro, J-link ULTRA, J-Trace for Cortex-M, J-Link Lite) and if a SWD speed of min. 1 MHz is used. This reset strategy should also work for J-Links with hardware version 6, but it can not be guaranteed that these J-Links are always fast enough in disabling the watchdog.
DCC handler from time to time. This DCC handler typically requires less than 1 µs per call. The DCC handler, as well as the optional DCC abort handler, is part of the J-Link soft- ware package and can be found in the Samples\DCC\IAR directory of the package.
Most IDEs provide a path to a J-Link settings file on a per-project-per-debug-config- uration basis. This file is used by J-Link to store various debug settings that shall sur- vive between debug sessions of a project. It also allows the user to perform some override of various settings.
CoreSight components (ETM, ...) that cannot be auto- detected by J-Link due to erroneous ROM tables etc. May also be used to specify the device name in case debugger does not pass it to the DLL.
Page 207
Currently this function is only used to configure whether the target which is connected to J-Link has an ETB or not. For more information on how to configure the existence of an ETB, please refer to Global DLL variables on page 213.
Page 211
Allows the user to manually configure the AP-layout of the device J-Link is connected to. This makes sense on targets on which J-Link can not perform a auto-detection of the APs which are present on the target system. Type can only be a known global J- Link DLL AP constant.
Page 212
The JTAG -> SWD switching sequence is output. It is also made sure that the "overrun mode enable" bit in the SW-DP CTRL/STAT reg- ister is cleared, as in SWD mode J-Link always assumes that overrun detection mode is disabled.
Page 214
Used in InitTarget() to skip the core auto- detection of J-Link. This variable can only be set to a known global J-Link DLL constant. For a list of all valid values, please refer to Global DLL con- stants on page 217.
Page 215
Example JLINK_TRACE_Portwidth = 4; If the connected device has an ETB and you want to use it with J-Link, this variable should be set to 1. Setting this variable in another function as InitEmu() does not have any effect. EMU_ETB_IsPresent...
Page 216
CoreSight information. Example CORESIGHT_CoreBaseAddr = 0x80030000; Pre-selects an AP as an AHB-AP that J-Link uses for debug communication (Cortex-M). Setting this variable is necessary for example when debugging multi-core devices where multiple AHB-APs are present (one for each device).
Variable Description Overrides the default settings to be used by the DLL when configuring the AHB-AP CSW register. By default, the J-Link DLL will use the following settings for the CSW: Cortex-M0, M0+, M3, M4 [30] == 0 [28] == 0...
JLINK_TIF_SWD 5.11.5 Script file language The syntax of the J-Link script file language follows the conventions of the C-lan- guage, but it does not support all expresisons and operators which are supported by the C-language. In the following, the supported operators and expressions are listed.
5.11.6 Script file writing example In the following, a short example of how a J-Link script file could look like. In this example we assume a JTAG chain with two devices on it (Cortex-A8 4 bits IRLen, cus- tom device 5-bits IRLen).
Page 221
IAR EWARM does not provide any native support for J-Link script files so usage of them cannot be configured from within the GUI of the IDE itself. Anyhow, it is possi- ble to use a J-Link script file by making use of the auto-search feature of the DLL: •...
Page 222
J-Link settings file, please refer to The J-Link settings file on page 205. 5.11.7.4 In other debugger IDE environments To execute a J-Link script file out of your debugger IDE, simply select the script file to execute in the Settings tab of the J-Link control panel and click the save button (after the debug session has been started).
5.12 Command strings The behavior of the J-Link can be customized via command strings passed to the JLinkARM.dll which controls J-Link. Applications such as the J-Link Commander, but also the C-SPY debugger which is part of the IAR Embedded Workbench, allow pass- ing one or more command strings.
Page 224
J-Link and target CPU, for a SetSysPowerDownOnIdle specified timeframe. Specifies the verify option to be used. SetVerifyDownload Specifies RAM area to be used by the J-Link DLL. SetWorkRAM Opens control panel. ShowControlPanel Update new firmware automatically. SilentUpdateFW...
Page 225
This command is used to select a specific APB-AP to be used when connected to an ARM Cortex-A or Cortex-R device. Usually, it is not necessary to explicitly select an AHB-AP to be used, as J-Link auto-detects the AP automatically. For multi-core sys- tems with multiple APB-APs it might be necessary.
Page 226
DisableAutoUpdateFW 5.12.1.6 DisableCortexMXPSRAutoCorrectTBit Usually, the J-Link DLL auto-corrects the T-bit of the XPSR register to 1, for Cortex-M devices. This is because having it set as 0 is an invalid state and would cause several problems during debugging, especially on devices where the erased state of the flash is 0x00 and therefore on empty devices the T-bit in the XPSR would be 0.
Page 227
Syntax DisableInfoWinFlashDL 5.12.1.11DisableMOEHandling The J-Link DLL outputs additional information about mode of entry (MOE) in case the target CPU halted / entered debug mode. Disabled by default. Syntax DisableMOEHandling 5.12.1.12DisablePowerSupplyOnClose This command is used to ensure that the power supply for the target will be disabled on close.
Page 228
This command is used to invalidate flash ranges in flash cache, that are configured to be excluded from the cache. Per default, all areas that J-Link knows to be Flash memory, are cached. This means that it is assumed that the contents of this area do not change during program execution.
Page 229
InvalidateCache 5.12.1.26InvalidateFW This command is used to invalidate the current firmware of the J-Link / J-Trace. Inval- idating the firmware will force a firmware update. Can be used for downdating. For more information please refer to J-Link / J-Trace firmware on page 446.
Page 230
Reserved 0x40008000-0x7FCFFFFF Reserved 0x7FD02000-0x7FD02000 Reserved 0x80000000-0xDFFFFFFF Reserved To exclude these areas from being accessed through J-Link the map exclude com- mand should be used as follows: map exclude 0x00080000-0x3FFFFFFF map exclude 0x40008000-0x7FCFFFFF map exclude 0x7FD02000-0x7FD02000 map exclude 0x80000000-0xDFFFFFFF 5.12.1.28map illegal This command marks a specified memory region as an illegal memory area.
Page 232
CHAPTER 5 Working with J-Link and J-Trace 5.12.1.33ProjectFile This command is used to specify a file used by the J-Link DLL to save the current configuration. Using this command is recommended if settings need to be saved. This is typically the case if Flash breakpoints are enabled and used.
Page 233
// Enables instruction set simulation 5.12.1.39SetBatchMode This command is used to tell the J-Link DLL that it is used in batch-mode / automa- tized mode, so some dialogs etc. will automatically close after a given timeout. Dis- abled by default.
Page 234
// Select using fastest method 5.12.1.43SetCPUConnectIDCODE Used to specify an IDCODE that is used by J-Link to authenticate itself when connect- ing to a specific device. Some devices allow the user to lock out a debugger by default, until a specific unlock code is provided that allows further debugging. This function allows to automate this process, if J-Link is used in a production environ- ment.
Page 235
0x800, all writes of amounts of data < 2 KB will cause the DLL to perform a read-modify-write operation on incomplete sectors. Default: Writing amounts of < 1 KB (0x400) to flash causes J-Link to perform a read- modify-write on the flash.
Page 236
Debugger writes 1280 bytes J-Link will erase + program 1 KB of first sector. J-Link will erase + program 256 bytes of second sector. Previous 768 bytes from sec- ond sector are lost. The default makes sense for flash programming where old contents in remaining space of affected sectors are usually not needed anymore.
Page 237
TraceSampleAdjust TD = 1000 5.12.1.54 SetResetType This command selects the reset strategy which shall be used by J-Link, to reset the device. The value which is used for this command is analog to the reset type which shall be selected. For a list of all reset types which are available, please refer to Reset strategies on page 199.
Page 238
Syntax SetRestartOnClose = 0 | 1 Example SetRestartOnClose = 1 5.12.1.56 SetRTTAddr In some cases J-Link cannot locate the RTT buffer in known RAM. This command is used to set the exact address manually. Syntax SetRTTAddr <RangeStart> Example SetRTTAddr 0x20000000 5.12.1.57 SetRTTTelnetPort...
Page 239
// Select using fastest method 5.12.1.61 SetSysPowerDownOnIdle When using this command, the target CPU is powered-down when no transmission between J-Link and the target CPU was performed for a specific time. When the next command is given, the CPU is powered-up. Note: This command works only for Cortex-M3 devices.
Page 240
CHAPTER 5 Working with J-Link and J-Trace Example SetVerifyDownload = 1 // Select programmed sectors, fastest method 5.12.1.63SetWorkRAM This command can be used to configure the RAM area which will be used by J-Link. Syntax SetWorkRAM <StartAddressOfArea>-<EndAddressOfArea> Example SetWorkRAM 0x10000000-0x100FFFFF 5.12.1.64ShowControlPanel Executing this command opens the control panel.
Example SWOSetConversionMode = 0 5.12.2 Using command strings 5.12.2.1 J-Link Commander The J-Link command strings can be tested with the J-Link Commander. Use the com- mand exec supplemented by one of the command strings. Example exec SupplyPower = 1 exec map reset...
Page 242
CHAPTER 5 Working with J-Link and J-Trace 5.12.2.2 SEGGER Ozone J-Link command strings can be used inside SEGGER Ozone. They can be used in dif- ferent ways: • From inside a *.jdebug (script-like) Ozone project, by adding a Exec.Com- mand("<Command>"); call into one of the customizable Ozone actions. For more information about them, please refer to the Ozone manual.
Because ARM7 cores have a unified cache, there is no need to handle the caches dur- ing debug. 5.14.4 Cache handling of ARM9 cores ARM9 cores with cache require J-Link / J-Trace to handle the caches during debug. If the processor enters debug state with caches enabled, J-Link / J-Trace does the fol- lowing:...
J-Link Configurator which auto-detects all J-Links that are connected to the host PC via USB & Ethernet. The J-Link Configurator allows the user to enable and disable the VCOM. For more information about the J-Link Configurator, please refer to J-Link Configurator on page 167.
Moreover, the J-Link DLL also allows programming of CFI-compliant external NOR flash memory. The flash down- load feature of the J-Link DLL does not require an extra license and can be used free of charge.
CHAPTER 6 Flash download Supported devices J-Link supports download into the internal flash of a large number of microcontrol- lers. You can always find the latest list of supported devices on our website: http://www.segger.com/jlink_supported_devices.html In general, J-Link can be used with any ARM7/9/11, Cortex-M0/M1/M3/M4 and Cor- tex-A5/A8/R4 core even if it does not provide internal flash.
First, choose the right device in the project settings if not already done. The device settings can be found at Project->Options->General Options->Target. To use the J-Link flash loaders, the IAR flash loader has to be disabled. To disable the IAR flash loader, the checkbox Use flash loader(s) at Project->Options->Debug- ger->Download has to be disabled, as shown below.
Page 252
First, choose the device in the project settings if not already done. The device set- tings can be found at Project->Options for Target->Device. To enable the J-Link flash loader J-Link / J-Trace at Project->Options for Tar- get->Utilities has to be selected. It is important that "Update Target before Debug- ging"...
Page 253
Then J-Link has to be selected as debugger. To select J-Link as debugger simply choose J-Link J-Trace from the list box which can be found at Project- >Options for Target->Debug. Now setup the Download Options at Project->Options for Target->Debug ->...
J-Link GDB Server The configuration for the J-Link GDB Server is done by the .gdbinit file. The follow- ing command has to be added to the .gdbinit file to enable the J-Link flash down- load feature: monitor flash device <DeviceName>...
J-Link GDB Server on page 92. 6.4.5 J-Link Commander J-Link Commander supports downloading bin files into internal flash memory of pop- ular microcontrollers. In the following, it is explained which steps are necessary to prepare J-Link Commander for download into internal flash memory.
Flash download 6.4.6 J-Link RDI The configuration for J-Link RDI is done via the J-Link RDI configuration dialog. For more information about the J-Link RDI configuration dialog please refer to UM08004, J-Link RDI User Guide, chapter Configuration dialog. J-Link / J-Trace (UM08001)
Initialization of the external memory interface the CFI flash is con- nected to, is user's responsibility and is expected by the J-Link software to be done prior to performing accesses to the specified CFI area. In this section, the setup for different debuggers is explained.
Flash download 6.5.2 J-Link GDB Server The configuration for the J-Link GDB Server is done by the .gdbinit file. The follow- ing commands have to be added to the .gdbinit file to enable the flash download feature: monitor WorkRAM = <SAddr>-<EAddr>...
Setup for various debuggers (SPIFI flash) The J-Link DLL supports programming of SPIFI flash and the J-Link flash download feature can be used therefor by different debuggers, such as IAR Embedded Work- bench, Keil MDK, GDB based IDEs, ... There is nothing special to be done by the user to also enable download into SPIFI flash.
Flash download QSPI flash support The J-Link DLL also supports programming of any (Q)SPI flash connected to a device that is supported by the J-Link DLL, if the device allows memory-mapped access to the flash. Most modern MCUs / CPUs provide a so called "QSPI area" in their mem- ory-map which allows the CPU to read-access a (Q)SPI flash as regular memory (RAM, internal flash etc.).
Using the DLL flash loaders in custom applica- tions The J-Link DLL flash loaders make flash behave as RAM from a user perspective, since flash programming is triggered by simply calling the J-Link API functions for memory reading / writing. For more information about how to setup the J-Link API for flash programming please refer to UM08002 J-Link SDK documentation (available for SDK customers only).
In case the debugged application does change the flash contents, it is necessary to disable caching of the effected flash range. This can be done using the J-Link com- mand string ExcludeFlashCacheRange. The SEGGER Wiki provides an articel about this topic that provides further informa- tion, for example how to use J-Link command strings with various IDEs.
Flash breakpoints Introduction The J-Link DLL supports a feature called flash breakpoints which allows the user to set an unlimited number of breakpoints in flash memory rather than only being able to use the hardware breakpoints of the device. Usually when using hardware break- points only, a maximum of 2 (ARM 7/9/11) to 8 (Cortex-A/R) breakpoints can be set.
In order to use the flash breakpoints feature a separate license is necessary for each J-Link. For some devices J-Link comes with a device-based license and some J-Link models also come with a full license for flash breakpoints but the normal J-Link comes without any licenses. For more information about licensing itself and which devices have a device-based license, please refer to Licensing on page 55.
CHAPTER 7 Flash breakpoints Supported devices J-Link supports flash breakpoints for a large number of microcontrollers. You can always find the latest list of supported devices on our website: http://www.segger.com/jlink_supported_devices.html In general, J-Link can be used with any ARM7/9/11, Cortex-M0/M1/M3/M4 and Cor- tex-A5/A8/R4 core even if it does not provide internal flash.
251. Whether flash breakpoints are available can be verified using the J-Link control panel: 7.4.2 Compatibility with various debuggers Flash breakpoints can be used in all debugger which use the proper J-Link API to set breakpoints. Compatible debuggers/ debug interfaces are: • IAR Embedded Workbench •...
This feature is called execute-in-place (XIP). On some cores like Cortex-M where hardware breakpoints are only available in a certain address range, sometimes J-Link flash breakpoints are the only possibility to set breakpoints when debugging code running in QSPI flash.
Page 269
Why can flash breakpoints not be used with Rowley Crossworks? Because Rowley Crossworks does not use the proper J-Link API to set breakpoints. Instead of using the breakpoint-API, Crossworks programs the debug hardware directly, leaving J-Link no choice to use its flash breakpoints.
Halt mode Monitor mode Halt mode is the default debug mode used by J-Link. In this mode the CPU is halted and stops program execution when a breakpoint is hit or the debugger issues a halt request. This means that no parts of the application continue running while the CPU is halted (in debug mode) and peripheral interrupts can only become pending but not taken as this would require execution of the debug interrupt handlers.
Enable Monitor Debugging As explained before, by default J-Link uses halt mode debugging. In order to enable monitor mode debugging, the J-Link software needs to be explicitly told to use moni- tor mode debugging. This is done slightly differently from IDE to IDE. In general, the IDE does not notice any difference between halting and monitor debug mode.
8.2.3 Keil MDK-ARM (uVision) In Keil MDK-ARM there is no built-in option to pass execs or similar to the J-Link DLL, therefore monitor mode has to be enabled on a per-project basis via the J-Link set- tings file that is created on start of the first dbeug session with a specific project. for more information where to find the J-Link settings file for a Keil MDK-ARM project, please refer to The J-Link settings file on page 205.
See Cortex-M4 on page 275. 8.3.2 Cortex-M4 For Cortex-M4, monitor mode debugging is supported. The monitor code provided by SEGGER can easily be linked into the user application. Considerations & Limitations • The user-specific monitor functions must not block the generic monitor for more than 100ms.
A CPU core-specific monitor code is necessary to perform monitor mode debugging with J-Link. This monitor performs the communication with J-Link while the CPU is in debug mode (meaning in the monitor exception). The monitor code needs to be com- piled and linked as a normal part of the application.
However, there is a small window in which it can happen that a breakpoint is hit before J-Link has restored the monitor bits. If this happens, instead of entering debug mode, a HardFault is triggered. To avoid hanging of the application, a special...
"check if CPU is halted/hit a BP". To avoid this, there is a special setting for J-Link that can be activated, to handle such cases in a better way, which is explained in the following.
While usually the J-Link DLL handles communication losses as errors, there is a pos- sibility to enable low power mode handling in the J-Link DLL, which puts the DLL into a less restrictive mode (low-power handling mode) when it comes to such loss-cases.
J-Link does it’s best to handle cases where one or more of the above restrictions is not considered but depending on how the IDE reacts to specific operations to fail, error messages may appear or the debug session will be terminated by the IDE.
GER and a new release of the J-Link software package being available. The J-Link DLL allows customers to add support for new devices on their own. It is also possible to edit/extend existing devices of the device database by for example adding new flash banks (e.g.
By default, the J-Link DLL comes with a build-in device database that defines which device names are known and therefore officially supported by the J-Link DLL and software that uses the J-Link DLL. This list can also be viewed on our website: http://www.segger.com/jlink_supported_devices.html It is possible to add new devices to the currently used DLL by specifying them in an XML file, named JLinkDevices.xml.
CHAPTER 10 Open Flashloader 10.3 Adding a new device In order to add support for a new device to the J-Link DLL, the following needs to be added to the JLinkDevices.xml: <Database> <Device> <ChipInfo Vendor="..." Name="..." WorkRAMAddr="..." WorkRAMSize="..." Core="..." />...
10.4 Editing/Extending an Existing Device In order to edit/extend a device that is already in the built-in device database of the J-Link DLL, the following needs to be added to the JLinkDevices.xml: <Database> <Device> <ChipInfo Vendor="..." Name="..." /> <FlashBankInfo Name="..."...
Page 291
For a list of valid attribute values, please refer to Attrbiute values - Core on page 291. String that specifies the path to a J-Link script file if required for the device. Path can be relative or absolute. If path is relative, it is relative to the location of the JLinkDevices.xml file.
10.5.4 <FlashBankInfo> Description Specifies a flash bank for the device. This allows to use the J-Link flash download functionality with IDEs, debuggers and other software that uses the J-Link DLL (e.g. J-Link Commander) for this device. The flash bank can then be programmed via the normal flash download functionality of the J-Link DLL.
10.7.1 CMSIS Flash Algorithms Compatibility CMSIS flash algorithms are also supported by the Open Flashloader concept. There- fore, an existing *.FLM file can be simply referenced in a J-Link XML device descrip- tion file. The attribute needs to be set to FLASH_ALGO_TYPE_OPEN.
This chapter describes J-Flash SPI and J-Flash SPI CL, which are seperate software (executables) which allow direct programming of SPI flashes, without any additional hardware. Both, J-Flash SPI and J-Flash SPI CL are part of the J-Link software and documentation package which is available free of charge.
J-Flash SPI requires a PC running one of the supported operating system (see above) with a free USB port dedicated to a J-Link. A network connection is required only if you want to use J-Flash SPI together with J-Link Remote Server.
11.2 Licensing The following chapter provides an overview of J-Flash SPI related licensing options. 11.2.1 Introduction A J-Link PLUS, ULTRA+, PRO or Flasher ARM/PRO is required to use J-Flash SPI. No additional license is required / available. J-Link / J-Trace (UM08001)
This chapter presents an introduction to J-Flash SPI. It provides an overview of the included sample projects and describes the menu structure of J-Flash SPI in detail. 11.3.1 Setup For J-Link setup procedure required in order to work with J-Flash SPI, please refer to chapter Setup on page 157 11.3.1.1 What is included?
Page 304
CHAPTER 11 J-Flash SPI Target menu elements Command Description Creates a connection through the J-Link using the config- Connect uration options set in the Project settings... of the Options drop-down menu. Disconnects a current connection that has been made Disconnect through the J-Link.
This dialog is used to choose the connection to J-Link. The J-Link can either be connected over USB or via TCP/IP to the host system. Refer to the J-Link manual for more information regarding the operation of J-Link and J-Link TCP/IP Server.
Page 307
Init steps and Exit steps which can be used to execute cus- tom command sequences. 11.4.1.2.1 Interface Speed Specifies the SPI communication speed J-Link uses to communicate with the SPI flash. 11.4.1.2.2 Init and Exit steps Can be uesed to add custom command sequences like for example write protection register.
Page 310
11.4.2.2.2 Enable J-Link logfile If this option is checked, you can specify a file name for the J-Link logfile. The J-Link logfile differs from the log window output of J-Flash SPI. It does not log J-Flash SPI operations performed.
The easiest way is to setup the appropriate project once and then make multiple cop- ies of this project. Now modify the Connection to J-Link setting in each project, in order to let J-Flash SPI connect to the different programmers as shown in the screen-...
Page 314
CHAPTER 11 J-Flash SPI @ECHO OFF ECHO Open first project which is configured to connect to the first J-Link. Open data file, start auto processing and exit open JFlashSPI.exe -openprjC:\Projects\Project01.jflash -openC:\Data\data.bin, 0x100000 -auto -exit IF ERRORLEVEL 1 goto ERROR ECHO Open second project which is configured to connect to the second J-Link. Open data file, start auto processing and exit open JFlashSPI.exe -openprjC:\Projects\Project02.jflash -openC:\Data\data.bin,...
Select File -> New Project to create a new project with default settings. Open the Project Settings context menu. Select Options -> Project Settings to open the Project settings dialog and select the type of connection to J-Link. Define the SPI communication speed. The default settings work without any problem for most targets, but to achieve the last quantum of performance, man- ual tuning may be necessary.
Page 318
Below is a small example excerpt from a J-Flash project, which shows a example sequence to erase sector 0 of the SPI flash using the 0xD8 command. Further exam- ples can be found in the installation directory of the J-Link software and documenta- tion package.
In direct programming mode (J-Link directly connects to the pins of the SPI flash), the programming speed is mainly limited by the SPI communication speed, the USB speed of J-Link (if a Full-Speed or Hi-Speed based J-Link is used) and the maximum programming speed of the flash itself.
Flash SPI software. 11.11.1 SPI interface connection For direct SPI flash programming, J-Link needs to be wired to the SPI flash in a spe- cific way. For more information about the pinout for the J-Link SPI target interface, please refer to UM08001, J-Link J-Trace User Guide. The minimum pins that need to be connected, are: VTref, GND, SPI-CLK, MOSI, MISO.
11.12.1.1Typical problems Target system has no power Meaning: J-Link could not measure the target (flash) reference voltage on pin 1 of its connec- tor. Remedy: The target interface of J-Link works with level shifters to be as flexible as possible.
Page 325
CPU register set as ARM7 CPUs. This chapter describes how to use the RDI DLL which comes with the J-Link software and documentation package. The J-Link RDI DLL allows the user to use J-Link with any RDI-compliant debugger and IDE.
J-Link RDI mainly consists of a DLL designed for ARM cores to be used with any RDI compliant debugger. The J-Link DLL feature flash download and flash breakpoints can also be used with J-Link RDI.
12.2 Licensing In order to use the J-Link RDI software a separate license is necessary for each J- Link. For some devices J-Link comes with a device-based license and some J-Link models also come with a full license for J-Link RDI. The normal J-Link however, comes without any licenses.
CHAPTER 12 12.3 Setup for various debuggers The J-Link RDI software is an ARM Remote Debug Interface (RDI) for J-Link. It makes it possible to use J-Link with any RDI compliant debugger. Basically, J-Link RDI con- sists of a additional DLL ( JLinkRDI.dll ) which builds the interface between the RDI API and the normal J-Link DLL.
Page 329
( JLinkRDI.dll ) and click OK . Now an extra menu, RDI, has been added to the menu bar. Choose RDI | Configure to configure the J-Link. For more information about the generic setup of J-Link RDI, please refer to Configuration on page 344.
Page 330
ARM. Since IAR EWARM version 5.11 it is possible to use J-Link RDI for Cortex-M devices because SEGGER and IAR have come to an agree- ment regarding the RDI register assignment for Cortex-M. The following table lists...
Page 332
CHAPTER 12 Now J-Link RDI is available in the Target Environments list. Select J-Link and press OK to connect to the target via J-Link. For more informa- tion about the generic setup of J-Link RDI, please refer to Configuration on page 344.
12.3.3 ARM RVDS (RealView developer suite) 12.3.3.1 Software version J-Link RDI has been tested with ARM RVDS version 2.1 and 3.0. There should be no problems with earlier versions of RVDS (up to version v3.0.1). All screenshots are taken from ARM’s RVDS version 2.1.
Page 335
OK , Short Name: JLinkRDI Description: J-Link RDI Interface . Back in the RDI Target List Dialog, select JLink-RDI and click Configure . For more information about the generic setup of J-Link RDI, please refer to Configu- ration on page 344. J-Link / J-Trace (UM08001)
Page 336
CHAPTER 12 Click the OK button in the configuration dialog. Now close the RDI Target List dialog. Make sure your target hardware is already connected to J-Link. In the Connection control dialog, expand the JLink ARM RDI Interface and select the ARM_0 Processor. Close the Connection Control Window.
CHAPTER 12 10. A project or an image is needed for debugging. After downloading, J-Link is used to debug the target. 12.3.4 GHS MULTI 12.3.4.1 Software version J-Link RDI has been tested with GHS MULTI version 4.07. There should be no prob- lems with other versions of GHS MULTI.
Page 339
Arguments field: -config -dll <FullPathToJLinkDLLs> Note that JLinkRDI.dll and JLinkARM.dll must be stored in the same directory. If the standard J-Link installation path or another path that includes spaces has been used, enclose the path in quotation marks. Example: -config -dll "C:\Program Files\SEGGER\JLinkARM_V350g\JLinkRDI.dll"...
Page 340
CHAPTER 12 Confirm the choices by clicking the Apply button after the Connect button. The J-Link RDI Configuration dialog will open. For more information about the generic setup of J-Link RDI, please refer to Configuration on page 344. Click the OK button to connect to the target. Build the project and start the debugger.
12.3.5 KEIL MDK (µVision IDE) 12.3.5.1 Software version J-Link has been tested with KEIL MDK 3.34. There should be no problems with other versions of KEIL µVision. All screenshots are taken from MDK 3.34. 12.3.5.2 Configuring to use J-Link RDI Start KEIL uVision and open the project.
Page 342
Select the location of JLinkRDI.dll in Browse for RDI Driver DLL field. and click the Configure RDI Driver button. The J-Link RDI Configuration dialog will be opened.For more information about the generic setup of J-Link RDI, please refer to Configuration on page 344.
CHAPTER 12 12.4 Configuration This section describes the generic setup of J-Link RDI (same for all debuggers) using the J-Link RDI configuration dialog. 12.4.1 Configuration file JLinkRDI.ini All settings are stored in the file JLinkRDI.ini . This file is located in the same direc- tory as JLinkRDI.dll .
Page 345
12.4.4.1 General tab Connection to J-Link This setting allows the user to configure how the DLL should connect to the J-Link. Some J-Link models also come with an Ethernet interface which allows to use an emulator remotely via TCP/IP connection.
Page 346
12.4.4.2 Init tab Macro file A macro file can be specified to load custom settings to configure J-Link RDI with advanced commands for special chips or operations. For example, a macro file can be used to initialize a target to use the PLL before the target application is downloaded, in order to speed up the download.
Page 348
Automatic JTAG speed • Adaptive clocking For more information about the different speed settings supported by J-Link, please refer to JTAG Speed on page 184. JTAG scan chain with multiple devices The JTAG scan chain allows to specify the instruction register organization of the tar- get system.
Page 349
Furthermore it is necessary for some chips to enter the correct CPU clock frequence. Cache flash contents If enabled, the flash content is cached by the J-Link RDI software to avoid reading data twice and to speed up the transfer between debugger and target. Allow flash download This allows the J-Link RDI software to download program into flash.
Page 351
199. 12.4.4.7 Log tab A log file can be generated for the J-Link DLL and for the J-Link RDI DLL. This log files may be useful for debugging and evaluating. They may help you to solve a prob- lem yourself, but is also needed by customer support help you.
12.5 Semihosting Semihosting can be used with J-Link RDI. For more information how to enable semi- hosting in J-Link RDI, please refer to Enabling Semihosting in J-Link RDI + AXD on page 464. 12.5.1 Unexpected / unhandled SWIs When an unhandled SWI is detected by J-Link RDI, the message box below is shown.
SEGGER RTT can be used with any J-Link model and any supported target processor which allows background memory access, which are Cortex-M and RX targets.
While auto-detection of the RTT control block location works fine for most targets, it is always possible to manually specify either the exact location of the control block or to specify a certain address range J-Link shall search for a control block for in. This is done via the following command strings: •...
13.2.4 Requirements SEGGER RTT does not need any additional pin or hardware, despite a J-Link con- nected via the standard debug port to the target. It does not require any configura- tion of the target or in the debugging environment and can even be used with varying target speeds.
13.2.5 Performance The performance of SEGGER RTT is significantly higher than any other technology used to output data to a host PC. An average line of text can be output in one micro- second or less. Basically only the time to do a single memcopy().
Linux and OS X and can be used for simple RTT use cases. 13.3.3 RTT Logger With J-Link RTT Logger, data from Up-Channel 1 can be read and logged to a file. This channel can for example be used to send performance analysis data to the host.
13.4 Implementation The SEGGER RTT implementation code is written in ANSI C and can be integrated into any embedded application by simply adding the available sources. RTT can be used via a simple and easy to use API. It is even possible to override the standard printf() functions to be used with RTT.
Page 362
SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL); Additional information Once a channel is configured only the flags of the channel should be changed. 13.4.1.3 SEGGER_RTT_GetKey() Description Reads one character from SEGGER RTT buffer 0. Host has previously stored data there. Prototype int SEGGER_RTT_GetKey (void); Return value <...
Page 363
13.4.1.4 SEGGER_RTT_HasKey() Description Checks if at least one character for reading is available in SEGGER RTT buffer. 0 Prototype int SEGGER_RTT_HasKey (void); Return value No characters are available to be read. At least one character is available in the buffer.
Page 366
With SEGGER_RTT_Write() all kinds of data, not only printable one can be sent. 13.4.1.11SEGGER_RTT_WaitKey() Description Waits until at least one character is avaible in SEGGER RTT buffer 0. Once a character is available, it is read and returned. Prototype int SEGGER_RTT_WaitKey (void);...
RTT background memory access, needs to be manually specified. This is done via the following J-Link Command string: CORESIGHT_SetIndexAHBAPToUse on page 225. For more information about how to use J-Link command strings in various environ- ments, please refer to Using command strings on page 241.
Page 371
There are two ways: If the debugger (IDE) knows the address of the SEGGER RTT Control Block, it can pass it to J-Link. This is for example done by J-Link Debugger. If another application that is not SEGGER RTT aware is used, then J-Link searches for the ID in the known target RAM during execution of the application in the back- ground.
(e.g. ARM that provides the ETM as a trace component for their cores). For more information about what tim- ings need to be met for a specific J-Trace model, please refer to J-Link / J-Trace mod- els on page 30.
This allows to also do trace on such targets with a regular J-Link, as the on-chip trace buffer can be read out via the regular debug interface J-Link uses to communicate with the target CPU.
(would lead to a too big performance drop), a copy of the application contents is cached in the J-Link software at the time, the applica- tion download is performed. This implies that streaming trace is only possible with prior download of the application in the same debug session.
In order to work with an ATMEL AT91SAM7 device, it has to be initialized. The follow- ing paragraph describes the steps of an init sequence. An example for different soft- ware tools, such as J-Link GDB Server, IAR Workbench and RDI, is given. •...
Page 388
CHAPTER 15 Device specifics Samples GDB Sample # connect to the J-Link gdb server target remote localhost:2331 monitor flash device = AT91SAM7S256 monitor flash download = 1 monitor flash breakpoints = 1 # Set JTAG speed to 30 kHz monitor endian little...
If your device has been locked by setting the MCU security status to "secure", and mass erase via debug interface is not disabled, J-Link is able to unlock your Kinetis K40/K60 device. The device can be unlocked by using the "unlock" command in J- Link Commander.
Page 394
On later silicons, this has been corrected. This bug applies to all devices with mask 0M33Z from the 100MHz series. The J-Link software and documentation package comes with a sample project for the Kinetis K40 and K60 devices which is pre-configured for the TWR-40 and TWR-60 eval boards and ETM / ETB Trace.
If your device has been "locked" accidentially (e.g. by bad application code in flash which mis-configures the PLL) and J-Link can not identify it anymore, there is a spe- cial unlock sequence which erases the flash memory of the device, even if it cannot be identified.
Page 401
15.11 NXP J-Link has been tested with the following NXP devices: • LPC1111 • LPC1113 • LPC1311 • LPC1313 • LPC1342 • LPC1343 • LPC1751 • LPC1751 • LPC1752 • LPC1754 • LPC1756 • LPC1758 • LPC1764 • LPC1765 •...
Indirect reading solves the fast GPIO problem, because only direct reg- ister access corrupts the register contents. Define a 256 byte aligned area in RAM of the LPC target device with the J-Link com- mand map ram and define afterwards the memory area which should be read indirect with the command map indirectread to use the indirectly reading feature of J-Link.
All devices of the LPC43xx are dual core devices (One Cortex-M4 core and one Cor- tex-M0 core). For these devices, a J-Link script file is needed (exact file depends on if the Cortex-M4 or the Cortex-M0 shall be debugged) in order to guarantee proper functionality.
15.13 Renesas J-Link has been tested with the following Renesas devices: • R5F56104 • R5F56106 • R5F56107 • R5F56108 • R5F56216 • R5F56217 • R5F56218 • R5F562N7 • R5F562N8 • R5F562T6 • R5F562T7 • R5F562TA Currently, there are no specifics for these devices.
CHAPTER 15 Device specifics 15.14 Samsung J-Link has been tested with the following Samsung devices: • S3FN60D 15.14.1 S3FN60D On the S3FN60D the watchdog may be running after reset (depends on the content of the smart option bytes at addr. 0xC0). The watchdog keeps counting even if the CPU is in debug mode (e.g.
The SWO related units (ITM, TPIU, ...) are chip-internally wired to a fixed 14 MHz clock (AUXHFRCO). This will cause the auto-detection of J-Link to not work by default for these devices, if the CPU is running at a different speed than AUXHFRCO. All utilities that use SWO...
STR91x Commander. 15.16.1.3Switching the boot bank The bootbank of the STR91x devices can be switched by using the J-Link STR9 Com- mander which is part of the J-Link software and documentation package. For more information about the J-Link STR9 Commander, please refer to J-Link STR91x Com- mander (Command line tool) on page 151.
Page 410
J-Link STM32 Commander (command line utility) For more information about J-Flash, please refer to UM08003, J-Flash User Guide . For more information about the J-Link STM32 Commander, please refer to J-Link STM32 Unlock (Command line tool) on page 152. Note: Unsecuring a secured device will cause a mass-erase of the internal flash memory.
SEGGER offers a free command line tool which reprograms the option bytes in order to disable the hardware watchdog. For more information about the STM32 commander, please refer to J-Link STM32 Unlock (Command line tool) on page 152. 15.16.2.5Debugging with software watchdog enabled...
CHAPTER 15 Device specifics 15.16.4 STM32F4xxx These devices are Cortex-M4 based. All devices of this family are supported by J-Link. 15.16.4.1ETM init The following sequence can be used to prepare STM32F4xxx devices for 4-bit ETM tracing: int v; // Enable GPIOE clock *((volatile int *)(0x40023830)) = 0x00000010;...
Link GDBServer this needs to be done manually. 15.17.1.1Selecting the device in the IDE When using J-Link in an IDE, there is usually a way to directly select the device in the IDE, since it usually also needs this information for peripheral register view etc. The selected device is then usually automatically passed to the J-Link DLL.
Needs a J-Link script file to guarantee proper functionality. J-Link script file can be found at $JLINK_INST_DIR$\Samples\JLink\Scripts. For more information about how to use J-Link script files, please refer to Executing J- Link script files on page 220. 15.17.5 TMS470M Needs a J-Link script file to guarantee proper functionality.
Needs a J-Link script file to guarantee proper functionality. J-Link script file can be found at $JLINK_INST_DIR$\Samples\JLink\Scripts For more information about how to use J-Link script files, please refer to Executing J- Link script files on page 220. 15.17.7 OMAP3550 Needs a J-Link script file to guarantee proper functionality.
Not con- This pin is not connected in J-Link. nected JTAG Reset. Output from J-Link to the Reset signal of the target JTAG port. Typically connected to nTRST of the target nTRST Output CPU.
Page 419
420. Table 16.1: J-Link / J-Trace pinout Pins 4, 6, 8, 10, 12, 14, 16, 18, 20 are GND pins connected to GND in J-Link. They should also be connected to GND in the target system. 16.1.1.1 Target board design We strongly advise following the recommendations given by the chip manufacturer.
Page 420
Pin 19 of the connector can be used to supply power to the target hardware. Supply voltage is 5V, max. current is 300mA. The output current is monitored and protected against overload and short-circuit. Power can be controlled via the J-Link com- mander. The following commands are available to control power:...
422. Table 16.3: J-Link / J-Trace SWD pinout Pins 4, 6, 8, 10, 12, 14, 16, 18, 20 are GND pins connected to GND in J-Link. They should also be connected to GND in the target system. J-Link / J-Trace (UM08001)
Page 422
Pin 19 of the connector can be used to supply power to the target hardware. Supply voltage is 5V, max. current is 300mA. The output current is monitored and protected against overload and short-circuit. Power can be controlled via the J-Link commander. The following commands are available to control power: Command...
422. Table 16.5: J-Link / J-Trace SWD pinout Pins 4, 6, 8, 10, 12, 14, 16, 18, 20 are GND pins connected to GND in J-Link. They should also be connected to GND in the target system. J-Link / J-Trace (UM08001)
Target power supply on page 420. Table 16.6: J-Link / J-Trace pinout Pins 4, 6, 8, 10, 12 are GND pins connected to GND in J-Link. They should also be connected to GND in the target system. J-Link / J-Trace (UM08001)
Typically connected to TDI of the target CPU. For CPUs Output which do not provide TDI (SWD-only devices), this pin is not used. J-Link will ignore the signal on this pin when using SWD. Not connected inside J-Link. Leave open on target hard- ware.
Pins 11 and 13 of the connector can be used to supply power to the target hardware. Supply voltage is 5V, max. current is 300mA. The output current is monitored and protected against overload and short-circuit. Power can be controlled via the J-Link commander. The following commands are available to control power: Command...
Typically connected to TDI of the target CPU. For CPUs Output which do not provide TDI (SWD-only devices), this pin is not used. J-Link will ignore the signal on this pin when using SWD. By default, TRST is not connected, but the Cortex-M...
16.5 Reference voltage (VTref) VTref is the target reference voltage. It is used by the J-Link to check if the target has power, to create the logic-level reference for the input comparators and to con- trol the output logic levels to the target. It is normally fed from Vdd of the target board and must not have a series resistor.
CHAPTER 16 Target interfaces and adapters 16.6 Adapters There are various adapters available for J-Link as for example the JTAG isolator, the J-Link RX adapter or the J-Link Cortex-M adapter. For more information about the different adapters, please refer to http://www.segger.com/jlink-adapters.html.
No additional special trace port is required, so that the ETB can be read via J-Link. The trace functionality via J-Link is limited by the size of the ETB. While capturing runs, the trace information in the buffer will be overwritten every time the buffer size has been reached.
RDI (Remote debug interface) is a standard for "debug transfer agents" such as J- Link. It allows using J-Link from any RDI compliant debugger. RDI by itself does not include download to flash. To debug in flash, you need to somehow program your application program (debuggee) into the flash.
Every time you connect to J-Link / J-Trace, JLinkARM.dll checks if its embedded firm- ware is newer than the one used the J-Link / J-Trace. The DLL will then update the firmware automatically. This process takes less than 3 seconds and does not require a reboot.
19.3.3 J-Link GDBServer optimized version When using J-Link GDBServer with a GDB-based environment, there is a third imple- mentation for semihosting available which is a hybrid of the other implementations, combining the advantages of both. With this implementation, an SVC instruction with the usual SVC reason is used to issue a semihosting call but the debugger does not set a breakpoint or vector catch on the start of the SVC exception handler.
Page 457
One hardware breakpoint is not available for debugging / stepping as it is perma- nently used while semihosting is enabled. Only works with J-Link GDBServer as other debuggers do not support this specialized version. 19.3.3.1 SVC exception handler sample code...
19.5 Enabling semihosting in J-Link GDBServer By default, semihosting is disabled in J-Link GDBServer. Depending on the mecha- nism to be used, different setups are necessary 19.5.1 SVC variant The following commands need to be added to the gdbinit file that is executed at the...
The S bit in $vector_catch has no effect unless semihosting is disabled. $semihosting_vector This variable controls the location of the breakpoint set by J-Link RDI to detect a semihosted SWI. It is set to the SWI entry in the exception vector table () by default.
Support and FAQs This chapter contains troubleshooting tips as well as solutions for common problems which might occur when using J-Link / J-Trace. There are several steps you can take before contacting support. Performing these steps can solve many problems and often eliminates the need for assistance.
12. Start JLink.exe . 13. If JLink.exe displays the J-Link / J-Trace serial number and the target proces- sor’s core ID, the J-Link / J-Trace is working properly and cannot be the cause of your problem. 14. If the problem persists and you own an original product (not an OEM version), see section Contacting support on page 469.
Page 468
CHAPTER 20 Support and FAQs J-Link/J-Trace does not get any connection to the target Most likely reasons: a.) The JTAG cable is defective. b.) The target hardware is defective. Remedy: Follow the steps described in General procedure on page 467.
General procedure on page 467. You may also try your J-Link / J-Trace with another PC and if possible with another target system to see if it works there. If the device functions correctly, the USB setup on the original machine or your target hardware is the source of the problem, not J-Link / J-Trace.
Can J-Link / J-Trace read back the status of the JTAG pins? Yes, the status of all pins can be read. This includes the outputs of J-Link / J-Trace as well as the supply voltage, which can be useful to detect hardware problems on the target system.
Page 472
Glossary Adaptive clocking A technique in which a clock signal is sent out by J-Link / J-Trace. J-Link / J-Trace waits for the returned clock before generating the next clock pulse. The technique allows the J-Link / J-Trace interface unit to adapt to differing signal drive capabilities and differing cable lengths.
Page 474
The electronic clock signal which times data on the TAP data lines TMS, TDI, and TDO. The electronic signal input to a TAP controller from the data source (upstream). Usu- ally, this is seen when connecting the J-Link / J-Trace Interface Unit to the first TAP controller. J-Link / J-Trace (UM08001)
Page 475
The electronic signal output from a TAP controller to the data sink (downstream). Usually, this is seen connecting the last TAP controller to the J-Link / J-Trace Inter- face Unit. Test Access Port (TAP) The port used to access a device's TAP Controller. Comprises TCK, TMS, TDI, TDO, and nTRST (optional).
Need help?
Do you have a question about the J-Link and is the answer not in the manual?
Questions and answers