没有合适的资源?快使用搜索试试~ 我知道了~
首页SEGGER J-Link使用手册
SEGGER J-Link使用手册
4星 · 超过85%的资源 需积分: 12 10 下载量 53 浏览量
更新于2024-07-20
收藏 4.24MB PDF 举报
"UM08001_JLink - Jlink使用指南,SEGGER Microcontroller GmbH & Co. KG的产品文档,软件版本V6.00,手册修订版1,发布日期2016年6月20日。"
**J-Link简介**
J-Link是由SEGGER Microcontroller GmbH & Co. KG开发的一种通用的嵌入式系统调试工具,主要用于对微控制器进行编程、调试和诊断。它支持多种嵌入式处理器架构,包括ARM、Cortex等系列。J-Link提供了高速的下载速度和可靠的连接性能,使得开发人员可以高效地进行固件开发和测试。
**主要内容**
1. **硬件安装与连接**:J-Link通过USB接口连接到PC,并通过SWD(Serial Wire Debug)或JTAG接口与目标设备通信。用户需要确保正确安装驱动程序,并按照手册中的步骤连接硬件。
2. **软件环境配置**:使用J-Link需要配合SEGGER的J-Link Software and Documentation Pack,该软件包包含了J-Link驱动、IDE集成插件以及各种实用工具,如J-Link Commander、J-Flash等。
3. **编程与调试**:J-Link支持在线编程(In-System Programming, ISP)和调试功能,允许在目标设备运行时修改代码并进行断点设置、变量观察、内存查看等操作。
4. **协议栈支持**:J-Link支持多种通信协议,如SWD、JTAG、OBDM(On-Board Debug Module)等,使其能够适应不同类型的微控制器和开发平台。
5. **兼容性**:J-Link与多种常见的嵌入式开发环境兼容,如IAR Embedded Workbench, Keil MDK-ARM, GCC等,可以无缝集成到这些IDE中。
6. **远程调试**:J-Link还支持远程调试功能,开发人员可以通过网络对远程设备进行调试,这对于分布式系统和物联网设备的开发尤其有用。
7. **固件更新**:为了保持最新功能和优化性能,用户可以定期检查并更新J-Link的固件,确保其与最新的处理器和开发工具兼容。
8. **故障排查**:手册中通常会包含一些常见问题的解决方案和故障排查指南,帮助用户解决在使用过程中遇到的问题。
9. **安全特性**:J-Link可能具有安全特性,如加密通信、防止非法访问等,以保护用户的知识产权。
**注意事项**
尽管J-Link提供了强大的功能,但用户应了解其规格和限制。手册中的免责声明指出,虽然规格描述被认为准确,但不能保证完全无误。制造商不对任何错误或遗漏负责,也不提供任何明示或暗示的保修。用户应确保使用的是最新版本的手册,并且在使用过程中遵循所有安全指导。
J-Link是嵌入式开发中的强大工具,通过深入理解和熟练运用,开发者可以大大提高工作效率。这份UM08001_JLink指南将帮助用户全面了解如何有效利用J-Link进行项目开发和调试。
16 CHAPTER
J-Link / J-Trace (UM08001) ©
2004-2016 SEGGER Microcontroller GmbH & Co. KG
EMBEDDED SOFTWARE
(Middleware)
emWin
Graphics software and GUI
emWin is designed to provide an effi-
cient, processor- and display control-
ler-independent graphical user
interface (GUI) for any application that
operates with a graphical display.
embOS
Real Time Operating System
embOS is an RTOS designed to offer
the benefits of a complete multitasking
system for hard real time applications
with minimal resources.
embOS/IP
TCP/IP stack
embOS/IP a high-performance TCP/IP
stack that has been optimized for
speed, versatility and a small memory
footprint.
emFile
File system
emFile is an embedded file system with
FAT12, FAT16 and FAT32 support. Var-
ious Device drivers, e.g. for NAND and
NOR flashes, SD/MMC and Compact-
Flash cards, are available.
USB-Stack
USB device/host stack
A USB stack designed to work on any
embedded system with a USB control-
ler. Bulk communication and most stan-
dard device classes are supported.
SEGGER TOOLS
Flasher
Flash programmer
Flash Programming tool primarily for micro con-
trollers.
J-Link
JTAG emulator for ARM cores
USB driven JTAG interface for ARM cores.
J-Trace
JTAG emulator with trace
USB driven JTAG interface for ARM cores with
Trace memory. supporting the ARM ETM (Embed-
ded Trace Macrocell).
J-Link / J-Trace Related Software
Add-on software to be used with SEGGER’s indus-
try standard JTAG emulator, this includes flash
programming software and flash breakpoints.
Table 1.1:
SEGGER Microcontroller GmbH & Co. KG develops
and distributes software development tools and ANSI C
software components (middleware) for embedded sys-
tems in several industries such as telecom, medical
technology, consumer electronics, automotive industry
and industrial automation.
SEGGER’s intention is to cut software development time
for embedded applications by offering compact flexible and easy to use middleware,
allowing developers to concentrate on their application.
Our most popular products are emWin, a universal graphic software package for embed-
ded applications, and embOS, a small yet efficient real-time kernel. emWin, written
entirely in ANSI C, can easily be used on any CPU and most any display. It is comple-
mented by the available PC tools: Bitmap Converter, Font Converter, Simulator and
Viewer. embOS supports most 8/16/32-bit CPUs. Its small memory footprint makes it
suitable for single-chip applications.
Apart from its main focus on software tools, SEGGER develops and produces programming
tools for flash micro controllers, as well as J-Link, a JTAG emulator to assist in develop-
ment, debugging and production, which has rapidly become the industry standard for
debug access to ARM cores.
Corporate Office:
http://www.segger.com
United States Office:
http://www.segger-us.com
J-Link / J-Trace (UM08001) © 2004-2016 SEGGER Microcontroller GmbH & Co. KG
17
1 Introduction ....................................................................................................................25
1.1 Requirements..........................................................................................26
1.2 Supported OS .........................................................................................27
1.3 J-Link / J-Trace models ............................................................................28
1.3.1 Model comparison.................................................................................... 29
1.3.2 J-Link BASE ............................................................................................ 30
1.3.3 J-Link PLUS ............................................................................................36
1.3.4 J-Link ULTRA+ ........................................................................................ 41
1.3.5 J-Link PRO..............................................................................................46
1.3.6 J-Link Lite ARM .......................................................................................50
1.3.7 J-Link Lite CortexM ..................................................................................51
1.3.8 J-Trace ARM ........................................................................................... 52
1.3.9 J-Trace for Cortex-M ................................................................................54
1.3.10 Flasher ARM............................................................................................57
1.4 Common features of the J-Link product family .............................................59
1.5 Supported CPU cores ...............................................................................60
1.6 Built-in intelligence for supported CPU-cores ...............................................61
1.6.1 Intelligence in the J-Link firmware .............................................................61
1.6.2 Intelligence on the PC-side (DLL) ...............................................................61
1.6.3 Firmware intelligence per model ................................................................ 63
1.7 Supported IDEs ....................................................................................... 65
2 Licensing........................................................................................................................67
2.1 ................................................................. Components requiring a license68
2.2 License types ..........................................................................................69
2.2.1 Built-in license ........................................................................................69
2.2.2 Key-based license.................................................................................... 69
2.3 Legal use of SEGGER J-Link software.......................................................... 70
2.3.1 Use of the software with 3rd party tools......................................................70
2.4 Original SEGGER products......................................................................... 71
2.4.1 J-Link BASE ............................................................................................ 71
2.4.2 J-Link PLUS ............................................................................................71
2.4.3 J-link ULTRA+ ......................................................................................... 72
2.4.4 J-Link PRO..............................................................................................72
2.4.5 J-Trace ARM ........................................................................................... 72
2.4.6 J-Trace for Cortex-M ................................................................................73
2.4.7 Flasher ARM............................................................................................74
2.4.8 Flasher RX ..............................................................................................74
2.4.9 Flasher PPC ............................................................................................75
2.5 J-Link OEM versions................................................................................. 76
2.5.1 Analog Devices: mIDASLink ...................................................................... 76
2.5.2 Atmel: SAM-ICE ......................................................................................76
2.5.3 Digi: JTAG Link........................................................................................77
2.5.4 IAR: J-Link / J-Link KS ............................................................................. 77
2.5.5 IAR: J-Link Lite .......................................................................................77
2.5.6 IAR: J-Trace ........................................................................................... 78
2.5.7 NXP: J-Link Lite LPC Edition ......................................................................78
2.5.8 SEGGER: J-Link Lite ARM..........................................................................78
2.6 J-Link OBs .............................................................................................. 79
2.7 Illegal Clones .......................................................................................... 80
Table of Contents
18
J-Link / J-Trace (UM08001) © 2004-2016 SEGGER Microcontroller GmbH & Co. KG
3 J-Link software and documentation package.................................................................81
3.1 Software overview................................................................................... 82
3.2 J-Link Commander (Command line tool)..................................................... 83
3.2.1 Commands............................................................................................. 84
3.2.2 Command line options ............................................................................100
3.2.3 Using command files...............................................................................103
3.3 J-Link GDB Server..................................................................................104
3.3.1 J-Link GDB Server CL (Windows, Linux, Mac) .............................................104
3.3.2 Debugging with J-Link GDB Server ...........................................................105
3.3.3 Supported remote (monitor) commands ....................................................110
3.3.4 SEGGER-specific GDB protocol extensions .................................................122
3.3.5 Command line options ............................................................................125
3.3.6 Program termination...............................................................................136
3.3.7 Semihosting ..........................................................................................137
3.4 J-Link Remote Server .............................................................................138
3.4.1 List of available commands......................................................................138
3.4.2 Tunneling mode .....................................................................................139
3.5 J-Mem Memory Viewer............................................................................142
3.6 J-Flash..................................................................................................143
3.7 J-Link RTT Viewer...................................................................................144
3.7.1 RTT Viewer Startup ................................................................................144
3.7.2 Connection Settings................................................................................145
3.7.3 The Terminal Tabs..................................................................................145
3.7.4 Sending Input........................................................................................146
3.7.5 Logging Terminal output .........................................................................146
3.7.6 Logging Data .........................................................................................147
3.7.7 Command line options ............................................................................147
3.7.8 Menus and Shortcuts ..............................................................................149
3.7.9 Using "virtual" Terminals in RTT ...............................................................151
3.7.10 Using Text Control Codes ........................................................................151
3.8 J-Link SWO Viewer .................................................................................152
3.8.1 Usage...................................................................................................153
3.8.2 List of available command line options ......................................................153
3.8.3 Configure SWO output after device reset ...................................................155
3.8.4 Target example code for terminal output ...................................................155
3.9 SWO Analyzer........................................................................................158
3.10 JTAGLoad (Command line tool) ................................................................159
3.11 J-Link RDI (Remote Debug Interface)........................................................160
3.11.1 Flash download and flash breakpoints .......................................................160
3.12 Processor specific tools ...........................................................................161
3.12.1 J-Link STR91x Commander (Command line tool) ........................................161
3.12.2 J-Link STM32 Unlock (Command line tool) .................................................162
3.13 J-Link Software Developer Kit (SDK) .........................................................165
4 Setup............................................................................................................................167
4.1 Installing the J-Link software and documentation pack ................................168
4.1.1 Setup procedure ....................................................................................168
4.2 Setting up the USB interface....................................................................171
4.2.1 Verifying correct driver installation ...........................................................171
4.2.2 Uninstalling the J-Link USB driver.............................................................172
4.3 Setting up the IP interface.......................................................................174
4.3.1 Configuring J-Link using J-Link Configurator...............................................174
4.3.2 Configuring J-Link using the webinterface ..................................................174
4.4 FAQs ....................................................................................................176
4.5 J-Link Configurator.................................................................................177
4.5.1 Configure J-Links using the J-Link Configurator ..........................................177
4.6 J-Link USB identification..........................................................................179
4.6.1 Connecting to different J-Links connected to the same host PC via USB .........179
4.7 Using the J-Link DLL ...............................................................................181
4.7.1 What is the JLink DLL? ............................................................................181
J-Link / J-Trace (UM08001) © 2004-2016 SEGGER Microcontroller GmbH & Co. KG
19
4.7.2 Updating the DLL in third-party programs ................................................. 181
4.7.3 Determining the version of JLink DLL........................................................ 182
4.7.4 Determining which DLL is used by a program ............................................ 182
4.8 Getting started with J-Link and ARM DS-5................................................. 183
4.8.1 Replacing the RDDI DLL manually ............................................................ 183
4.8.2 Using J-Link in DS-5 Development Studio ................................................. 183
5 Working with J-Link and J-Trace..................................................................................185
5.1 Connecting the target system.................................................................. 186
5.1.1 Power-on sequence................................................................................ 186
5.1.2 Verifying target device connection ........................................................... 186
5.1.3 Problems .............................................................................................. 186
5.2 Indicators............................................................................................. 187
5.2.1 Main indicator ....................................................................................... 187
5.2.2 Input indicator ...................................................................................... 189
5.2.3 Output indicator .................................................................................... 189
5.3 JTAG interface....................................................................................... 190
5.3.1 Multiple devices in the scan chain ............................................................ 190
5.3.2 Sample configuration dialog boxes ........................................................... 190
5.3.3 Determining values for scan chain configuration......................................... 193
5.3.4 JTAG Speed .......................................................................................... 194
5.4 SWD interface ....................................................................................... 195
5.4.1 SWD speed........................................................................................... 195
5.4.2 SWO .................................................................................................... 195
5.5 Multi-core debugging ............................................................................. 197
5.5.1 How multi-core debugging works ............................................................. 197
5.5.2 Using multi-core debugging in detail ........................................................ 198
5.5.3 Things you should be aware of ................................................................ 199
5.6 Connecting multiple J-Links / J-Traces to your PC ...................................... 201
5.6.1 How does it work? ................................................................................. 201
5.7 J-Link control panel................................................................................ 203
5.7.1 Tabs .................................................................................................... 203
5.8 Reset strategies .................................................................................... 209
5.8.1 Strategies for ARM 7/9 devices................................................................ 209
5.8.2 Strategies for Cortex-M devices ............................................................... 211
5.9 Using DCC for memory access ................................................................. 214
5.9.1 What is required? .................................................................................. 214
5.9.2 Target DCC handler ............................................................................... 214
5.9.3 Target DCC abort handler ....................................................................... 214
5.10 The J-Link settings file............................................................................ 215
5.10.1 SEGGER Embedded Studio...................................................................... 215
5.10.2 Keil MDK-ARM (uVision).......................................................................... 215
5.10.3 IAR EWARM .......................................................................................... 215
5.10.4 Mentor Sourcery CodeBench for ARM........................................................ 215
5.11 J-Link script files ................................................................................... 216
5.11.1 Actions that can be customized ............................................................... 216
5.11.2 Script file API functions .......................................................................... 217
5.11.3 Global DLL variables .............................................................................. 223
5.11.4 Global DLL constants.............................................................................. 227
5.11.5 Script file language ................................................................................ 228
5.11.6 Script file writing example ...................................................................... 229
5.11.7 Executing J-Link script files ..................................................................... 230
5.12 Command strings .................................................................................. 233
5.12.1 List of available commands ..................................................................... 233
5.12.2 Using command strings .......................................................................... 251
5.13 Switching off CPU clock during debug ....................................................... 253
5.14 Cache handling...................................................................................... 254
5.14.1 Cache coherency ................................................................................... 254
5.14.2 Cache clean area ................................................................................... 254
5.14.3 Cache handling of ARM7 cores................................................................. 254
5.14.4 Cache handling of ARM9 cores................................................................. 254
20
J-Link / J-Trace (UM08001) © 2004-2016 SEGGER Microcontroller GmbH & Co. KG
5.15 Virtual COM Port (VCOM).........................................................................255
5.15.1 Configuring Virtual COM Port ...................................................................255
6 Flash download............................................................................................................257
6.1 Introduction ..........................................................................................258
6.2 Licensing...............................................................................................259
6.3 Supported devices..................................................................................260
6.4 Setup for various debuggers (internal flash) ..............................................261
6.4.1 IAR Embedded Workbench ......................................................................261
6.4.2 Keil MDK ...............................................................................................261
6.4.3 Mentor Sourcery CodeBench ....................................................................264
6.4.4 J-Link GDB Server..................................................................................264
6.4.5 J-Link Commander .................................................................................265
6.4.6 J-Link RDI .............................................................................................266
6.5 Setup for various debuggers (CFI flash) ....................................................267
6.5.1 IAR Embedded Workbench / Keil MDK .......................................................267
6.5.2 J-Link GDB Server..................................................................................268
6.5.3 J-Link commander..................................................................................268
6.6 Setup for various debuggers (SPIFI flash)..................................................269
6.7 QSPI flash support .................................................................................270
6.7.1 Setup the DLL for QSPI flash download .....................................................270
6.8 Using the DLL flash loaders in custom applications......................................271
6.9 Debugging applications that change flash contents at runtime ......................272
7 Flash breakpoints.........................................................................................................273
7.1 Introduction ..........................................................................................274
7.2 Licensing...............................................................................................275
7.2.1 Free for evaluation and non-commercial use ..............................................275
7.3 Supported devices..................................................................................276
7.4 Setup & compatibility with various debuggers ............................................277
7.4.1 Setup ...................................................................................................277
7.4.2 Compatibility with various debuggers ........................................................277
7.5 Flash Breakpoints in QSPI flash ................................................................278
7.5.1 Setup ...................................................................................................278
7.6 FAQ......................................................................................................279
8 Monitor Mode Debugging.............................................................................................281
8.1 Introduction ..........................................................................................282
8.2 Enable Monitor Debugging.......................................................................283
8.2.1 GDB based debug solutions .....................................................................283
8.2.2 IAR EWARM...........................................................................................283
8.2.3 Keil MDK-ARM (uVision) ..........................................................................284
8.2.4 J-Link Commander .................................................................................284
8.2.5 Generic way of enabling ..........................................................................284
8.3 Availability and limitations of monitor mode...............................................285
8.3.1 Cortex-M3.............................................................................................285
8.3.2 Cortex-M4.............................................................................................285
8.4 Monitor code .........................................................................................286
8.5 Debugging interrupts ..............................................................................287
8.6 Having servicing interrupts in debug mode ................................................288
8.7 Forwarding of Monitor Interrupts ..............................................................289
8.8 Target application performs reset (Cortex-M) .............................................290
9 Low Power Debugging.................................................................................................291
9.1 Introduction ..........................................................................................292
9.2 Activating low power mode handling for J-Link ...........................................293
9.2.1 SEGGER Embedded Studio ......................................................................293
9.2.2 Keil MDK-ARM........................................................................................293
9.2.3 IAR EWARM...........................................................................................293
剩余479页未读,继续阅读
359 浏览量
273 浏览量
191 浏览量
111 浏览量
359 浏览量
828 浏览量
1604 浏览量
249 浏览量
273 浏览量
PayneLudwig
- 粉丝: 0
- 资源: 3
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功