User Guide of The J-Link RDI Interface For J-Link ARM Emulator
User Guide of The J-Link RDI Interface For J-Link ARM Emulator
User Guide of The J-Link RDI Interface For J-Link ARM Emulator
Document: UM08004
www.segger.com
2
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.
© 2002 - 2008 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
Manual versions
This manual describes the latest software version. If any error occurs, please inform
us and we will try to assist you as soon as possible.
For further information on topics or routines not yet specified, please contact us.
Software versions
Refers to Release.html for information about the changes of the software versions.
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 document describes J-Link RDI. It provides an overview over the major features
of J-Link RDI, gives you some background information about Flash breakpoints and
configuration in general and describes using RDI compliant debuggers with J-Link
RDI. Finally, the chapter Support on page 83 helps to troubleshoot common prob-
lems.
Typographic conventions for syntax
This manual uses the following typographic conventions:
emUSB
USB device stack
A USB stack designed to work on any
embedded system with a USB client
controller. Bulk communication and
most standard device classes are sup-
ported.
Table of Contents
1 Introduction ....................................................................................................................11
1.1 What is RDI?........................................................................................... 12
1.1.1 Features of J-Link RDI .............................................................................. 12
1.2 Requirements.......................................................................................... 12
1.3 Basic principles ....................................................................................... 13
1.4 Purchase ................................................................................................ 13
1.5 Required licenses..................................................................................... 13
2 Licensing........................................................................................................................15
2.1 Introduction............................................................................................ 16
2.2 Software components requiring a license .................................................... 16
2.3 License types .......................................................................................... 16
2.3.1 Built-in license ........................................................................................ 17
2.3.2 Key-based license.................................................................................... 17
2.3.3 Device-based license................................................................................ 17
4 Configuration..................................................................................................................41
4.1 Overview ................................................................................................ 42
4.1.1 Configuration file JLinkRDI.ini.................................................................... 42
4.1.2 Using different configurations .................................................................... 42
4.1.3 Using mutliple J-Links simulatenously......................................................... 42
4.2 Configuration dialog ................................................................................. 43
4.2.1 General .................................................................................................. 43
4.2.2 Init ........................................................................................................ 45
4.2.3 Comands in the macro file ........................................................................ 46
4.2.4 Example of macro file............................................................................... 46
4.2.5 JTAG...................................................................................................... 47
4.2.6 Flash configuration .................................................................................. 48
5 Flash download..............................................................................................................55
5.1 Overview ............................................................................................... 56
5.2 Why should I use RDI flash download? ....................................................... 56
5.3 Enabling flash download ........................................................................... 56
5.4 Supported flash devices ........................................................................... 56
8 Semihosting ...................................................................................................................69
8.1 Overview ............................................................................................... 70
8.2 The SWI interface ................................................................................... 70
8.2.1 Changing the semihosting SWI numbers .................................................... 71
8.3 Implementation of semihosting in J-Link RDI .............................................. 71
8.3.1 DCC semihosting..................................................................................... 71
8.4 Semihosting with AXD.............................................................................. 71
8.4.1 Using SWIs in your application .................................................................. 71
8.5 Unexpected / unhandled SWIs .................................................................. 72
10 FAQs............................................................................................................................81
10.1 FAQs...................................................................................................... 82
11 Support ........................................................................................................................83
11.1 Troubleshooting ...................................................................................... 84
11.1.1 General procedure ................................................................................... 84
11.1.2 Typical problem scenarios ......................................................................... 84
11.2 Contacting support .................................................................................. 84
12 Glossary.......................................................................................................................85
J-Flash ARM User Guide (UM08003) (UM08004) © 2002 - 2008 SEGGER Microcontroller GmbH & Co. KG
10
Chapter 1
Introduction
This chapter gives a short overview about the use of J-Link RDI, flash breakpoints
and flash download.
Host (PC)
elf.gif
USB
J-Link
JTAG
ARM
1.2 Requirements
Host System
In order to use J-Link RDI you need a host system running Windows 2000 or Win-
dows XP with SEGGER’s J-Link USB driver and a RDI compliant debugger.
Target System
An ARM7 or ARM9 target system is required. The system should have a 20-pin con-
nector as defined by ARM Ltd. Please note that Segger offers an optional adapter to
use J-Link ARM with targets using 14 pin 0.1" mating JTAG connectors.
1.4 Purchase
The J-Link ARM software and documentation pack includes the J-Link RDI software.
You can download the J-Link ARM software and documentation pack from:
http://www.segger.com/downloads.html
Chapter 2
Licensing
This chapter describes the licensing requirements and options of the software.
2.1 Introduction
J-Link functionality can be enhanced by the features RDI, flash download and flash
breakpoints. These features do not come with J-Link and need additional licenses. In
this chapter the licensing options of the software will be explained.
This J-Link for example, has built-in licenses for RDI, flash download (FlashDL ) and
flash breakpoints ( FlashBP ).
If Enter license is chosen, the RDI license management dialog opens and the license
key can be added as described in chapter License (J-Link RDI License managment)
on page 44.
If one of the features flash download and flash breakpoints is used and no license is
found, an appropriate error dialog appears.
For more information about the J-Link RDI configuration dialog, please refer to chap-
ter Configuration dialog on page 43.
Manufacturer Name
NXP LPC2101
NXP LPC2102
NXP LPC2103
NXP LPC2104
NXP LPC2105
NXP LPC2106
NXP LPC2109
NXP LPC2114
NXP LPC2119
NXP LPC2124
NXP LPC2129
NXP LPC2131
NXP LPC2132
NXP LPC2134
NXP LPC2136
NXP LPC2138
NXP LPC2141
NXP LPC2142
NXP LPC2144
NXP LPC2146
Table 2.1: Device list
Manufacturer Name
NXP LPC2148
NXP LPC2194
NXP LPC2212
NXP LPC2214
NXP LPC2292
NXP LPC2294
NXP LPC2364
NXP LPC2366
NXP LPC2368
NXP LPC2378
NXP LPC2468
NXP LPC2478
Table 2.1: Device list
Chapter 3
This chapter describes how to use J-Link ARM with different debuggers via RDI.
The J-Link RDI software is an ARM Remote Debug Interface (RDI) for J-Link ARM. It
makes it possible to use J-Link ARM with any RDI compliant debugger. The package
consists of 2 DLLs, which need to be copied to the same folder. In order to use these
DLLs, they need to be selected in the debugger. J-Link RDI is a separate item and not
included in the J-Link ARM software.
2. Choose Project | Options and select the Debugger category. Change the
Driver option to RDI.
3. Go to the RDI page of the Debugger options, select the manufacturer driver
( JLinkRDI.dll ) and click OK .
4. Now an extra menu, RDI, has been added to the menu bar.
Choose RDI | Configure to configure the J-Link. For details refer to the configu-
ration chapter.
J-Link may also be selected directly in the debugger of the IAR Embedded Workbench
IDE; RDI can be used, but is not necessary to use the IAR Embedded Workbench IDE
with J-Link ARM unless you want to use one of the features offered by J-Link RDI
(e.g. flash breakpoints or flash download).
Debugging on Cortex-M3 devices
The RDI protocol has only been specified by ARM for ARM 7/9 cores. For Cortex-M3
there is no official extension of the RDI protocol regarding the register assignement,
that has been approved by ARM. Since IAR EWARM version 5.11 it is possible to use
J-Link RDI for Cortex-M3 devices because SEGGER and IAR have been come to an
agreement regarding the RDI register assignment for Cortex-M3. The following table
lists the register assignment for RDI and Cortex-M3:
Register
Assigned register
Index
0 R0
1 R1
2 R2
3 R3
4 R4
5 R5
6 R6
7 R7
8 R8
9 R9
10 R10
11 R11
12 R12
13 MSP / PSP (depending on mode)
14 R14 (LR)
16 R15 (PC)
17 XPSR
18 APSR
19 IPSR
20 EPSR
21 IAPSR
22 EAPSR
23 IEPSR
24 PRIMASK
25 FAULTMASK
26 BASEPRI
27 BASEPRI_MAX
28 CFBP (CONTROL/FAULT/BASEPRI/PRIMASK)
Table 3.1:
Flash download and flash breakpoints are also available for RDI with Cortex-M3, but
each needs an additional license.
3.1.3 Limitations
Their are no known limitations. All features including download into flash (add.
license) and breakpoints in flash memory (add. license) can be used.
4. Select J-Link and press OK to connect to the target via J-Link ARM. To configure
J-Link RDI refer to the chapter Configuration on page 41. After downloading an
image to the target board, the debugger window looks as follows:
3.2.3 Limitations
Their are no known limitations. All features including download into flash (add.
license) and breakpoints in flash memory (add. license) can be used.
3. In the Connection Control dialog use the right mouse click on the first item and
select Add/Remove/Edit Devices
4. Now select Add DLL to add the JLinkRDI.dll . Select the installation path of the
software, for example:
C:\Program Files\SEGGER\JLinkARM_V350g\JLinkRDI.dll
5. After adding the DLL, an additional Dialog opens and asks for description: (These
values are voluntary, if you do not want change them, just click OK ) Use the fol-
lowing values and click on OK , Short Name: JLinkRDI Description: J-Link
ARM RDI Interface .
7. Click the OK button in the configuration dialog. Now close the RDI Target List
dialog. Be sure your target hardware is already connected to J-Link.
8. In the Connection control dialog, expand the JLink ARM RDI Interface and
select the ARM_0 Processor. Close the Connection Control Window.
10. A project or an image is needed for debugging. After downloading, J-Link is used
to debug the target.
3.3.3 Limitations
Their are no known limitations. All features including download into flash (add.
license) and breakpoints in flash memory (add. license) can be used.
3. The Create a new Connection Method will be opened. Enter a name for your
configuration in the Name field and select Custom in the Type list. Confirm your
choice with the Create... button.
4. The Connection Editor dialog will be opened. Enter rdiserv in the Server field
and enter the following values in the Arguments field:
-config -dll <FullPathToJLinkDLLs>
Note that JLinkRDI.dll and JLinkARM.dll must be stored in the same directory.
If you have used the standard J-Link installation path or another path that
includes spaces, enclose the path in quotation marks.
Example:
-config -dll "C:\Program Files\SEGGER\JLinkARM_V350g\JLinkRDI.dll"
Refer to GHS manual "MULTI: Configuring Connections for ARM Targets", chapter
"ARM Remote Debug Interface (rdiserv) Connections" for the complete list of
possible arguments.
5. Confirm your choices by clicking the Apply button and click afterwards the Con-
nect button.
6. The J-Link RDI Configuration dialog will be opened. J-Link RDI requires a valid
license. If you do not have entered your J-Link RDI license, click License and
add your license with the J-Link RDI License management . Refer to chapter
Configuration on page 41 for further information about the options of the J-Link
RDI Configuration dialog and the usage of the License Manager.
3.4.3 Limitations
Their are no known limitations. All features including download into flash (add.
license) and breakpoints in flash memory (add. license) can be used.
Choose RDI Interface Driver from the list as shown above and click the Settings
button. 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 detailed information about
the confiiguration of J-Link RDI, refer to chapter Configuration on page 41.
After finishing configuration, you can build your project (Project | Build Target )
and start the debugger ( Debug | Start/Stop debug session ).
Click the Settings button and select J-Link Flash Programmer in the Select Flash
Programmer dialog. Confirm your choice with a click on the OK button.
Refer to subchapter Flash configuration on page 48 for detailed information about the
configuration of the flash programming feature.
3.5.3 Limitations
Their are no known limitations. All features including download into flash (add.
license) and breakpoints in flash memory (add. license) can be used.
Chapter 4
Configuration
4.1 Overview
This chapter provides a short overview about the configuration abilities of J-Link RDI.
Normally, the default settings can be used.
4.2.1 General
4.2.1.2 About
Opens the "About" window.
2. Click the Add license button and enter your license. Confirm your input by click-
ing the OK button.
4.2.2 Init
4.2.5 JTAG
Note: If you use the adaptive clocking feature, transmission delays, gate delays,
and synchronization requirements result in a lower maximum clock frequency than
with non-adaptive clocking. Do not use adaptive clocking unless it is required by the
hardware design.
4.2.7 Breakpoints
An info window can be displayed while flash breakpoints are used showing the cur-
rent operation. Depending on your JTAG speed the info window may only hardly to be
seen.
4.2.8 CPU
nents, causing unexpected interrupts or worse, the hardware may have been initial-
ized with illegal values. In some of these cases, such as illegal PLL settings, the CPU
may be operated beyond specification, possibly locking the CPU.
Available reset strategies
The following reset strategies, described in detail below, are available:
• Hardware, halt after reset (normal)
• Hardware, halt after reset using WP
• Hardware, halt after reset using DBGRQ
• Hardware, halt with BP@
• Software, for Analog Devices ADuC7xxx MCUs
• No reset
Hardware, halt after reset (normal)
The hardware reset pin is used to reset the CPU. After reset release, J-Link continu-
ously tries to halt the CPU. This typically halts the CPU shortly after reset release;
the CPU can in most systems execute some instructions before it is halted. The num-
ber of instructions executed depends primarily on the JTAG speed: the higher the
JTAG speed, the faster the CPU can be halted.
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.
Hardware, halt after reset using WP
The hardware RESET pin is used to reset the CPU. After reset release, J-Link continu-
ously tries to halt the CPU. This typically halts the CPU shortly after reset release;
the CPU can in most systems execute some instructions before it is halted.
The number of instructions executed depends primarily on the JTAG speed: the
higher the JTAG speed, the faster the CPU can be halted. Some CPUs can actually be
halted before executing any instruction, because the start of the CPU is delayed after
reset release.
Hardware, halt after reset using DBGRQ
The hardware RESET pin is used to reset the CPU. After reset release, J-Link continu-
ously tries to halt the CPU. This typically halts the CPU shortly after reset release;
the CPU can in most systems execute some instructions before it is halted.
The number of instructions executed depends primarily on the JTAG speed: the
higher the JTAG speed, the faster the CPU can be halted. Some CPUs can actually be
halted before executing any instruction, because the start of the CPU is delayed after
reset release.
Hardware, halt with BP@0
The hardware reset pin is used to reset the CPU. Before doing so, the ICE breaker is
programmed to halt program execution at address 0; effectively a breakpoint is set
at address 0. If this strategy works, the CPU is actually halted before executing a sin-
gle instruction.
This reset strategy does not work on all systems for two reasons:
• If nRESET and nTRST are coupled, either on the board or the CPU itself, reset
clears the breakpoint, which means the CPU is not stopped after reset.
• Some MCUs contain a bootloader program (sometimes called kernel), which
needs to be executed to enable JTAG access.
Software, for Analog Devices ADuC7xxx MCUs
The following sequence is executed:
• The CPU is halted
• A software reset sequence is downloaded to RAM
4.2.9 Log
A log file can be generated for J-Link ARM and J-Link RDI. This log files may be useful
for debugging and evaluating. They may help you to solve a problem yourself but is
also needed by the support to help you with it.
Default path of the J-Link ARM log file: c:\JLinkARM.log
Default path of the J-Link RDI log file: c:\JLinkRDI.log
Example of logfile content:
060:028 (0000) Logging started @ 2005-10-28 07:36
060:028 (0000) DLL Compiled: Oct 4 2005 09:14:54
060:031 (0026) ARM_SetMaxSpeed - Testing speed 3F0F0F0F 3F0F0F0F 3F0F0F0F 3F0F0F0F
3F0F0F0F 3F0F0F0F 3F0F0F0F 3F0F0F0F 3F0F0F0F 3F0F0F0F 3F0F0F0F 3F0F0F0FAuto JTAG
speed: 4000 kHz
060:059 (0000) ARM_SetEndian(ARM_ENDIAN_LITTLE)
060:060 (0000) ARM_SetEndian(ARM_ENDIAN_LITTLE)
060:060 (0000) ARM_ResetPullsRESET(ON)
060:060 (0116) ARM_Reset(): SpeedIsFixed == 0 -> JTAGSpeed = 30kHz >48> >2EF>
060:176 (0000) ARM_WriteIceReg(0x02,00000000)
060:177 (0016) ARM_WriteMem(FFFFFC20,0004) -- Data: 01 06 00 00 - Writing 0x4 bytes
@ 0xFFFFFC20 >1D7>
060:194 (0014) ARM_WriteMem(FFFFFC2C,0004) -- Data: 05 1C 19 00 - Writing 0x4 bytes
@ 0xFFFFFC2C >195>
060:208 (0015) ARM_WriteMem(FFFFFC30,0004) -- Data: 07 00 00 00 - Writing 0x4 bytes
@ 0xFFFFFC30 >195>
060:223 (0002) ARM_ReadMem (00000000,0004)JTAG speed: 4000 kHz -- Data: 0C 00 00 EA
060:225 (0001) ARM_WriteMem(00000000,0004) -- Data: 0D 00 00 EA - Writing 0x4 bytes
@ 0x00000000 >195>
060:226 (0001) ARM_ReadMem (00000000,0004) -- Data: 0C 00 00 EA
060:227 (0001) ARM_WriteMem(FFFFFF00,0004) -- Data: 01 00 00 00 - Writing 0x4 bytes
@ 0xFFFFFF00 >195>
060:228 (0001) ARM_ReadMem (FFFFF240,0004) -- Data: 40 05 09 27
060:229 (0001) ARM_ReadMem (FFFFF244,0004) -- Data: 00 00 00 00
060:230 (0001) ARM_ReadMem (FFFFFF6C,0004) -- Data: 10 01 00 00
060:232 (0000) ARM_WriteMem(FFFFF124,0004) -- Data: FF FF FF FF - Writing 0x4 bytes
@ 0xFFFFF124 >195>
060:232 (0001) ARM_ReadMem (FFFFF130,0004) -- Data: 00 00 00 00
060:233 (0001) ARM_ReadMem (FFFFF130,0004) -- Data: 00 00 00 00
060:234 (0001) ARM_ReadMem (FFFFF130,0004) -- Data: 00 00 00 00
060:236 (0000) ARM_ReadMem (FFFFF130,0004) -- Data: 00 00 00 00
060:237 (0000) ARM_ReadMem (FFFFF130,0004) -- Data: 00 00 00 00
060:238 (0001) ARM_ReadMem (FFFFF130,0004) -- Data: 00 00 00 00
060:239 (0001) ARM_ReadMem (FFFFF130,0004) -- Data: 00 00 00 00
060:240 (0001) ARM_ReadMem (FFFFF130,0004) -- Data: 00 00 00 00
060:241 (0001) ARM_WriteMem(FFFFFD44,0004) -- Data: 00 80 00 00 - Writing 0x4 bytes
@ 0xFFFFFD44 >195>
060:277 (0000) ARM_WriteMem(00000000,0178) -- Data: 0F 00 00 EA FE FF FF EA ...
060:277 (0000) ARM_WriteMem(000003C4,0020) -- Data: 01 00 00 00 02 00 00 00 ... -
Writing 0x178 bytes @ 0x00000000
060:277 (0000) ARM_WriteMem(000001CC,00F4) -- Data: 30 B5 15 48 01 68 82 68 ... -
Writing 0x20 bytes @ 0x000003C4
060:277 (0000) ARM_WriteMem(000002C0,0002) -- Data: 00 47
060:278 (0000) ARM_WriteMem(000002C4,0068) -- Data: F0 B5 00 27 24 4C 34 4D ... -
Writing 0xF6 bytes @ 0x000001CC
060:278 (0000) ARM_WriteMem(0000032C,0002) -- Data: 00 47
060:278 (0000) ARM_WriteMem(00000330,0074) -- Data: 30 B5 00 24 A0 00 08 49 ... -
Writing 0x6A bytes @ 0x000002C4
060:278 (0000) ARM_WriteMem(000003B0,0014) -- Data: 00 00 00 00 0A 00 00 00 ... -
Writing 0x74 bytes @ 0x00000330
060:278 (0000) ARM_WriteMem(000003A4,000C) -- Data: 14 00 00 00 E4 03 00 00 ... -
Writing 0x14 bytes @ 0x000003B0
060:278 (0000) ARM_WriteMem(00000178,0054) -- Data: 12 4A 13 48 70 B4 81 B0 ... -
Writing 0xC bytes @ 0x000003A4
060:278 (0000) ARM_SetEndian(ARM_ENDIAN_LITTLE)
060:278 (0000) ARM_SetEndian(ARM_ENDIAN_LITTLE)
060:278 (0000) ARM_ResetPullsRESET(OFF)
060:278 (0009) ARM_Reset(): - Writing 0x54 bytes @ 0x00000178 >3E68>
060:287 (0001) ARM_Halt(): **** Warning: Chip has already been halted.
...
Chapter 5
Flash download
This chapter describes how to use flash download with J-Link RDI. It basically allows
a debugger to download program into flash even if the debugger does not have a
flash loader. This feature requires a separate license from SEGGER.
5.1 Overview
J-Link RDI flash download allows a debugger to download program into flash even if
the debugger does not have a flash loader. This way any RDI compliant debugger can
be used to download into any supported flash memory. From a debuggers perspec-
tive, the flash download works just like download to RAM; the flash programming is
handled completely by the J-Link RDI software.
Flash download is a feature of the J-Link RDI software, which requires a separate
license from SEGGER.
Chapter 6
This chapter describes how to configure and use breakpoints in flash memory.
6.1 Introduction
The J-Link RDI software contains an additional feature, called flash breakpoints
(short FlashBPs). Flash breakpoints allow the user to set an unlimited number of
software breakpoints when debugging in flash memory, rather than just the 2 hard-
ware breakpoints. Setting the breakpoints in flash is executed very fast using a RAM
code specifically designed for this purpose; on chips with fast flash, the difference
between breakpoints in RAM and flash is unnoticeable. This feature requires an addi-
tional license from SEGGER.
located in the same flash sector, which allows programming multiple breakpoints by
programming just a single sector. The contents of program memory are cached,
avoiding time consuming reading of the flash sectors. A smart combination of soft-
ware and hardware breakpoints allows us to use hardware breakpoints a lot of times,
especially when the debugger is source level-stepping, avoiding reprogramming
flash in these situations. A built-in instruction set simulator further reduces the num-
ber of flash operations which need to be performed. This minimizes delays for the
user, maximizing the life time of the flash. All resources of the ARM micro are avail-
able to the application program, no memory is lost for debugging. All of the optimiza-
tions described above can be disabled.
2. Set the Enable flash programming checkbox and select your processor in the
Device list. Afterwards select the Breakpoint tab.
3. Select Use software breakpoints as well as Use flash breakpoints . Then click
the OK button to close the J-Link RDI configuration dialog.
4. You can now use flash breakpoints with the debugger of your choice.
Chapter 7
Device specifics
7.1.1 ADuC7xxx
J-Link RDI includes "ready-to-use" projects for all supported devices. For a complete
list of supported devices, open J-Link RDI configuration dialog and check the device
list of the Flash programming tab (refer to Flash configuration on page 48 for
detailed information). If you miss the support of a particular device, do not hesitate
to contact Segger.
Refer to J-Link / J-Trace User Guide for device specifics which are not related to flash
programming.
7.2 ATMEL
J-Link RDI flash programming supports the ATMEL AT91SAM7 core family.
7.2.1 AT91SAM7
J-Link RDI includes "ready-to-use" projects for all supported devices. For a complete
list of supported devices, open J-Link RDI configuration dialog and check the device
list of the Flash programming tab (refer to Flash configuration on page 48 for
detailed information). If you miss the support of a particular device, do not hesitate
to contact Segger.
Refer to J-Link / J-Trace User Guide for device specifics which are not related to flash
programming.
7.3 NXP
J-Link RDI flash programming supports the NXP LPC core family.
7.3.1 LPC2xxx
J-Link RDI includes "ready-to-use" projects for all supported devices. For a complete
list of supported devices, open J-Link RDI configuration dialog and check the device
list of the Flash programming tab (refer to Flash configuration on page 48 for
detailed information). If you miss the support of a particular device, do not hesitate
to contact Segger.
Moreover J-Link RDI includes a device-based license for NXP LPC21xx-LPC24xx
devices which includes a free license for RDI, flash download and flash breakpoints.
For more information about the device-based license and how to enable it, please
refer to chapter Device-based license on page 17.
Refer to J-Link / J-Trace User Guide for device specifics which are not related to flash
programming.
7.4 OKI
J-Link RDI flash programming supports the OKI ML67Q40x core family.
7.4.1 ML67Q40x
J-Link RDI includes "ready-to-use" projects for all supported devices. For a complete
list of supported devices, open J-Link RDI configuration dialog and check the device
list of the Flash programming tab (refer to Flash configuration on page 48 for
detailed information). If you miss the support of a particular device, do not hesitate
to contact Segger.
Refer to J-Link / J-Trace User Guide for device specifics which are not related to flash
programming.
7.5 ST Microelectronics
J-Link RDI flash programming supports the ST Microelectronics STR71x, STR73x,
STR75x and the STR91x core families.
7.5.4 STR91x
J-Link RDI includes "ready-to-use" projects for all supported devices. For a complete
list of supported devices, open J-Link RDI configuration dialog and check the device
list of the Flash programming tab (refer to Flash configuration on page 48 for
detailed information). If you miss the support of a particular device, do not hesitate
to contact Segger.
Refer to J-Link / J-Trace User Guide for device specifics which are not related to flash
programming.
7.6.1 TMS470
J-Link RDI includes "ready-to-use" projects for all supported devices. For a complete
list of supported devices, open J-Link RDI configuration dialog and check the device
list of the Flash programming tab (refer to Flash configuration on page 48 for
detailed information). If you miss the support of a particular device, do not hesitate
to contact Segger.
Refer to J-Link / J-Trace User Guide for device specifics which are not related to flash
programming.
Chapter 8
Semihosting
8.1 Overview
Semihosting
Semihosting is a mechanism for ARM targets to communicate input/output requests
from application code to a host computer running a debugger. This mechanism is
used, to allow functions in the C library, such as printf() and scanf() , to use the
screen and keyboard of the host rather than having a screen and keyboard on the
target system.
This is useful because development hardware often does not have all the input and
output facilities of the final system. Semihosting allows the host computer to provide
these facilities.
Semihosting is also used for Disk I/O and flash programming; a flash loader uses
semihosting to load the target program from disk.
Semihosting is implemented by a set of defined software interrupt (SWI) operations.
The application invokes the appropriate SWI and the debug agent then handles the
SWI exception. The debug agent provides the required communication with the host.
In many cases, the semihosting SWI will be invoked by code within library functions.
Usage of semihosting
The application can also invoke the semihosting SWI directly. Refer to the C library
descriptions in the ADS Compilers and Libraries Guide for more information on sup-
port for semihosting in the ARM C library.
Semihosting is not used by all tool chains; most modern tool chains (such as IAR)
use different mechanisms to achive the same goal.
Semihosting is used primarily by ARM’s tool chain and debuggers, such as AXD.
Since semihosting has been used primarily by ARM, documents published by ARM are
the best source of add. information.
For further information on semihosting and the C libraries, see the "C and C++
Libraries" chapter in ADS Compilers and Libraries Guide. Please see also the "Writing
Code for ROM" chapter in ADS Developer Guide.
This typically indicates that your application is using SWIs not only for semihosting,
but also for other purposes, but J-Link RDI stops on every SWI, which is inefficient
and affects the real-time behaviour of your application program. This is discouraged;
you should follow the instruction in the message box.
Chapter 9
Background information
This chapter provides background information about JTAG and ARM. The ARM7 and
ARM9 architecture is based on Reduced Instruction Set Computer (RISC) principles.
The instruction set and related decode mechanism are greatly simplified compared
with microprogrammed Complex Instruction Set Computer (CISC).
9.1 JTAG
JTAG is the acronym for Joint Test Action Group. In the scope of this document,
"the JTAG standard" means compliance with IEEE Standard 1149.1-2001.
The test clock input (TCK) provides the clock for the test
TCK Input
logic.
Serial test instructions and data are received by the test
TDI Input
logic at test data input (TDI).
Reset
tm s=1
tm s=0
tm s=1 tm s=1
Capture-DR Capture-IR
tm s=0 tm s=0
Shift-DR Shift-IR
Exit1-DR Exit1-IR
tm s=1 tm s=1
tm s=0 tm s=0
Pause-DR Pause-IR
tm s=0 tm s=0
Exit2-DR Exit2-IR
tm s=1 tm s=1
Update-DR Update-IR
Exit1-DR
Temporary controller state.
Pause-DR
The shifting of the test data register between TDI and TDO is temporarily halted.
Exit2-DR
Temporary controller state. Allows to either go back into Shift-DR state or go on to
Update-DR.
Update-DR
Data contained in the currently selected data register is loaded into a latched parallel
output (for registers that have such a latch). The parallel latch prevents changes at
the parallel output of these registers from occurring during the shifting process.
Capture-IR
Instructions may be loaded in parallel into the instruction register.
Shift-IR
The instruction register shifts the values in the instruction register towards TDO with
each clock.
Exit1-IR
Temporary controller state.
Pause-IR
Wait state that temporarily halts the instruction shifting.
Exit2-IR
Temporary controller state. Allows to either go back into Shift-IR state or go on to
Update-IR.
Update-IR
The values contained in the instruction register are loaded into a latched parallel out-
put from the shift-register path. Once latched, this new instruction becomes the cur-
rent one. The parallel latch prevents changes at the parallel output of the instruction
register from occurring during the shifting process.
User/ Fast
Supervisor Abort Undefined Interrupt
System interrupt
R0
R1
R2
R3
R4
R5
R6
R7
R8 R8_fiq
R9 R9_fiq
R10 R10_fiq
R11 R11_fiq
R12 R12_fiq
R13 R13_svc R13_abt R13_und R13_irq R13_fiq
R14 R14_svc R14_abt R14_und R14_irq R14_fiq
PC
CPSR
SPSR_svc SPSR_abt SPSR_und SPSR_irq SPSR_fiq
Table 9.2: ARM CPU registers
= indicates that the normal register used by User or System mode has been
replaced by an alternative register specific to the exception mode.
9.3 EmbeddedICE
EmbeddedICE is a set of registers and comparators used to generate debug excep-
tions (such as breakpoints).
EmbeddedICE is programmed in a serial fashion using the ARM core controller. It
consists of two real-time watchpoint units, together with a control and status regis-
ter. You can program one or both watchpoint units to halt the execution of instruc-
tions by ARM core. Two independent registers, debug control and debug status,
provide overall control of EmbeddedICE operation.
Execution is halted when a match occurs between the values programmed into
EmbeddedICE and the values currently appearing on the address bus, data bus, and
various control signals. Any bit can be masked so that its value does not affect the
comparison.
Either of the two real-time watchpoint units can be configured to be a watchpoint
(monitoring data accesses) or a breakpoint (monitoring instruction fetches). You can
make watchpoints and breakpoints data-dependent.
EmbeddedICE is an additional debug hardware within the core, therefore the Embed-
dedICE debug architecture requires almost no target resources (for example, mem-
ory, access to exception vectors, and time).
For more information about EmbeddedICE please see the technical reference manual
of your ARM CPU. (www.arm.com)
9.4.2.3 J-Link RDI Flash download - Allows flash download from any
RDI-compliant tool chain.
RDI (Remote Debug Interface) is a standard for "debug transfer agents" such as J-
Link ARM. The J-Link RDI software allows using J-Link ARM from any RDI compliant
debugger. You can use the flash download option integrated in the J-Link RDI soft-
ware to download your application program into flash memory.
The J-Link RDI software as well as the flash download option require licenses from
SEGGER.
Chapter 10
FAQs
You can find in this chapter a collection of frequently asked questions (FAQs)
together with answers.
10.1 FAQs
Q: Which CPUs are supported?
A: J-Link RDI is based on J-Link ARM and should work with any ARM7 / ARM9 core.
For a list of supported cores see section “Supported ARM Cores” in the J-Link ARM
manual.
Q: Which CPUs are flash breakpoint supported?
A: For a list of supported cores see section Supported flash devices on page 56.
Q: What is the advantage of flash download versus the flash loader that comes with
my IDE?
A: In a lot of cases, the J-LINK RDI flash download is significantly faster than that
provided by the IDE. Another advantage is that it uses the same flash program-
ming code being used for flash breakpoints, so it is very easy to set up flash
breakpoints if you are already using J-Link RDI flash download.
Chapter 11
Support
This chapter contains troubleshooting tips together with solutions for common prob-
lems which might occur when using J-Link RDI. There are several steps you can take
before contacting support. Performing these steps can solve many problems and
often eliminates the need for assistance.
11.1 Troubleshooting
11.1.1 General procedure
If you experience problems with J-Link RDI, you should follow the steps below to
solve these problems:
1. Close all running applications on your host system.
2. Disconnect the J-Link ARM device from USB.
3. Power-off target.
4. Re-connect J-Link ARM with host system (attach USB cable).
5. Power-on target.
6. Try your target application again. If the problem vanished, you are done; other-
wise continue.
7. Close all running applications on your host system again.
8. Disconnect the J-Link ARM device from USB.
9. Power-off target.
10. Re-connect J-Link ARM with host system (attach USB cable).
11. Power-on target.
12. Start JLink.exe.
13. If JLink.exe reports the J-Link ARM serial number and the target processor’s
core ID, your J-Link ARM is working properly and cannot be the cause of the
problem.
14. If JLink.exe is unable to read the target processor’s core ID you should analyze
the communication between your target and J-Link ARM with a logic analyzer or
oscilloscope. Follow the instructions in chapter "Support|Signal analysis" in the J-
Link ARM users manual.
15. If your problem persists and you own an original Segger J-Link ARM (not an OEM
version), see section Contacting support on page 84.
Chapter 12
Glossary
IR
See Instruction Register.
Joint Test Action Group (JTAG)
The name of the standards group which created the IEEE 1149.1 specification.
Little-endian
Memory organization where the least significant byte of a word is at a lower address
than the most significant byte. See also Big-endian.
Memory coherency
A memory is coherent if the value read by a data read or instruction fetch is the
value that was most recently written to that location. Memory coherency is made dif-
ficult when there are multiple possible physical locations that are involved, such as a
system that has main memory, a write buffer and a cache.
Memory management unit (MMU)
Hardware that controls caches and access permissions to blocks of memory, and
translates virtual to physical addresses.
Memory Protection Unit (MPU)
Hardware that controls access permissions to blocks of memory. Unlike an MMU, an
MPU does not translate virtual addresses to physical addresses.
Multi-ICE
Multi-processor EmbeddedICE interface. ARM registered trademark.
nSRST
Abbreviation of System Reset. The electronic signal which causes the target system
other than the TAP controller to be reset. This signal is known as nSYSRST in some
other manuals. See also nTRST.
nTRST
Abbreviation of TAP Reset. The electronic signal that causes the target system TAP
controller to be reset. This signal is known as nICERST in some other manuals. See
also nSRST.
Open collector
A signal that may be actively driven LOW by one or more drivers, and is otherwise
passively pulled HIGH. Also known as a "wired AND" signal.
Processor Core
The part of a microprocessor that reads instructions from memory and executes
them, including the instruction fetch unit, arithmetic and logic unit and the register
bank. It excludes optional coprocessors, caches, and the memory management unit.
Program Status Register (PSR)
Contains some information about the current program and some information about
the current processor. Often, therefore, also referred to as Processor Status Register.
Is also referred to as Current PSR (CPSR), to emphasize the distinction between it
and the Saved PSR (SPSR). The SPSR holds the value the PSR had when the current
function was called, and which will be restored when control is returned.
Remapping
Changing the address of physical memory or devices after the application has started
executing. This is typically done to allow RAM to replace ROM once the initialization
has been done.
Remote Debug Interface (RDI)
RDI is an open ARM standard procedural interface between a debugger and the
debug agent. The widest possible adoption of this standard is encouraged.
Scan Chain
A group of one or more registers from one or more TAP controllers connected
between TDI and TDO, through which test data is shifted.
Semihosting
A mechanism whereby the target communicates I/O requests made in the application
code to the host system, rather than attempting to support the I/O itself.
SWI
Software Interrupt. An instruction that causes the processor to call a programer-
specified subroutine. Used by ARM to handle semihosting.
TAP Controller
Logic on a device which allows access to some or all of that device for test purposes.
The circuit functionality is defined in IEEE1149.1.
Target
The actual processor (real silicon or simulated) on which the application program
isrunning.
TCK
The electronic clock signal which times data on the TAP data lines TMS, TDI, and
TDO.
TDI
The electronic signal input to a TAP controller from the data source (upstream). Usu-
ally this is seen connecting the Multi-ICE Interface Unit to the first TAP controller.
TDO
The electronic signal output from a TAP controller to the data sink (downstream).
Usually this is seen connecting the last TAP controller to the Multi-ICE Interface Unit.
Test Access Port (TAP)
The port used to access a device's TAP Controller. Comprises TCK, TMS, TDI, TDO and
nTRST (optional).
Transistor-transistor logic (TTL)
A type of logic design in which two bipolar transistors drive the logic output to one or
zero. LSI and VLSI logic often used TTL with HIGH logic level approaching +5V and
LOW approaching 0V.
Watchpoint
A location within the image that will be monitored and that will cause execution to
stop when it changes.
Word
A 32-bit unit of information. Contents are taken as being an unsigned integer unless
otherwise stated.
Index
A JTAG ................................................. 74
Adaptive clocking .................................86 TAP controller ................................... 75
Application Program Interface ................86
ARM L
Processor modes ...............................77 Little-endian ....................................... 87
Registers ..........................................77
Thumb instruction set ........................78
M
Memory coherency .............................. 87
B Memory management unit (MMU) ......... 87
Big-endian ..........................................86 Memory Protection Unit (MPU) .............. 87
Multi-ICE ........................................... 87
C
Cache cleaning ....................................86 N
Coprocessor ........................................86 nSRST ............................................... 87
nTRST ............................................... 87
D
Dirty data ...........................................86 O
Dynamic Linked Library (DLL) ................86 Open collector .................................... 87
E P
EmbeddedICE ............................... 78, 86 Processor Core ................................... 87
Program Status Register (PSR) ............. 87
H
Host ...................................................86 R
Remapping ......................................... 88
I Remote Debug Interface (RDI) .............. 88
ICache ...............................................86
ICE Extension Unit ...............................86 S
ID .....................................................86 Scan Chain ......................................... 88
IEEE 1149.1 ........................................86 Semihosting ....................................... 88
Image ................................................86 Support ............................. 69, 81, 83, 85
In-Circuit Emulator ..............................86 SWI .................................................. 88
Instruction Register ..............................86 Syntax, conventions used ....................... 5
IR ......................................................87
T
J TAP Controller .................................... 88
J-Link Target ............................................... 88
FAQs ......................................... 70, 82 TCK ................................................... 88
Features ...........................................12 TDI ................................................... 88
Joint Test Action Group (JTAG) ...............87 TDO .................................................. 88
W
Watchpoint ....................................78, 88
Word ................................................. 88