J-Link 采用了爱特梅尔( ATMEL )公司的 ARM7 架构微控制器 AT91SAM7S64 作为主控芯片,2017 年 Atmel 已经被微芯半导体( Microchip )收购,进行所有恢复工作之前,需要先访问其官网下载微控制器所对应的程序烧录工具 SAM-BA 2.18 for Windows 。J-Link 仿真器固件由 SEGGER 开发,因此同样需要前往其官网下载最新的 J-Link 驱动工具包 ,以及 J-Link ARM V8
稳定版固件。
准备好上述三个工具之后,首先需要擦除 J-Link 板载 Flash 上面的原有固件,即 先给 J-Link 通电,然后短接 ERASE 跳线帽,保持 20 秒之后再断电并移除跳线帽 。
然后将 SAM-BA 固件复制到 FLASH 的前两个扇区,即 短接 PCB 板上的 TST 跳线帽,然后给 J-Link 通电,在保持短接状态 30 秒后断电并移除跳线帽 。
完成上述两个步骤之后,应该在 Windows 10 操作系统的设备管理器当中看到如下界面:
这表示 JLINK 已经被驱动正确的识别,接下来就可以打开 SAM-BA 并在界面选择如下设置:
点击【connect】按钮之后进入固件烧写主界面,并选择【Send File Name】按钮选择已经下载好的 J-Link ARM V8
固件:
点击【Send File】开始烧写固件,此时会询问你是否解锁已经锁定的区域,这里选择【是】。
烧写快要完成的时候,会弹出是否锁定固件存储区域的提示,这里必须选择【否】,不然后面会影响到 J-Link 的正常连接与工作。
jlink 固件烧写成功之后, SAM-BA 会在软件的底部区域展示如下日志信息:
loading history file ... 0 events added SAM-BA console display active (Tcl8.5.9 / Tk8.5.9) (sam-ba_2.18) 1 % (sam-ba_2.18) 1 % send_file {Flash} "D:/Embedded/JLink V8/jlink-v8.bin" 0x100000 0 -I- Send File D:/Embedded/JLink V8/jlink-v8.bin at address 0x100000 first_sector 0 last_sector 15 -I- Writing: 0x1500 bytes at 0x0 (buffer addr : 0x202994) -I- Sector 0 unlocked -I- Sector 1 unlocked -I- Sector 2 unlocked -I- Sector 3 unlocked -I- Sector 4 unlocked -I- Sector 5 unlocked -I- Sector 6 unlocked -I- Sector 7 unlocked -I- Sector 8 unlocked -I- Sector 9 unlocked -I- Sector 10 unlocked -I- Sector 11 unlocked -I- Sector 12 unlocked -I- Sector 13 unlocked -I- Sector 14 unlocked -I- Sector 15 unlocked -I- Writing: 0x1500 bytes at 0x0 (buffer addr : 0x202994) -I- 0x1500 bytes written by applet -I- Writing: 0x1500 bytes at 0x1500 (buffer addr : 0x202994) -I- 0x1500 bytes written by applet -I- Writing: 0x1500 bytes at 0x2A00 (buffer addr : 0x202994) -I- 0x1500 bytes written by applet -I- Writing: 0x1500 bytes at 0x3F00 (buffer addr : 0x202994) -I- 0x1500 bytes written by applet -I- Writing: 0x1500 bytes at 0x5400 (buffer addr : 0x202994) -I- 0x1500 bytes written by applet -I- Writing: 0x1500 bytes at 0x6900 (buffer addr : 0x202994) -I- 0x1500 bytes written by applet -I- Writing: 0x1500 bytes at 0x7E00 (buffer addr : 0x202994) -I- 0x1500 bytes written by applet -I- Writing: 0x1500 bytes at 0x9300 (buffer addr : 0x202994) -I- 0x1500 bytes written by applet -I- Writing: 0x1500 bytes at 0xA800 (buffer addr : 0x202994) -I- 0x1500 bytes written by applet -I- Writing: 0x1500 bytes at 0xBD00 (buffer addr : 0x202994) -I- 0x1500 bytes written by applet -I- Writing: 0x1500 bytes at 0xD200 (buffer addr : 0x202994) -I- 0x1500 bytes written by applet -I- Writing: 0x1500 bytes at 0xE700 (buffer addr : 0x202994) -I- 0x1500 bytes written by applet -I- Writing: 0x400 bytes at 0xFC00 (buffer addr : 0x202994) -I- 0x400 bytes written by applet Do not lock
最后,关闭 SAM-BA 并将 J-Link 断电,重新通电后 LED 指示灯点亮,表示 J-Link 已经开始工作,接下来打开 J-Link Commander 查看它的工作状态,此时会弹出一个固件升级提示信息,为了保持当前硬件兼容性这里选择【否】跳过升级:
当看到如下命令行界面的时候,表示当前 J-Link 的工作状态一切正常:
此时,可以通过命令行界面输入一条 usb
指令,表示通过 USB 连接至 J-Link:
注意: J-Link Commander 使用过程中会不断提示 当前连接的jlink存在缺陷,不能保证正确的操作。
,笔者建议在产品化开发场景下,尽可能选择 SEGGER 公司的最新产品,从而获得完整的商业技术支持。