J-Link使用说明
- 格式:doc
- 大小:701.00 KB
- 文档页数:23
J-Link应用
概述
功能包括:
USB 2.0 interface
Any ARM7/ARM9/ARM11, Cortex-M3 core supported, including thumb mode
Serial Wire Debug supported *
Serial Wire Viewer supported *
Automatic core recognition
Maximum JTAG speed 12 MHz
Download speed up to 720 Kbytes/second **
DCC speed up to 800 Kbytes/second **
Seamless integration into the IAR Embedded Workbench® IDE
No power supply required, powered through USB
SWV support since hardware version 6.0
Support for adaptive clocking
All JTAG signals can be monitored, target voltage can be measured
Support for multiple devices
Fully plug and play compatible
Standard 20-pin JTAG connector
Wide target voltage range: 1.2V - 3.3V, 5V tolerant
USB and 20-pin ribbon cable included
Memory viewer (J-Mem) included
TCP/IP server included, which allows using J-Link via TCP/IP networks
RDI interface available, which allows using J-Link with RDI compliant software
Flash programming software (J-Flash) available
Flash DLL available, which allows using flash functionality in custom
applications
Software Developer Kit (SDK) available
Embedded Trace Buffer (ETB) support
Adapter for 5V JTAG targets available
14-pin JTAG adapter available
Optical isolation adapter available
Target power supply: J-Link can supply up to 300 mA to target with overload
protection
可以多个客户端同时访问一个目标板
J-Link包括:
J-Flash ARM:Flash下载;
J-Link Commander:命令行;
J-Link GDB Server:GDB服务器; J-Link RDI:RDI调试接口;
J-Link TCP-IP Server:TCP-IP远程调试接口;
J-Mem:内存察看器;
J-Flash ARM
可用于下载Flash
1、 通过File-New Project新建工程,也可通过File-Open Project打开一个已经配置好的工程。
2、 Options-Project Settings下配置工程的设置。
General设置如下图:
“Target Interface”设置JTAG界面,一般将“JTAG speed before init”设置为30kHz,“JTAG
speed after init”设置为“Auto selection”,然后点击下面的“Detect”,一般会找到所连接的内核,如果不行检查JTAG连线。
选择内核,并在“Use following init sequence”添加必要的初始化指令。需要注意的是J-Link是要自己加Reset指令的,类型0或者1都可以。对于AT91R40008来说,“Use target RAM”是不可以选中的。如果选中则J-Link先下载一部分代码和需要烧录固化程序到目标板的内存中,再烧录到Flash中,问题就在于这部分代码无法成功烧写Flash。如果不选中,这是由JTAG接口通过目标CPU来执行Flash烧写的指令,尽管速度要慢很多,但可以下载成功。“Check core ID”用于检查目标CPU是否为需要的CPU类型,可有可无。
设置Flash的基地址(和前面初始化的地址一致)、位宽和芯片数。一般不要用“Automatically detect flash memory”,因为大多数情况识别出来的型号都不对。勾掉“Automatically detect flash memory”后会出现“Select flash device”按钮,按下选择对应的Flash型号即可。“Use custom RAMCode”可以指定自定义的Flash烧写代码,当这项选中后,上图中的“Use target RAM”也会被选中,一般不选。
这里没什么好设置。
3、 选择菜单Target-Connect连接目标板,这时会跳出J-Link ARM Control Panel对话框,见后面“J-Link控制面板”。
4、 Target-Erase擦除Flash中数据。
5、 File-Open打开需要烧写的固化程序。
6、 Target-Program开始烧些。
J-Link RDI
设置基本和Multi-ICE一样,用AXD举例。
1、 打开AXD软件,在菜单Options-Configure Target里添加J-Link驱动安装目录下的JLinkRDI.dll。
2、 选择Configure可以设置RDI相关的一些参数。
设置J-Link的连接,本地的就选址USB,远程的就选择TCP/IP,并填入地址。
设置脚本问题,可以在每次复位后执行,这个脚本文件可以由J-Flash菜单中的File-Export
setup file生成。
设置JTAG速度,一般自动即可,如果JTAG接口质量不好,可以适当降低速度。同样J-Link支持多个JTAG访问。
启用Flash下载功能,这里特指片内有Flash的处理器,如LPC210x等。
启用软中断,好东西。
设置一些CPU的参数,一般如下图设置即可。“Reset strategy”复位策略的设置和具体CPU有关,一般像AT91R40008这些内部没有Flash的处理选择“Hardware, halt after reset (normal)”或“Hardware, halt with BP@0”即可,有部分特殊的处理需要特殊的复位策略。具体可见JLINKARM.PDF。
记录文件。
3、 选择OK后开始扫描J-Link,如果成功连接到J-Link和目标板后会出现以下对话框。
按Configure按钮还是前面的那个对话框。
J-Link Commander
J-Link的命令行工具。
----------------------
f Firmware info
h halt
g go
Sleep Waits the given time (in milliseconds). Syntax: Sleep
s Single step the target chip
st Show hardware status
hwinfo Show hardware info
mem Read memory. Syntax: mem , (hex)
w1 Write 8-bit items. Syntax: w1 , (hex)
w2 Write 16-bit items. Syntax: w2 , (hex)
w4 Write 32-bit items. Syntax: w4 , (hex)
wm Write test words. Syntax: wm
is Identify length of scan chain select register
ms Measure length of scan chain. Syntax: ms
mr Measure RTCK react time. Syntax: mr
q Quit
qc Close JLink connection and quit
r Reset target (RESET)
rx Reset target (RESET). Syntax: rx
RSetType Set the current reset type. Syntax: RSetType
Regs Display contents of registers
SetBP Set breakpoint. Syntax: SetBP [A/T] [S/H]
SetWP Set Watchpoint. Syntax: [R/W] [ [] [A-Mask]]
ClrBP Clear breakpoint. Syntax: ClrBP
ClrWP Clear watchpoint. Syntax: ClrWP
loadbin Load binary file into target memory.
Syntax: loadbin ,
SetPC Set the PC to specified value. Syntax: SetPC
le Change to little endian mode
be Change to big endian mode
log Enables log to file. Syntax: log
---- ICE -------------