Segger J-Link User Manual
Hide thumbs Also See for J-Link:
Table of Contents

Advertisement

J-Link / J-Trace
User Guide
Software Version V4.82
Manual Rev. 1
Date: March 10, 2014
Document: UM08001
A product of SEGGER Microcontroller GmbH & Co. KG
www.segger.com

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the J-Link and is the answer not in the manual?

Questions and answers

Summary of Contents for Segger J-Link

  • Page 1 J-Link / J-Trace User Guide Software Version V4.82 Manual Rev. 1 Date: March 10, 2014 Document: UM08001 A product of SEGGER Microcontroller GmbH & Co. KG www.segger.com...
  • Page 2 Disclaimer Copyright notice © Trademarks Contact address http://www.segger.com Revisions J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 3 Revision Date Explanation J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 4 Revision Date Explanation J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 5 Revision Date Explanation J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 6 Revision Date Explanation J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 7 Revision Date Explanation J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 8 Revision Date Explanation J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 9 Revision Date Explanation J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 10 Revision Date Explanation J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 11 Revision Date Explanation J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 12 J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 13: About This Document

    About this document Support and FAQs Typographic conventions Style Used for Keyword Reference GUIElement Table 1.1: Typographic conventions J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 14 The de-facto standard debug probe J-Trace embOS Debug probe with trace capabilities Real Time Operating System J-Link / J-Trace Related Software emFile File system emUSB USB device stack J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 15 Table of Contents 1 Introduction ........................21 2 Licensing........................47 J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 16 3 J-Link software and documentation package..............61 4 Setup..........................115 J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 17 5 Working with J-Link and J-Trace..................133 6 Flash download......................185 J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 18 7 Flash breakpoints......................199 8 RDI..........................205 9 Device specifics ......................237 J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 19 10 Target interfaces and adapters ..................271 11 Background information .....................287 12 Designing the target board for trace ................301 J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 20 13 Support and FAQs .....................305 14 Glossary........................311 15 Literature and references...................317 J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 21: Introduction

    Chapter 1 Introduction J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 22 CHAPTER 1 Introduction Requirements Host System Supported Target System Model comparison J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 23 Supported OS J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 24: J-Link / J-Trace Models

    CHAPTER 1 Introduction J-Link / J-Trace models JLink.exe J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 25: Model Comparison

    Model comparison Hardware features J-Link J-Link J-Link J-Trace J-Link J-Trace Plus ULTRA+ for Cortex-M Software features J-Trace J-Link J-Link J-Link J-Link J-Trace PLUS ULTRA+ Cortex-M Flash download Flash breakpoints J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 26: Additional Features

    1.3.2.1 Additional features 1.3.2.2 Specifications General Supported OS Mechanical Available interfaces JTAG/SWD Interface, Electrical For the whole target voltage range (1.2V <= V <= 5V) Table 1.1: J-Link specifications J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 27: Hardware Versions

    For 3.6 <= V <= 5V JTAG/SWD Interface, Timing Table 1.1: J-Link specifications 1.3.2.3 Hardware versions Versions 1-4 (Obsolete) Version 5.0 (Obsolete) Version 5.2 (Obsolete) Version 5.3 (Obsolete) J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 28 CHAPTER 1 Introduction Version 5.4 (Obsolete) Version 6.0 (Obsolete) Version 7.0 (Obsolete) Version 8.0 Version 9.1 Version 9.2 J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 29: J-Link Ultra

    1.3.3 J-Link ULTRA+ 1.3.3.1 Additional features 1.3.3.2 Specifications Note: General Supported OS Mechanical Available interfaces JTAG/SWD Interface, Electrical Table 1.2: J-link ULTRA specifications J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 30 For 1.8V <= V <= 3.6V For 3.6 <= V <= 5V JTAG/SWD Interface, Timing Analog power measurement interface Table 1.2: J-link ULTRA specifications 1.3.4 J-Link PRO 1.3.4.1 Additional features J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 31 1.3.4.2 Hardware versions Version 1.1 Version 4 Version 4.3 1.3.5 J-Link Lite ARM 1.3.5.1 Additional features 1.3.5.2 Specifications General Supported OS Mechanical Table 1.3: J-Link Lite specifications J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 32: J-Link Lite Cortex-M

    Introduction JTAG/SWD Interface, Electrical JTAG/SWD Interface, Timing Table 1.3: J-Link Lite specifications 1.3.6 J-Link Lite Cortex-M 1.3.6.1 Specifications General Supported OS Mechanical Table 1.4: J-Link Lite Cortex-M specifications J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 33 JTAG/SWD Interface, Electrical JTAG/SWD Interface, Timing Table 1.4: J-Link Lite Cortex-M specifications 1.3.7 J-Trace ARM 1.3.7.1 Additional features 1.3.7.2 Specifications for J-Trace General Supported OS Mechanical Table 1.5: J-Trace specifications J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 34 CHAPTER 1 Introduction JTAG/SWD Interface, Electrical Table 1.5: J-Trace specifications J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 35: Download Speed

    1.3.7.3 Download speed Hardware ARM7 via JTAG ARM9 via JTAG Table 1.6: Download speed differences between hardware revisions Mea- suring download speed 1.3.7.4 Hardware versions Version 1 J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 36 CHAPTER 1 Introduction 1.3.8 J-Trace for Cortex-M 1.3.8.1 Additional features 1.3.8.2 Specifications General Mechanical JTAG/SWD Interface, Electrical JTAG/SWD Interface, Timing Table 1.7: J-Trace for Cortex-M3 specifications J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 37 Trace Interface, Timing Table 1.7: J-Trace for Cortex-M3 specifications 1.3.8.3 Download speed Hardware Cortex-M3 Table 1.8: Download speed differences between hardware revisions 1.3.8.4 Hardware versions Version 2 Version 3.1 J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 38: Flasher Arm

    For the whole target voltage range (1.8V <= V <= 5V) For 1.8V <= V <= 3.6V For 3.6 <= V <= 5V SWD Interface, Electrical Table 1.9: Flasher ARM specifications J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 39: J-Link Coldfire

    Table 1.9: Flasher ARM specifications 1.3.10 J-Link ColdFire UM08009, J-Link ColdFire BDM26 User’s Guide J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 40: Common Features Of The J-Link Product Family

    CHAPTER 1 Introduction Common features of the J-Link product family J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 41: Supported Cpu Cores

    Supported CPU cores J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 42: Built-In Intelligence For Supported Cpu-Cores

    CHAPTER 1 Introduction Built-in intelligence for supported CPU-cores 1.6.1 Intelligence in the J-Link firmware 1.6.2 Intelligence on the PC-side (DLL) J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 43 1.6.2.1 Limitations of PC-side implementations Instability, especially on slow targets Poor performance No support Note: J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 44: Firmware Intelligence Per Model

    1.6.3 Firmware intelligence per model 1.6.3.1 Current models Cortex- Renesas Cortex-M J-Link / J-Trace RX600 model JTAG JTAG JTAG JTAG JTAG Table 1.10: Built-in intelligence of current J-Links J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 45: Older Models

    1.6.3.2 Older models Cortex- Renesas Cortex-M J-Link / J-Trace RX600 model JTAG JTAG JTAG JTAG JTAG Table 1.11: Built-in intelligence of older J-Link models J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 46: Supported Ides

    Debug Trace Flash Flash download breakpoints support support ARM Cortex-M3 Debug Trace Flash Flash download breakpoints support support support ARM11 Debug Trace Flash Flash download breakpoints support support J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 47: Licensing

    Chapter 2 Licensing J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 48 CHAPTER 2 Licensing Components requiring a license FlashBP J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 49: License Types

    License types Built-in License Key-based license www.segger.com. Licensing 2.2.1 Built-in license JLink.exe 2.2.2 Key-based license Licensing J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 50: Legal Use Of Segger J-Link Software

    CHAPTER 2 Licensing Legal use of SEGGER J-Link software Use of software 2.3.1 Use of the software with 3rd party tools J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 51: Original Segger Products

    Original SEGGER products 2.4.1 J-Link Licenses 2.4.2 J-Link PLUS Licenses J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 52 CHAPTER 2 Licensing 2.4.3 J-link ULTRA+ Licenses 2.4.4 J-Link PRO Licenses J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 53: J-Trace For Cortex-M

    2.4.5 J-Trace Licenses 2.4.6 J-Trace for Cortex-M Licenses J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 54 CHAPTER 2 Licensing 2.4.7 Flasher ARM Licenses 2.4.9 Flasher RX Licenses J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 55: Flasher Ppc

    2.4.10 Flasher PPC Licenses J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 56: J-Link Oem Versions

    CHAPTER 2 Licensing J-Link OEM versions 2.5.1 Analog Devices: mIDASLink Limitations Licenses 2.5.2 Atmel: SAM-ICE Limitations Licenses J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 57: Digi: Jtag Link

    2.5.3 Digi: JTAG Link Limitations Licenses 2.5.4 IAR: J-Link / J-Link KS Limitations Licenses 2.5.5 IAR: J-Link Lite Limitations Licenses Note: J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 58: Nxp: J-Link Lite Lpc Edition

    CHAPTER 2 Licensing 2.5.6 IAR: J-Trace Limitations Licenses 2.5.7 NXP: J-Link Lite LPC Edition Limitations Licenses 2.5.8 SEGGER: J-Link Lite ARM Limitations Licenses Note J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 59 J-Link OBs J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 60: Illegal Clones

    CHAPTER 2 Licensing Illegal Clones J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 61: J-Link Software And Documenta- Tion Package

    Chapter 3 J-Link software and documenta- tion package www.segger.com J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 62: Software Overview

    J-Flash ARM User’s Guide (UM08003) J-Link Configurator Table 3.1: J-Link / J-Trace related software a. Full-featured J-Link (PLUS, PRO, ULTRA+) or an additional license for J-Link base model required. J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 63: J-Link Commander (Command Line Tool)

    J-Link Commander (Command line tool) JLink.exe 3.2.1 Command line options -CommandFile Syntax -CommanderScript <CommandFilePath> Example Using command files -Device http://www.segger.com/jlink_supported_devices.html. Syntax -Device <DeviceName> Example JLink.exe -Device STM32F103ZE J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 64: Using Command Files

    JLink.exe -IP 192.168.1.17 Additional information <IPAddr> -SelectEmuBySN Syntax -SelectEmuBySN <SerialNo> Example JLink.exe -SelectEmuBySN 580011111 -Speed Syntax -Speed <Speed_kHz> Example JLink.exe -Speed 4000 3.2.2 Using command files J-Link script files J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 65 Example JLink.exe -CommanderScript C:\CommandFile.jlink exec device = STM32F103ZE loadbin C:\firmware.bin,0x08000000 J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 66: J-Link Gdb Server

    CHAPTER 3 J-Link software and documentation package J-Link GDB Server http://www.gnu.org/software/gdb/download/ 3.3.1 J-Link GDB Server CL J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 67: Debugging With J-Link Gdb Server

    3.3.2 Debugging with J-Link GDB Server 3.3.2.1 Setting up GDB Server Note: -device J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 68 (assembler, linker, C compiler) and especially the debugger and the debugger frontend of your choice. We do not answer questions about how to install and use the chosen toolchain. emIDE J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 69 #Initially reset the target monitor reset #Load the application load http://emide.org Console target remote localhost:2331 http://sourceware.org/gdb/current/onlinedocs/gdb/ J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 70 (gdb) break main Breakpoint 1 at 0x800037a: file Src\main.c, line 38. (gdb) continue Continuing. Breakpoint 1, main () at Src\main.c:38 Cnt = 0; (gdb) Eclipse (CDT) http:// www.eclipse.org/cdt/ http://www.eclipse.org Note: J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 71 IOClient semihosting ARMSWI semihosting ThumbSWI setargs setbp sleep speed step SWO DisableTarget SWO EnableTarget SWO GetMaxSpeed SWO GetSpeedInfo waithalt wice Table 3.2: GDB remote commands J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 72 CHAPTER 3 J-Link software and documentation package Remote command Explanation device Note: -device interface Note: speed Note: -speed Table 3.3: GDB remote commands Note: Note: Note: ’#’ ’>’ ’<’ J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 73 > monitor cp15 1, 2, 6, 7 = 0xFFFFFFFF 3.3.3.3 device Note: -device Syntax device <DeviceName> Description Note: -device Example > monitor device STM32F417IG < Selecting device: STM32F417IG 3.3.3.4 DisableChecks Syntax DisableChecks J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 74 #No arguments set via setargs: > monitor getargs < No arguments. #Arguments set via setargs: > monitor getargs < Arguments: test 0 1 2 arg0=4 3.3.3.8 go Syntax J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 75 #Select the second device, where there is 1 device in front with IRLen 4 > monitor jtagconf 4 1 3.3.3.12 memU8 Syntax MemU8 <address> [= <value>] Description <value> J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 76 > monitor memU32 0x50000000 = 0x10023004 < Writing 0x10023004 @ address 0x50000000 3.3.3.15 reg Syntax reg <RegName> [= <value>] reg <RegName> [= (<address>)] Description <value> <address> <address> <RegName> J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 77 IRQ: R13=00200100, R14=00000000, SPSR=00000010 UND: R13=00200100, R14=00000000, SPSR=00000010 3.3.3.17 reset Syntax reset Description Add. information Example > monitor reset < Resetting target 3.3.3.18 semihosting breakOnError Syntax semihosting breakOnerror <Value> J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 78 #Select TELNET port and GDB as output source > monitor semihosting ioclient 3 < Semihosting I/O set to TELNET and GDB Client 3.3.3.21 semihosting ARMSWI Syntax semihosting ARMSWI <Value> J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 79 <Addr> [<Mask>] Description <Mask> Example #Set a breakpoint (implicit for ARM instructions) > monitor setbp 0x00000000 #Set a breakpoint on a THUMB instruction > monitor setbp 0x00000100 0x01 J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 80 < Target interface speed set to 4000 kHz > monitor speed adaptive < Select adaptive clocking instead of fixed JTAG speed 3.3.3.27 step Syntax step [<NumSteps>] si [<NumSteps>] Description <NumSteps> Example > monitor step 3 J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 81 < SWO enabled succesfully. 3.3.3.30 SWO GetMaxSpeed Syntax Description Example #Get SWO speed for 72MHz CPU speed > monitor SWO GetMaxSpeed 72000000 < Maximum supported SWO speed is 6000000 Hz. J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 82 J-Link software and documentation package 3.3.3.31 SWO GetSpeedInfo Syntax SWO GetSpeedInfo Description Example > monitor SWO GetSpeedInfo < Base frequency: 60000000Hz, MinDiv: 8 # Available SWO speeds for J-Link are: 7.5MHz, 6.66MHz, 6MHz, ... 3.3.3.32 waithalt Syntax waithalt <Timeout> wh <Timeout> Description <Timeout> Example #Wait for halt with a timeout of 2 seconds >...
  • Page 83: Segger-Specific Gdb Protocol Extensions

    3.3.4 SEGGER-specific GDB protocol extensions Query Packet Explanation qSeggerSTRACE:config qSeggerSTRACE:start qSeggerSTRACE:stop qSeggerSTRACE:read Table 3.4: General Queries J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 84 Parameter Description Note: UM08002 STRACE Response <ReturnValue> Note: 3.3.4.2 qSeggerSTRACE:start Syntax qSeggerSTRACE:start Description Note: UM08002 STRACE Response <ReturnValue> Note: 3.3.4.3 qSeggerSTRACE:stop Syntax qSeggerSTRACE:stop Description Note: UM08002 STRACE J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 85 Response <ReturnValue> Note: 3.3.4.4 qSeggerSTRACE:read Syntax qSeggerSTRACE:read:<NumItems> Parameter Description Note: UM08002 STRACE Response <ReturnValue>[<Item0><Item1>...] Note: J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 86 Table 3.6: Port selection command line options Note: Command line option Explanation -noir -localhostonly -nolocalhostonly -logtofile -nologtofile -silent -nosilent -stayontop -nostayontop -novd Table 3.7: Persistent command line options J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 87 Command line option Explanation -jtagconf -log -notimeout -singlerun -scriptfile -select -settingsfile -cpu -device Table 3.8: General command line options J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 88 CPU_FAMILY_RX600 Table 3.9: GDB allowed values for CPUCore 3.3.5.2 -device Description Note: Syntax -device <DeviceName> Example jlinkgdbserver -device AT91SAM7SE256 Add. information http://www.seg- <DeviceName> ger.com/jlink_supported_devices.html 3.3.5.3 -endian Description Note: J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 89 -ir 3.3.5.6 -jtagconf Syntax -jtagconf <IRPre>,<DRPre> Description <IRPre> <DRPre> Example #Select the second device, where there is 1 device in front with IRLen 4 jlinkgdbserver -jtagconf 4,1 J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 90 Description Syntax -log <LogFilePath> Example jlinkgdbserver -log “C:\my path\to\file.log” 3.3.5.9 -logtofile Description -log Note: Syntax -logtofile Example jlinkgdbserver -logtofile jlinkgdbserver -logtofile -log “C:\my path\to\file.log” 3.3.5.10 -noir Description Note: J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 91 -nologtofile -log “C:\pathto\file.log” // Will generate a log file jlinkgdbserver -log “C:\pathto\file.log” -nologtofile // Will not generate a log file 3.3.5.13 -nosilent Description Note: Syntax -nosilent 3.3.5.14 -nostayontop Description Note: Note: J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 92 3.3.5.16 -novd Description Note: Syntax 3.3.5.17 -port Description Note: Syntax -port <Port> Example jlinkgdbserver -port 2345 3.3.5.18 -scriptfile Description J-Link script files Syntax -scriptfile <ScriptFilePath> Example -scriptfile “C:\My Projects\Default.JLinkScript“ J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 93 -select usb=580011111 jlinkgdbserver -select ip=192.168.1.10 Additional information 3.3.5.20 -settingsfile Description Syntax -SettingsFile <PathToFile> Example jlinkgdbserver -SettingsFile "C:\Temp\GDB Server.jlink" 3.3.5.21 -silent Description Note: Syntax -silent 3.3.5.22 -singlerun Description Syntax -singlerun J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 94 -speed 2000 3.3.5.24 -stayontop Description Note: Note: Syntax -stayontop 3.3.5.25 -swoport Description Note: Syntax -SWOPort <Port> Example jlinkgdbserver -SWOPort 2553 3.3.5.26 -telnetport Description Note: Syntax -TelnetPort <Port> J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 95 -TelnetPort 2554 3.3.5.27 -vd Description Note: Syntax 3.3.5.28 -x Description Syntax -x <ConfigurationFilePath> Example jlinkgdbserver -x C:\MyProject\Sample.gdb 3.3.5.29 -xc Description Syntax -xc <ConfigurationFilePath> Example jlinkgdbserver -xc C:\MyProject\Sample.gdb J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 96: J-Link Remote Server

    3.4.1 List of available commands Command Description port Table 3.10: Available commands 3.4.1.1 port Syntax -port <Portno.> Example -port 19021 3.4.1.2 usb Syntax -usb <USBIndex> Example -usb 2 J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 97: Tunneling Mode

    3.4.2 Tunneling mode Target Debugger SEGGER tunnel server TCP/IP- Debugger Server Internet USB/Ethernet J-Link JTAG Target Example scenario J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 98 CHAPTER 3 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 ip tunnel:<SerialNo> J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 99 Troubleshooting Problem Solution Table 3.11: J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 100: J-Mem Memory Viewer

    CHAPTER 3 J-Link software and documentation package J-Mem Memory Viewer J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 101 J-Flash http://www.segger.com J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 102: J-Link Swo Viewer

    CHAPTER 3 J-Link software and documentation package J-Link SWO Viewer 3.7.0.1 J-Link SWO Viewer CL List of available command line options J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 103 List of available command line options Command Description cpufreq device itmmask itmport outputfile settingsfile swofreq Table 3.12: Available command line options 3.7.2.1 cpufreq Syntax -cpufreq <CPUFreq> Example -cpufreq 96000000 3.7.2.2 device J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 104 -itmmask 0x5 3.7.2.4 itmport Syntax -itmport <ITMPortIndex> Example -itmport 0 3.7.2.5 outputfile Syntax -outputfile <PathToFile> Example -outputfile "C:\Temp\Output.log" 3.7.2.6 settingsfile Syntax -settingsfile <PathToFile> Example -settingsfile "C:\Temp\Settings.jlink" 3.7.2.7 swofreq J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 105: Configure Swo Output After Device Reset

    Target example code for terminal output /********************************************************************* SEGGER MICROCONTROLLER GmbH & Co KG Solutions for real time microcontroller applications ********************************************************************** (c) 2012-2013 SEGGER Microcontroller GmbH & Co KG www.segger.com Support: support@segger.com J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 106 // Check if stimulus port is enabled if ((ITM_ENA & 1) == 0) { return; // Wait until STIMx is ready, // then send data while ((ITM_STIM_U8 & 1) == 0); ITM_STIM_U8 = c; J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 107 /********************************************************************* SWO_PrintString() * Function description Print a string via SWO. void SWO_PrintString(const char *s) { // Print out character per character while (*s) { SWO_PrintChar(*s++); J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 108: Swo Analyzer

    CHAPTER 3 J-Link software and documentation package SWO Analyzer SWOAnalyzer.exe Usage SWOAnalyzer.exe <SWOfile> Creating an SWO output file [SWO] SWOLogFile="C:\TestSWO.dat" J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 109: Jtagload (Command Line Tool)

    JTAGLoad (Command line tool) J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 110: J-Link Rdi (Remote Debug Interface)

    J-Link software and documentation package 3.10 J-Link RDI (Remote Debug Interface) Note: 3.10.1 Flash download and flash breakpoints J-Link RDI User’s Guide (UM08004) Flash download Breakpoints in flash memory J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 111: Processor Specific Tools

    3.11 Processor specific tools 3.11.1 J-Link STR91x Commander (Command line tool) JLinkSTR91x.exe 3.11.1.1 Command line options -CommandFile J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 112: J-Link Stm32 Unlock (Command Line Tool)

    -IRPost 20 Syntax -IP <IPAddr> Example JLinkSTR91x.exe -IP 192.168.1.17 Additional information <IPAddr> -SelectEmuBySN Syntax -SelectEmuBySN <SerialNo> Example JLinkSTR91x.exe -SelectEmuBySN 580011111 3.11.2 J-Link STM32 Unlock (Command line tool) JLinkSTM32.exe J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 113 Note: J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 114: J-Link Software Developer Kit (Sdk)

    CHAPTER 3 J-Link software and documentation package 3.12 J-Link Software Developer Kit (SDK) www.segger.com J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 115 Chapter 4 Setup J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 116: Installing The J-Link Software And Documentation Pack

    CHAPTER 4 Setup Installing the J-Link software and documentation pack www.segger.com J-Link software and documentation package 4.1.1 Setup procedure Note: http://www.segger.com/download_jlink.html Setup_JLinkARM_V<VersionNumber>.zip. Setup_JLinkARM_V<Version- Number>.exe license Agreement J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 117 Next > Choose Destina- tion Location C:\Program Files\SEG- GER\JLinkARM_V<VersionNumber> Next > Choose options Install J-Link Serial Port Driver Create entry in start menu Add shortcuts to desktop Next > J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 118 CHAPTER 4 Setup J-Link DLL updater Installation Complete Finish > J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 119: Setting Up The Usb Interface

    Setting up the USB interface 4.2.1 Verifying correct driver installation JLink.exe J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 120: Uninstalling The J-Link Usb Driver

    Support and FAQs Driver 4.2.2 Uninstalling the J-Link USB driver Unknown Device Add/Remove Programs Start > Settings > Control Panel > Add/Remove Programs Windows Driver Package - Segger J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 121 (jlink) USB Change/Remove J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 122: Setting Up The Ip Interface

    CHAPTER 4 Setup Setting up the IP interface 4.3.1 Configuring J-Link using J-Link Configurator J-Link Configurator 4.3.2 Configuring J-Link using the webinterface Home J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 123 Network configuration automatic manual J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 124 CHAPTER 4 Setup FAQs J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 125: J-Link Configurator

    J-Link Configurator 4.5.1 Configure J-Links using the J-Link Configurator J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 126 CHAPTER 4 Setup Note: J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 127: J-Link Usb Identification

    J-Link USB identification Background information Identification Serial number Table 4.1: J-Link enumeration in different identification modes 4.6.1 Connecting to different J-Links connected to the same host PC via USB J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 128 CHAPTER 4 Setup J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 129: Using The J-Link Dll

    Using the J-Link DLL 4.7.1 What is the JLink DLL? J-LinkARM.dll 4.7.2 Updating the DLL in third-party programs 4.7.2.1 Updating the J-Link DLL in the IAR Embedded Workbench for ARM (EWARM) LinkARM.dll arm\bin C:\Program Files\IAR Systems\Embedded Work- bench 6.n\arm\bin\ Determining which DLL is used by a program J-Link DLL updater JLinkARM.dll...
  • Page 130: Determining The Version Of Jlink Dll

    CHAPTER 4 Setup 4.7.3 Determining the version of JLink DLL Properties Version 4.7.4 Determining which DLL is used by a program www.sysinternals.com J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 131 Getting started with J-Link and ARM DS-5 4.8.1 Replacing the RDDI DLL manually $JLINK_INST_DIR$\RDDI\ManualInstallation.txt. 4.8.2 Using J-Link in DS-5 Development Studio Debug Configurations... Bare Metal Debug, Debug via DSTREAM/RVI Browse... Connection JLinkUSB:174200001 :Device J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 132 CHAPTER 4 Setup STM32F103ZG Apply Files Debugger Debug from entry point Apply J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 133 Chapter 5 Working with J-Link and J-Trace J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 134: Connecting The Target System

    CHAPTER 5 Working with J-Link and J-Trace Connecting the target system 5.1.1 Power-on sequence 5.1.2 Verifying target device connection JLink.exe JLink.exe 5.1.3 Problems Support and FAQs Support and FAQs J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 135 Indicators 5.2.1 Main indicator J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 136 5.2.1.1 Single color indicator (J-Link V7 and earlier) Indicator status Meaning Table 5.1: J-Link single color main indicator 5.2.1.2 Bi-color indicator (J-Link V8) Indicator status Meaning Table 5.2: J-Link single color LED main color indicator J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 137: Input Indicator

    5.2.2.1 Bi-color input indicator Indicator status Meaning Table 5.3: J-Link bi-color input indicator 5.2.3 Output indicator 5.2.3.1 Bi-color output indicator Indicator status Meaning Table 5.4: J-Link bi-color output indicator J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 138: Jtag Interface

    Working with J-Link and J-Trace JTAG interface 5.3.1 Multiple devices in the scan chain Device 1 Device 0 JTAG 5.3.1.1 Configuration JTAG interface 5.3.2 Sample configuration dialog boxes J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 139 SEGGER J-Flash configuration dialog Options|Project J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 140 CHAPTER 5 Working with J-Link and J-Trace SEGGER J-Link RDI configuration dialog box RDI|Configure IAR J-Link configuration dialog box Project|Options J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 141: Determining Values For Scan Chain Configuration

    Device 0 JTAG Examples Device 0 Device 1 Device 2 Position IR len Chip(IR len) Chip(IR len) Chip(IR len) ARM(4) ARM(4) ARM(4) ARM(4) Table 5.5: Example scan chain configurations J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 142: Jtag Speed

    Chip(IR len) Chip(IR len) ARM(4) ARM(4) ARM(4) Table 5.5: Example scan chain configurations 5.3.4 JTAG Speed 5.3.4.1 Fixed JTAG speed 5.3.4.2 Automatic JTAG speed Note: 5.3.4.3 Adaptive clocking J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 143: Swd Interface

    5.4.2.1 Max. SWO speeds J-Link> si 1 //Select target interface SWD J-Link> SWOSpeed Emulator Speed formula Resulting max. speed Table 5.6: J-Link supported SWO input speeds 5.4.2.2 Configuring SWO speeds Example1 J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 144 Working with J-Link and J-Trace SWO output SWO input Deviation percent Table 5.7: Permitted SWO speed combinations Example 2 SWO output SWO input Deviation percent Table 5.8: Permitted SWO speed combinations J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 145: How Multi-Core Debugging Works

    Multi-core debugging 5.5.1 How multi-core debugging works Host (PC) Debugger Debugger Instance 1 Instance 2 J-Link JTAG CPU0 CPU1 Target hardware J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 146: Using Multi-Core Debugging In Detail

    CHAPTER 5 Working with J-Link and J-Trace 5.5.2 Using multi-core debugging in detail Project|Options J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 147: Things You Should Be Aware Of

    Core #2 Core #3 debugger #1 debugger #2 ARM7TDMI ARM7TDMI-S ARM7TDMI ARM7TDMI ARM7TDMI-S ARM7TDMI-S Table 5.9: Multicore debugging 5.5.3 Things you should be aware of 5.5.3.1 JTAG speed J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 148 CHAPTER 5 Working with J-Link and J-Trace 5.5.3.2 Resetting the target J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 149: Connecting Multiple J-Links / J-Traces To Your Pc

    Connecting multiple J-Links / J-Traces to your PC 5.6.1 How does it work? Host (PC) Application Application Instance 1 Instance 2 J-Link J-Link JTAG JTAG CPU0 CPU1 Target hardware 1 Target hardware 2 J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 150 CHAPTER 5 Working with J-Link and J-Trace J-Link Configurator J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 151: J-Link Control Panel

    J-Link control panel 5.7.1 Tabs 5.7.1.1 General General Show tray icon Start minimized Always on top Process J-Link Target interface Endian Device License About J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 152 Skip download on CRC match J-Link FlashDL Auto Verify download J-Link FlashDL Auto Section: Flash breakpoints: FlashBP FlashBP FlashBP Auto FlashBP FlashBP FlashBP FlashBP FlashBP Show window during program J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 153 Save settings Settings Modify breakpoints during execution: Allow: Allow if CPU does not need to be halted: Ask user if CPU needs to be halted: Do not allow: J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 154 Working with J-Link and J-Trace 5.7.1.3 Break/Watch Section: Code Handle Address Mode Permission Implementation Note: Section: Data Handle Address AddrMask Address Data Data Mask Data Ctrl CtrlMask 5.7.1.4 Log J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 155 5.7.1.5 CPU Regs 5.7.1.6 Target Power J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 156 CHAPTER 5 Working with J-Link and J-Trace 5.7.1.7 SWV Status Bytes in buffer Bytes transferred Refresh counter Host buffer Emulator buffer J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 157: Reset Strategies

    Strategies for ARM 7/9 devices 5.8.1.1 Type 0: Hardware, halt after reset (normal) 5.8.1.2 Type 1: Hardware, halt with BP@0 5.8.1.3 Type 2: Software, for Analog Devices ADuC7xxx MCUs J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 158 5.8.1.6 Type 5: Hardware, halt with DBGRQ 5.8.1.7 Type 6: Software 5.8.1.8 Type 7: Reserved 5.8.1.9 Type 8: Software, for ATMEL AT91SAM7 MCUs 5.8.1.10 Type 9: Hardware, for NXP LPC MCUs J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 159: Strategies For Cortex-M Devices

    DEMCR SYSRESETREQ AIRCR S_RESET_ST DHCSR VC_CORERESET. 5.8.2.2 Type 1: Core VECTRESET VECTRESET S_RESET_ST DHCSR VC_CORERESET Note: 5.8.2.3 Type 2: ResetPin VC_CORERESET 5.8.2.4 Type 3: Connect under Reset VC_CORERESET J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 160 SYSRESETREQ AIRCR VC_CORERESET 5.8.2.9 Type 8: Reset core and peripherals SYSRESETREQ AIRCR VC_CORERESET DEMCR VC_CORERESET DEMCR SYSRESETREQ AIRCR S_RESET_ST DHCSR VC_CORERESET. 5.8.2.10 Type 9: Reset for LPC1200 devices J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 161 SYSRESETREQ AIRCR 5.8.2.11 Type 10: Reset for Samsung S3FN60D devices SYSRESETREQ VC_CORERESET J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 162: Using Dcc For Memory Access

    CHAPTER 5 Working with J-Link and J-Trace Using DCC for memory access Samples\DCC\IAR 5.9.1 What is required? JLink.exe 5.9.2 Target DCC handler DCC_Process() 5.9.3 Target DCC abort handler DCC_Abort J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 163: J-Link Script Files

    5.10.1 Actions that can be customized 5.10.1.1 ResetTarget() Decsription Prototype void ResetTarget(void); 5.10.1.2 InitEMU() Decsription Global DLL variables Prototype void InitEMU(void); 5.10.1.3 InitTarget() Decsription Prototype void InitTarget(void); 5.10.2 Script file API functions J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 164 __api__ int Report1(const char * sMsg, int v); 5.10.2.5 JTAG_SetDeviceId() Description Global DLL variables Prototype __api__ int JTAG_SetDeviceId(int DeviceIndex, unsigned int Id); 5.10.2.6 JTAG_GetDeviceId() Description Prototype __api__ int JTAG_GetDeviceId(int DeviceIndex); J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 165 __api__ int JTAG_WriteDR(unsigned __int64 tdi, int NumBits); 5.10.2.10JTAG_StoreDR() Description Global DLL variables Prototype __api__ int JTAG_StoreDR(unsigned __int64 tdi, int NumBits); 5.10.2.11JTAG_Write() Description Prototype __api__ int JTAG_Write(unsigned __int64 tms, unsigned __int64 tdi, int NumBits); J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 166 __api__ int JTAG_WriteClocks(int NumClocks); 5.10.2.15JTAG_StoreClocks() Description Prototype __api__ int JTAG_StoreClocks(int NumClocks); 5.10.2.16JTAG_Reset() Description Global DLL variables Note: Prototype __api__ int JTAG_Reset(void); 5.10.2.17SYS_Sleep() Description Prototype __api__ int SYS_Sleep(int Delayms); J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 167: Global Dll Variables

    CPU = ARM926EJS; JTAG_IRPre Example JTAG_IRPre = 6; JTAG_DRPre Example JTAG_DRPre = 2; JTAG_IRPost Example JTAG_IRPost = 6; JTAG_DRPost Example JTAG_DRPost = 0; Table 5.10: Global DLL variables J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 168 Example JTAG_TCKPin = 0; JTAG_TDIPin Example JTAG_TDIPin = 0; JTAG_TMSPin Example JTAG_TMSPin = 0; InitEmu() EMU_ETB_IsPresent Example void InitEmu(void) { EMU_ETB_IsPresent = 1; Table 5.10: Global DLL variables J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 169 CORESIGHT_AddAP() CORESIGHT_ Example IndexAHBAPToUse CORESIGHT_AddAP(0, CORESIGHT_AHB_AP); CORESIGHT_AddAP(1, CORESIGHT_AHB_AP); CORESIGHT_AddAP(2, CORESIGHT_APB_AP); // Use second AP as AHB-AP // for target communication CORESIGHT_IndexAHBAPToUse = 1; Table 5.10: Global DLL variables J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 170: Global Dll Constants

    InitTarget() Example MAIN_IsFirstIdentify if (MAIN_IsFirstIdentify == 1) { [...] } else { [...] Table 5.10: Global DLL variables 5.10.4 Global DLL constants 5.10.4.1 Constants for global variable: CPU J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 171: Script File Language

    5.10.5 Script file language 5.10.5.1 Supported Operators 5.10.5.2 Supported type specifiers 5.10.5.3 Supported type qualifiers J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 172: Script File Writing Example

    5.10.6 Script file writing example void InitTarget(void) { Report("J-Link script example."); JTAG_Reset(); // Perform TAP reset and J-Link JTAG auto-detection if (JTAG_TotalIRLen != 9) { // Basic check if JTAG chain information matches MessageBox("Can not find xxx device"); return 1;...
  • Page 173 5.10.7.2 In debugger IDE environment 5.10.7.3 In GDB Server -scriptfile <file> -scriptfile J-Link GDB Server J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 174: Command Strings

    DisableFlashBPs FlashPB EnableFlashBPs FlashPB map exclude map indirectread map ram map reset SetAllowSimulation SetCheckModeAfterRead SetResetPulseLen SetResetType SetRestartOnClose SetDbgPowerDownOnClose SetSysPowerDownOnIdle SupplyPower SupplyPowerDefault Table 5.11: Available command line options J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 175 = <DeviceID> DeviceID Supported devices Example device = AT91SAM7S256 5.11.1.2 DisableFlashBPs Syntax DisableFlashBPs 5.11.1.3 EnableFlashBPs FlashBP Syntax EnableFlashBPs 5.11.1.4 map exclude Memory mapping Syntax map exclude <SAddr>-<EAddr> Example exclude J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 176 Fast GPIO bug Syntax map indirectread <StartAddressOfArea>-<EndAddress> Example map indirectread 0x3fffc000-0x3fffcfff 5.11.1.6 map ram indirectread Typical applications Fast GPIO bug Syntax map ram <StartAddressOfArea>-<EndAddressOfArea> Example map ram 0x40000000-0x40003fff; J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 177 // Enables instruction set simulation 5.11.1.9 SetCheckModeAfterRead Typical applications Syntax SetCheckModeAfterRead = 0 | 1 Example SetCheckModeAfterRead = 0 5.11.1.10 SetResetPulseLen Syntax SetResetPulseLen = <value> Example SetResetPulseLen = 50 J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 178 SetDbgPowerDownOnClose = 1 // Enables debug power-down on close. SetDbgPowerDownOnClose = 0 // Disables debug power-down on close. 5.11.1.14 SetSysPowerDownOnIdle Note: Typical applications Syntax SetSysPowerDownOnIdle = <value> Note: <value> J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 179: Using Command Strings

    Example SetSysPowerDownOnIdle = 10; // The target CPU is powered-down when there is no // transmission between J-Link and target CPU for at least 10ms 5.11.1.15 SupplyPower Typical applications Syntax SupplyPower = 0 | 1 Example SupplyPower = 1 5.11.1.16 SupplyPowerDefault...
  • Page 180 Working with J-Link and J-Trace Example exec SupplyPower = 1 exec map reset exec map exclude 0x10000000-0x3FFFFFFF 5.11.2.2 IAR Embedded Workbench Project options Debugger Extra Options Use command line options --jlink_exec_command "<CommandLineOption>" J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 181: Switching Off Cpu Clock During Debug

    5.12 Switching off CPU clock during debug Non-synthesizable cores (ARM7TDMI, ARM9TDMI, ARM920, etc.) Synthesizable cores (ARM7TDMI-S, ARM9E-S, etc.) J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 182: Cache Coherency

    5.13.1 Cache coherency 5.13.2 Cache clean area 5.13.3 Cache handling of ARM7 cores 5.13.4 Cache handling of ARM9 cores When entering debug state When leaving debug state Note: J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 183: Virtual Com Port (Vcom)

    5.14 Virtual COM Port (VCOM) 5.14.1 Configuring Virtual COM Port Note: 5.14.1.1 Via J-Link Configurator J-Link Configurator 5.14.1.2 Via J-Link Commander vcom enable|disable J-Link Commander (Command line tool) J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 184 CHAPTER 5 Working with J-Link and J-Trace J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 185 Chapter 6 Flash download J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 186 CHAPTER 6 Flash download Introduction Why should I use the J-Link flash download feature? J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 187 Licensing J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 188: Supported Devices

    CHAPTER 6 Flash download Supported devices http://www.segger.com/jlink_supported_devices.html J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 189: Iar Embedded Workbench

    Setup for various debuggers (internal flash) 6.4.1 IAR Embedded Workbench Project->Options->General Options->Target Use flash loader(s) Project->Options->Debug- ger->Download 6.4.2 Keil MDK J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 190: Chapter 6 Flash Download

    CHAPTER 6 Flash download Project->Options for Target->Device J-Link / J-Trace Project->Options for Tar- get->Utilities J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 191 Project->Options for Target->Debug -> Download Options Settings. Verify Code Download Download to Flash 6.4.3 J-Link GDB Server .gdbinit .gdbinit monitor flash device <DeviceName> <DeviceName> Supported devices J-Link GDB Server J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 192: J-Link Commander

    CHAPTER 6 Flash download 6.4.4 J-Link Commander 6.4.4.1 Preparing J-Link Commander for flash download exec device = <DeviceName> <DeviceName> Supported devices loadbin <filename>, <addr> <Filename> <Addr> 6.4.4.2 Converting non-bin files File | Open data file... File | Save data file as...
  • Page 193 6.4.5 J-Link RDI UM08004, J-Link RDI User Guide Configuration dialog J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 194: Setup For Various Debuggers (Cfi Flash)

    Flash download Setup for various debuggers (CFI flash) 6.5.1 IAR Embedded Workbench / Keil MDK [CFI] CFISize = <FlashSize> CFIAddr = <FlashAddr> [GENERAL] WorkRAMSize = <RAMSize> WorkRAMAddr = <RAMAddr> J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 195 0xA000000C, 0x10000505 // CS2 timing reg (read access) w4 0xA000010C, 0x10000505 // CS2 timing reg (write access) speed 4000 mem 0x64000000,100 loadbin C:\STMB672_STM32F103ZE_TestBlinky.bin,0x64000000 mem 0x64000000,100 6.5.3.1 Converting non-bin files J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 196 CHAPTER 6 Flash download File | Open data file... File | Save data file as... Save J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 197 Using the DLL flash loaders in custom applica- tions UM08002 J-Link SDK J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 198 CHAPTER 6 Flash download J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 199: Flash Breakpoints

    Chapter 7 Flash breakpoints J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 200 CHAPTER 7 Flash breakpoints Introduction How do breakpoints work? What is special about software breakpoints in flash? What performance can I expect? How is this performance achieved? J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 201 Licensing Licensing 7.2.1 Free for evaluation and non-commercial use J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 202 CHAPTER 7 Flash breakpoints Supported devices http://www.segger.com/jlink_supported_devices.html J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 203 Setup & compatibility with various debuggers 7.4.1 Setup Setup for various debuggers (internal flash) 7.4.2 Compatibility with various debuggers J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 204 CHAPTER 7 Flash breakpoints J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 205 Chapter 8 J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 206 CHAPTER 8 Introduction Host (PC) Data RDI compliant File Debugger (e.g. elf) elf.gif J-Link RDI DLL JTAG 8.1.1 Features J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 207 Licensing Licensing J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 208: Setup For Various Debuggers

    CHAPTER 8 Setup for various debuggers JLinkRDI.dll JLinkRDI.dll 8.3.1 IAR Embedded Workbench IDE 8.3.1.1 Supported software versions Note: 8.3.1.2 Configuring to use J-Link RDI Project Options Debugger J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 209 Driver JLinkRDI.dll Configure Configuration J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 210 CHAPTER 8 8.3.1.3 Debugging on Cortex-M3 devices Register Assigned register Index Table 8.1: Cortex-M register mapping for IAR + J-Link RDI J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 211: Software Version

    8.3.2 ARM AXD (ARM Developer Suite, ADS) 8.3.2.1 Software version JLinkRDI.dll 8.3.2.2 Configuring to use J-Link RDI Options Configure Target... Choose Target JLinkRDI.dll J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 212 CHAPTER 8 Target Environments Configuration J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 213: Arm Rvds (Realview Developer Suite)

    8.3.3 ARM RVDS (RealView developer suite) 8.3.3.1 Software version Note: 8.3.3.2 Configuring to use J-Link RDI J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 214 CHAPTER 8 File Connection Connect to Target Connection Control Add/Remove/Edit Devices J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 215 Add DLL JLinkRDI.dll C:\Program Files\SEGGER\JLinkARM_V350g\JLinkRDI.dll OK Short Name: JLinkRDI Description: J-Link RDI Interface RDI Target List JLink-RDI Configure Configu- J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 216 CHAPTER 8 ration RDI Target List Connection control JLink ARM RDI Interface Connection Control J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 217 J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 218: Ghs Multi

    CHAPTER 8 8.3.4 GHS MULTI 8.3.4.1 Software version 8.3.4.2 Configuring to use J-Link RDI Con- nect Connection Organizer Connection Organizer J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 219 Method Connection Organizer Create a new Connection Method Name Custom Type Create... Connection Editor rdiserv Server Arguments -config -dll <FullPathToJLinkDLLs> JLinkRDI.dll JLinkARM.dll -config -dll "C:\Program Files\SEGGER\JLinkARM_V350g\JLinkRDI.dll" J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 220 CHAPTER 8 Apply Connect J-Link RDI Configuration Configuration step J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 221 8.3.5 KEIL MDK (µVision IDE) 8.3.5.1 Software version 8.3.5.2 Configuring to use J-Link RDI J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 222 CHAPTER 8 Project Options for Target ’<NameOfTarget>’ Debug RDI Interface Driver Settings JLinkRDI.dll Browse for RDI Driver DLL Configure RDI Driver Configuration J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 223 Project Build Target Debug Start/Stop debug session J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 224: Configuration Dialog

    CHAPTER 8 Configuration 8.4.1 Configuration file JLinkRDI.ini JLinkRDI.ini JLinkRDI.dll 8.4.2 Using different configurations JLinkARM.dll JLinkRDI.dll JLinkRDI.dll $PROJ_DIR$\RDI\ 8.4.3 Using mutliple J-Links simulatenously JLinkRDI.dll 8.4.4 Configuration dialog J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 225: General Tab

    8.4.4.1 General tab Connection to J-Link License (J-Link RDI License managment) License J-Link RDI License management Add license J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 226 CHAPTER 8 8.4.4.2 Init tab Macro file J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 227 * Purpose: Setup for Philips LPC2294 chip ********************************************************************** SetJTAGSpeed(1000); Reset(0); Write32(0xE01FC040, 0x00000001); // Map User Flash into Vector area at (0-3f) Write32(0xFFE00000, 0x20003CE3); // Setup CS0 Write32(0xE002C014, 0x0E6001E4); // Setup PINSEL2 Register SetJTAGSpeed(2000); J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 228 CHAPTER 8 8.4.4.3 JTAG tab JTAG speed JTAG Speed JTAG scan chain with multiple devices J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 229 8.4.4.4 Flash tab Enable flash programming Cache flash contents Allow flash download J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 230 CHAPTER 8 8.4.4.5 Breakpoints tab Use software breakpoints Use flash breakpoints J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 231 8.4.4.6 CPU tab Instruction set simulation Reset strategy Reset strategies 8.4.4.7 Log tab c:\JLinkARM.log c:\JLinkRDI.log J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 232 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. J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 233 Semihosting 8.5.1 Overview Semihosting printf() scanf() Usage of semihosting 8.5.2 The SWI interface J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 234 8.5.2.1 Changing the semihosting SWI numbers 8.5.3 Implementation of semihosting in J-Link RDI Unexpected / unhandled SWIs 8.5.3.1 DCC semihosting 8.5.4 Semihosting with AXD $semihosting_enabled $semihosting_vector 8.5.4.1 Using SWIs in your application J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 235 8.5.5 Unexpected / unhandled SWIs J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 236 CHAPTER 8 J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 237: Device Specifics

    Chapter 9 Device specifics J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 238: Analog Devices

    CHAPTER 9 Device specifics Analog Devices 9.1.1 ADuC7xxx 9.1.1.1 Software reset This information is applicable to the following devices: J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 239 J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 240 CHAPTER 9 Device specifics ATMEL J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 241 9.2.1 AT91SAM7 9.2.1.1 Reset strategy This information is applicable to the following devices: 9.2.1.2 Memory mapping This information is applicable to the following devices: 9.2.1.3 Recommended init sequence J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 242 CHAPTER 9 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...
  • Page 243 // Select master clock and processor clock Write32(0xFFFFFF60, 0x00320300); // Set flash wait states SetJTAGSpeed(12000); 9.2.2 AT91SAM9 9.2.2.1 JTAG settings This information is applicable to the following devices: J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 244 CHAPTER 9 Device specifics DSPGroup J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 245 Ember J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 246: Energy Micro

    CHAPTER 9 Device specifics Energy Micro J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 247 Freescale 9.6.1 Kinetis family 9.6.1.1 Unlocking 9.6.1.2 Tracing J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 248 FCCOB8 = 0x00; // Select IFR area to be read FSTAT = 0x80; // Start command execution while((FSTAT & 0x80) == 0); // Wait until flash controller has finished J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 249 FCCOB5 = 0x00; // FlexNVM partition code: 256 KB data flash FSTAT = 0x80; // Start command execution while((FSTAT & 0x80) == 0); // Wait until flash controller has finished J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 250 CHAPTER 9 Device specifics Fujitsu J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 251 Itron J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 252 CHAPTER 9 Device specifics Infineon J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 253: Luminary Micro

    9.10 Luminary Micro J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 254: Unlocking Lm3Sxxx Devices

    CHAPTER 9 Device specifics 9.10.1 Unlocking LM3Sxxx devices J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 255 9.11 NXP J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 256: Lpc Arm7-Based Devices

    This information is applicable to the following devices: Example Project options Debug- Use command line options Extra Options --jlink_exec_command "map ram 0x40000000-0x40003fff; map indirec- tread 0x3fffc000-0x3fffcfff; map exclude 0x3fffd000-0x3fffffff;" Command strings J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 257: Reset (Cortex-M3 Based Devices)

    9.11.1.2 RDI License types 9.11.2 Reset (Cortex-M3 based devices) 9.11.3 LPC288x flash programming 9.11.4 LPC43xx: Executing J- Link script files J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 258 CHAPTER 9 Device specifics 9.12 OKI J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 259 9.13 Renesas J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 260 CHAPTER 9 Device specifics 9.14 Samsung 9.14.1 S3FN60D J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 261 9.15 ST Microelectronics J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 262: Option Byte Programming

    |= (7 << 5); // Enable trace I/O and configure pins for 4-bit trace *((volatile int *)(0xE0042004)) = v; 9.15.2.2 Option byte programming STM32F103ZE (allow opt. bytes) J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 263: Hardware Watchdog

    PM0042, section "Option byte description". 9.15.2.3 Securing/unsecuring the device UM08003, J-Flash User Guide UM08003, J-Flash User Guide J-Link STM32 Unlock (Command line tool) Note: 9.15.2.4 Hardware watchdog J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 264 9.15.3.2 Debugging with software watchdog enabled // Configure both watchdog timers to be halted if the CPU is halted by the debugger *((volatile int *)(0xE0042008)) |= (1 << 11) | (1 << 12); J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 265 9.15.4.2 Debugging with software watchdog enabled // Configure both watchdog timers to be halted if the CPU is halted by the debugger *((volatile int *)(0xE0042008)) |= (1 << 11) | (1 << 12); J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 266: Texas Instruments

    CHAPTER 9 Device specifics 9.16 Texas Instruments 9.16.1 AM335x 9.16.1.1 Selecting the device in the IDE J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 267: Am35Xx / Am37Xx

    9.16.1.2 Selecting the device when using GDBServer before -device <DeviceName> Example: JLinkGDBServer -device AM3359 9.16.1.3 Selecting the device when using J-Link Commander device <DeviceName> 9.16.1.4 Known values for <DeviceName> 9.16.2 AM35xx / AM37xx $JLINK_INST_DIR$\Samples\JLink\Scripts Executing J- Link script files 9.16.3 OMAP4430...
  • Page 268 CHAPTER 9 Device specifics 9.16.6 OMAP3530 $JLINK_INST_DIR$\Samples\JLink\Scripts Executing J- Link script files 9.16.7 OMAP3550 $JLINK_INST_DIR$\Samples\JLink\Scripts Executing J- Link script files J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 269 9.17 Toshiba J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 270 CHAPTER 9 Device specifics J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 271: Target Interfaces And Adapters

    Chapter 10 Target interfaces and adapters J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 272: 20-Pin Jtag/Swd Connector

    D B G R Q G N D * 5 V - S u p p ly G N D * SIGNAL TYPE Description Table 10.1: J-Link / J-Trace pinout J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 273 SIGNAL TYPE Description Target power supply Table 10.1: J-Link / J-Trace pinout 10.1.1.1 Target board design Pinout for JTAG J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 274: Pull-Up/Pull-Down Resistors

    CHAPTER 10 Target interfaces and adapters 10.1.1.2 Pull-up/pull-down resistors 10.1.1.3 Target power supply Command Explanation power on power off power on perm power off perm Table 10.2: Command List J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 275: Pinout For Swd

    Not used Not used SWDIO SWCLK Not used GND* RESET GND* Not used GND* 5V-Supply GND* SIGNAL TYPE Description Target power supply Table 10.3: J-Link / J-Trace SWD pinout J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 276 10.1.2.1 Target board design Pinout for SWD 10.1.2.2 Pull-up/pull-down resistors 10.1.2.3 Target power supply Command Explanation power on power off power on perm power off perm Table 10.4: Command List J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 277: 38-Pin Mictor Jtag And Trace Connector

    Target board Target board Target board Target board Target board Trace JTAG Trace JTAG Trace JTAG connector connector connector connector connector connector Target board Target board Target board J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 278 Assignment of trace information pins between ETM archi- tecture versions Assignment of trace information pins between ETM archi- tecture versions Assignment of trace information pins between ETM archi- tecture versions Table 10.5: JTAG+Trace connector pinout J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 279 SIGNAL Description Assignment of trace information pins between ETM archi- tecture versions Table 10.5: JTAG+Trace connector pinout J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 280 Table 10.6: Assignment of trace information pins between ETM architecture versions 10.2.4 Trace signals 10.2.4.1 Signal levels 10.2.4.2 Clock frequency Parameter Min. Max. Explanation Table 10.7: Clock frequency J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 281 Parameter Min. Max. Explanation Table 10.7: Clock frequency Tperiod Full TRACECLK DATA Half-rate TRACECLK Note: J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 282: 19-Pin Jtag/Swd And Trace Connector

    SWO/TDO - - - nRESET 5V-Supply TRACECLK 5V-Supply TRACEDATA[0] TRACEDATA[1] TRACEDATA[2] TRACEDATA[3] SIGNAL TYPE Description Target power supply Target power supply Table 10.8: 19-pin JTAG/SWD and Trace pinout J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 283 Description Table 10.8: 19-pin JTAG/SWD and Trace pinout 10.3.1 Target power supply Command Explanation power on power off power on perm power off perm Table 10.9: Command List J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 284: 9-Pin Jtag/Swd Connector

    CHAPTER 10 Target interfaces and adapters 10.4 9-pin JTAG/SWD connector VTref SWDIO / TMS SWCLK / TCK SWO / TDO nRESET SIGNAL TYPE Description Table 10.10: 9-pin JTAG/SWD pinout J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 285 10.5 Adapters http://www.segger.com/jlink-adapters.html. J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 286 CHAPTER 10 Target interfaces and adapters J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 287: Background Information

    Chapter 11 Background information Reduced Instruction Set Computer Complex Instruction Set Computer J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 288: Test Access Port (Tap)

    Background information 11.1 JTAG 11.1.1 Test access port (TAP) Type Explanation Table 11.1: Test access port 11.1.2 Data registers Bypass data register Boundary-scan data register 11.1.3 Instruction register J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 289: The Tap Controller

    Exit2-DR Exit2-IR tm s=1 tm s=1 Update-DR Update-IR tm s=1 tm s=0 tm s=1 tm s=0 11.1.4.1 State descriptions Reset Idle DR-Scan IR-Scan Capture-DR Shift-DR J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 290 CHAPTER 11 Background information Exit1-DR Pause-DR Exit2-DR Update-DR Capture-IR Shift-IR Exit1-IR Pause-IR Exit2-IR Update-IR J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 291: Embedded Trace Macrocell (Etm)

    11.2 Embedded Trace Macrocell (ETM) 11.2.1 Trigger condition 11.2.2 Code tracing and data tracing Code trace Data trace 11.2.3 J-Trace integration example - IAR Embedded Work- bench for ARM J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 292 CHAPTER 11 Background information 11.2.3.1 Code coverage - Disassembly tracing J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 293 11.2.3.2 Code coverage - Source code tracing J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 294 CHAPTER 11 Background information J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 295: Embedded Trace Buffer (Etb)

    11.3 Embedded Trace Buffer (ETB) J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 296: How Does Flash Programming Via J-Link / J-Trace Work

    CHAPTER 11 Background information 11.4 Flash programming 11.4.1 How does flash programming via J-Link / J-Trace work? 11.4.2 Data download to RAM 11.4.3 Data download via DCC 11.4.4 Available options for flash programming 11.4.4.1 J-Flash - Complete flash programming solution 11.4.4.2 RDI flash loader: Allows flash download from any RDI-compliant...
  • Page 297 11.4.4.3 Flash loader of compiler / debugger vendor such as IAR 11.4.4.4 Write your own flash loader J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 298: J-Link / J-Trace Firmware

    CHAPTER 11 Background information 11.5 J-Link / J-Trace firmware 11.5.1 Firmware update 11.5.2 Invalidating the firmware Note: Note: exec InvalidateFW J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 299 JLink.exe J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 300 CHAPTER 11 Background information J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 301: Designing The Target Board For Trace

    Chapter 12 Designing the target board for trace J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 302: Overview Of High-Speed Board Design

    12.1 Overview of high-speed board design Note: 12.1.1 Avoiding stubs 12.1.2 Minimizing Signal Skew (Balancing PCB Track Lengths) 12.1.3 Minimizing Crosstalk 12.1.4 Using impedance matching and termination Terminating the trace signal J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 303: Terminating The Trace Signal

    12.2 Terminating the trace signal Matched impedance Series (source) termination DC parallel termination Caution: 12.2.1 Rules for series terminators J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 304: Signal Requirements

    CHAPTER 12 Designing the target board for trace 12.3 Signal requirements Signal Value Table 12.1: Signal requirements J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 305: Support And Faqs

    Chapter 13 Support and FAQs J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 306: Measuring Download Speed

    CHAPTER 13 Support and FAQs 13.1 Measuring download speed 13.1.1 Test environment JLink.exe J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 307: Troubleshooting

    JLink.exe Contacting support 13.2.2 Typical problem scenarios J-Link / J-Trace LED is off Meaning: Remedy: J-Link / J-Trace LED is flashing at a high frequency Meaning: Most likely reasons: Remedy: Setup J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 308 CHAPTER 13 Support and FAQs J-Link/J-Trace does not get any connection to the target Most likely reasons: Remedy: General procedure J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 309: Contacting Support

    13.3 Contacting support General procedure JLink.exe J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 310: Frequently Asked Questions

    Developer Kit (SDK) Using DCC with J-Link Read status of JTAG pins J-Link support of ETM J-Link support of ETB Registers on ARM 7 / ARM 9 targets J-Link.exe J-Link.exe J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 311: Glossary

    Chapter 14 Glossary J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 312 Application Program Interface Big-endian Cache cleaning Coprocessor Dirty data Dynamic Linked Library (DLL) Embedded Trace Macrocell (ETM) Embedded Trace Buffer (ETB) EmbeddedICE Halfword unsigned integer Host ICache ICE Extension Unit J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 313 IEEE 1149.1 Image In-Circuit Emulator (ICE) Instruction Register Joint Test Action Group (JTAG) Little-endian Memory coherency Memory management unit (MMU) Memory Protection Unit (MPU) Multi-ICE RESET nTRST Open collector J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 314 CHAPTER 14 Glossary Processor Core Program Status Register (PSR) Remapping Remote Debug Interface (RDI) RTCK RTOS Scan Chain Semihosting TAP Controller Target J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 315 Test Access Port (TAP) Transistor-transistor logic (TTL) Watchpoint Word J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 316 CHAPTER 14 Glossary J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 317: Literature And References

    Chapter 15 Literature and references J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 318 CHAPTER 15 Literature and references Reference Title Comments www.arm.com www.arm.com Table 15.1: Literature and References J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 319 Index J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...
  • Page 320 Index J-Link / J-Trace (UM08001) © 2004-2013 SEGGER Microcontroller GmbH & Co. KG...

This manual is also suitable for:

J-trace

Table of Contents

Save PDF