解析J-Link、J-Trace、Open JTAG原理以及其区别

电子说

1.2w人已加入

描述

J-Link、J-Trace、Open JTAG都是用来调试程序的(当然还有其他工具可以进行调试,比如ICE),J-Link和J-Trace是SEGGER公司的是一个开源项目,其目标是使嵌入式开发者能够通过JTAG接口,用开放的硬件和软件系统进行烧写、校验和调试。他们都基于JTAG调试接口协议。

ARM

一、工作原理

调试arm,总要遵循arm的调试接口协议吧,jtag就是其中的一种吧。当仿真时,iar,keil,ads等等都有一个公共的调试接口,RDI(RDI接口是ARM公司提出的调试接口标准,主要用于ARM芯片的JTAG仿真。)就是其中的一咱吧, 那么我们如何完成RDI-->arm调试协议(JTAG)的转换呢? 如是乎就有两种做法:

(1) 在电脑上写一个服务程序,把keil,ads,iar中的RDI命令解析成相关的JTAG协议,然后通后一个物理转换接口(注意,这个转换只是电气物理层 上的转换,就像RS232那样的作用)发送你的的目标板。 h-jtag就是这样的。 h-jtag的硬件就仅是一个物理电平的转换接口,所以很简单。而电脑中装的h-jtag软件就是前面说到的服务程序,负责协议转换的。

(2)另一种做法,就是做一个板,用此板直接接收来自keil,ads,iar等软件的调试命令,由此板做rdi->jtag协议的转换。然后与目标板通信,这就是jlink的工作原理。(这也就实现了USB转JTAG协议。)

有一回贴说:“大佬,两者都是软件完成的,只不过软件放的地方不一样(一个放计算机,一个放仿真器里面了).真正的硬件,就象是JTRACE一样,用FPGA来实现.实质上,还是软件到硬件的过程.”。

二、J-Link、J-Trace区别

最近在看《J-Link/J-Trace User Gudide(UM08001)》Page12,发现文中说JLink与JTrace区别,浅显易懂,摘录如下:

J-Link

JTAG emulator for ARM cores

USB driven JTAG interface for ARM cores.

J-Trace

JTAG emulator for ARM cores

USB driven JTAG interface for ARM cores with

Trace memory. supporting the ARM ETM (Embed-

ded Trace Macrocell).

ARM Keil Tools官网(http://www.keil.com/pr/article/1141.htm)就更详细了,摘抄如下:

The SEGGER J-Link is a USB to JTAG adapter supporting ARM7™, ARM9™ and Cortex™-M3 processor based devices with JTAG speeds of up to 12MHz. It interfaces to all evaluation boards and target hardware using a standard 20-pin or 14-pin (optional) JTAG connector.

The SEGGER J-Trace is a combined unit offering real-time trace and JTAG debugging for all ARM7 and ARM9 devices with an integrated ETM (Embedded Trace Macrocell). An integrated 2MB trace buffer enables high speed instruction and data trace at speeds of up to 200MHz, connecting to the target device via a 38-pin Mictor cable. J-Trace also includes a J-Link interface for standard JTAG target debugging via a 20-pin connector.

Trace information from J-Trace is displayed in dedicated windows, providing a seamless interface with other μVision debug and analysis tools.

J-Link is part of several starter kits from various vendors and is indentical with SAM-ICE (from Atmel) and mIDAS-Link (from Analog Devices). With direct J-Link support users can now easily begin taking advantage of the unique and advanced features of RealView MDK compared to other tool offerings and starter kits.

RealView MDK is available from Keil or your local Keil distributor. J-Link and J-Trace are available from SEGGER Microcontroller and its world wide sales channels.

在论坛中看到了一个帖子,精辟回答了J-Link和J-Trace的区别,如下:

J-Link就像照相机,程序(在断点处)停下来才能看调试信息,通过JTAG/SWD接口;J-Trace就像录像机,可以纪录、回放整个调试接口, 通过ETM接口。 最近一些Cortex-M3的芯片支持SWO接口,就好像是高速连拍照相机,采样间隔小的话,有那么点Trace的样子,这个调试功能在J-Link v7和EWARM v5.30中已经得到支持。

三、J-Link与Open JTAG区别

正如上文所述,这两者都是用来调试程序的,都实现了USB转JTAG协议功能,即用USB连接主机,用JTAG线连接板子的JTAG口,而这之间的转换通过J-Link或者Open JTAG转换。另,J-Link一般是独立的组件,而Open JTAG一般集成到板子上。

四、J-Link GDBServer与Open OCD

openOCD是上位机程序(人可以直接发出操控命令的计算机,一般是PC。对应于下位机)。jlink gdbserver和openocd是一回事,都是担任一个 gdb server的角色,用来解释来自arm-elf-gdb的调试信号,并且控制硬件(Jlink或者openjtag)

打开APP阅读更多精彩内容
声明:本文内容及配图由入驻作者撰写或者入驻合作网站授权转载。文章观点仅代表作者本人,不代表电子发烧友网立场。文章及其配图仅供工程师学习之用,如有内容侵权或者其他违规问题,请联系本站处理。 举报投诉

全部0条评论

快来发表一下你的评论吧 !

×
20
完善资料,
赚取积分