一、 开发环境
我的开发环境:
l Ubuntu 12.10
l Jlink V8
二、 步骤
1、 安装JLlink V8 Linux驱动
l 从官网下载:http://www.segger.com/cms/jlink-software.html
l Linux环境下解压缩,阅读README,按照步骤进行配置
1. apt-get update
apt-get install libusb
安装libusb,但是提示找不到libusb,大概是我的环境的软件源的问题,不去管他。
到lib目录下查找,发现有已经有了libusb,这一步可以跳过。
2. cp libjlinkarm.so.* /usr/lib
ldconfig
复制jlink自己的库文件到/usr/lib,如果使用README上提供的命令会发现,复制过去的文件中,链接文件变成了普通文件,为了使链接文件复制前后保持一致,cp命令需要加上-d选项,或者复制后再用ln命令重新建立链接。
3. cp 45-jlink.rules /etc/udev/rules.d/
4. 最后一步是要建立一个用户组,因为我都是超级用户登录的,没有必要,略过。
2、 开始试验
升级Jlink固件。如果能想办法把jlink升级到最新的固件,那即便用最新的驱动软件应该也不会提示升级固件了。Linux下是不可以了,似乎不能成功,Windows可以试一试。下载了Windows版本的Jlink驱动V442b,安装后连接Jlink,果然提示升级,升级后发现也不行,固件似乎也不能运行,Jlink Commander 停在了“New firmware booted successfully”这里,我的Jlink大概不能兼容最新的固件。软件换回V422a版本,重新连接Jlink,竟然发现固件升级成功了,而且也可以连接到开发板,简单测试没有发现问题。回到Linux下使用V441g版本连接,正常连接。
root@kangear:~/JLink_Linux_V422a# ./startSEGGER J-Link Commander V4.22 ('?' for help)Compiled Apr 5 2011 13:54:55DLL version V4.22, compiled Apr 5 2011 13:54:52Firmware: J-Link ARM V8 compiled Jun 16 2011 14:52:53Hardware: V8.00S/N: 12345678Feature(s): RDI,FlashDL,FlashBP,JFlash,GDBFullVTarget = 0.000VJ-Link>
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Ubuntu 10.04下J-Link配置及使用 2011-07-27 17:16:04
分类: 嵌入式
- root@jelline:~/Downloads# tar jxvf libusb-1.0.8.tar.bz2
- root@jelline:~/Downloads# cd libusb-1.0.8/
- root@jelline:~/Downloads/libusb-1.0.8# ./configure
- root@jelline:~/Downloads/libusb-1.0.8# make
- root@jelline:~/Downloads/libusb-1.0.8# make install
- root@jelline:~/Downloads# tar -zxvf readline-6.2.tar.gz
- root@jelline:~/Downloads/readline-6.2# ./configure
- root@jelline:~/Downloads/readline-6.2# make
- root@jelline:~/Downloads/readline-6.2# make install
- jelline@jelline:~/Downloads$ tar zxvf JLink_Linux_V430.tgz
- jelline@jelline:~/Downloads/JLink_Linux_V430$ cp libjlinkarm.so.4* /usr/lib
- jelline@jelline:~/Downloads/JLink_Linux_V430$ ldconfig
- /sbin/ldconfig.real: /usr/lib/libjlinkarm.so.4 is not a symbolic link
- root@jelline:/usr/lib# rm libjlinkarm.so.4
- root@jelline:/usr/lib# ln -s libjlinkarm.so.4.30.0 libjlinkarm.so.4
- root@jelline:/usr/lib# ldconfig
- root@jelline:~/Downloads/JLink_Linux_V430# cp 45-jlink.rules /etc/udev/rules.d/
- root@jelline:~/Downloads/JLink_Linux_V430# groupadd plugdev
- root@jelline:~/Downloads/JLink_Linux_V430# usermod -a -G plugdev jelline
- root@jelline:~/Downloads/JLink_Linux_V430# ./JLinkExe
- error while loading shared libraries: libreadline.so.5: cannot open shared object file: No such file or directory
- jelline@jelline:/lib$ ls libreadline.so.6*
- libreadline.so.6 libreadline.so.6.1
- jelline@jelline:/lib$ ln -s libreadline.so.6.1 libreadline.so.5
- jelline@jelline:~/Downloads/JLink_Linux_V430$ ./JLinkExe
- SEGGER J-Link Commander V4.30 ('?' for help)
- Compiled Jun 30 2011 15:53:19
- DLL version V4.30, compiled Jun 30 2011 15:53:15
- Firmware: J-Link ARM V8 compiled Jun 21 2011 20:26:20
- Hardware: V8.00
- S/N: 20100214
- Feature(s): RDI,FlashDL,FlashBP,JFlash,GDBFull
- VTarget = 3.306V
- Info: TotalIRLen = 9, IRPrint = 0x0011
- Info: Found Cortex-M3 r1p1, Little endian.
- Info: TPIU fitted.
- Info: FPUnit: 6 code (BP) slots and 2 literal slots
- Found 2 JTAG devices, Total IRLen = 9:
- #0 Id: 0x3BA00477, IRLen: 04, IRPrint: 0x1, CoreSight JTAG-DP (ARM)
- #1 Id: 0x16410041, IRLen: 05, IRPrint: 0x1, STM32 Boundary Scan
- Cortex-M3 identified.
- JTAG speed: 100 kHz
- J-Link>
- Syntax: loadbin <filename>, <addr> //Load binary file into target memory
- J-Link>exec device = STM32F103RB
- J-Link>loadbin /bin/cp, 0x08000000
- Loading binary file... [/bin/cp]
- Writing bin data into target memory @ 0x08000000.
- J-Link>mem 0x08000000,3f
- 08000000 = 7F 45 4C 46 01 01 01 00 00 00 00 00 00 00 00 00
- 08000010 = 02 00 03 00 01 00 00 00 40 A1 04 08 34 00 00 00
- 08000020 = 04 73 01 00 00 00 00 00 34 00 20 00 09 00 28 00
- 08000030 = 1D 00 1C 00 06 00 00 00 34 00 00 00 34 80 04
- jelline@jelline:~$ xxd /bin/cp | more
- 0000000: 7f45 4c46 0101 0100 0000 0000 0000 0000 .ELF............
- 0000010: 0200 0300 0100 0000 40a1 0408 3400 0000 ........@...4...
- 0000020: 0473 0100 0000 0000 3400 2000 0900 2800 .s......4. ...(.
- 0000030: 1d00 1c00 0600 0000 3400 0000 3480 0408 ........4...4...
- Syntax: savebin <filename>, <addr>, <NumBytes> //Saves target memory into binary file
Dear visitor, welcome to SEGGER Forum. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.