由于官方libftd2xx 库比开源的libftdi效率大概高50%,而且由于debian squeeze,ftdi驱动有点老,这里就使用官方的库
1. 官方下载最新的ftd2xx驱动
2. 安装编译openocd依赖包
sudo apt-get install libusb-dev
3. 安装libftd2xx
cd ~/libftd2xx1.1.12
sudo cp ftd2xx.h /usr/include
sudo cp WinTypes.h /usr/include
cd build/x86_64/
sudo cp libftd2xx.so.1.1.12 /usr/local/lib/
cd /usr/local/lib/
sudo ln -s libftd2xx.so.1.1.12 libftd2xx.so
sudo ldconfig
4. 编译安装opocd 0.7.0
cd /share/micro/openocd-0.7.0
./configure --enable-maintainer-mode --disable-werror --enable-ft2232_libftdi --enable-jlink
make
sudo make install
git版本编译方法
cd ~/openocd
./bootstrap
./configure --enable-maintainer-mode --disable-werror --enable-ft2232_libftdi
make
sudo make install
5. 安装结束
$ sudo openocd -f interface/jlink.cfg -f board/mini2440.cfg
Open On-Chip Debugger 0.7.0 (2013-08-27-08:41)
Licensed under GNU GPL v2
For bug reports, read
Info : only one transport option; autoselect 'jtag'
adapter_nsrst_delay: 100
jtag_ntrst_delay: 100
trst_and_srst separate srst_gates_jtag trst_push_pull srst_open_drain connect_deassert_srst
adapter speed: 12000 kHz
force hard breakpoints
TargetName Type Endian TapName State
-- ------------------ ---------- ------ ------------------ ------------
0* s3c2440.cpu arm920t little s3c2440.cpu unknown
Error: No valid NAND flash driver found (0)
Available NAND flash controller drivers:
nonce
davinci
lpc3180
lpc32xx
orion
s3c2410
s3c2412
s3c2440
s3c2443
s3c6400
mxc
imx31
at91sam9
nuc910
adapter_nsrst_delay: 100
jtag_ntrst_delay: 100
trst_and_srst separate srst_gates_jtag trst_push_pull srst_open_drain connect_deassert_srst
Info : J-Link initialization started / target CPU reset initiated
Info : J-Link ARM V8 compiled Jul 17 2013 11:24:15
Info : J-Link caps 0xb9ff7bbf
Info : J-Link hw version 80000
Info : J-Link hw type J-Link
Info : J-Link max mem block 9296
Info : J-Link configuration
Info : USB-Address: 0x0
Info : Kickstart power on JTAG-pin 19: 0xffffffff
Info : Vref = 3.228 TCK = 1 TDI = 0 TDO = 0 TMS = 0 SRST = 0 TRST = 0
Info : J-Link JTAG Interface ready
Info : clock speed 12000 kHz
Info : JTAG tap: s3c2440.cpu tap/device found: 0x0032409d (mfg: 0x04e, part: 0x0324, ver: 0x0)
Info : Embedded ICE version 2
Info : s3c2440.cpu: hardware has 2 breakpoint/watchpoint units
-------------------------------------------
--- login with - telnet localhost 4444 ---
--- then type help_2440 ---
-------------------------------------------
help_2440
6 连接openocd
telnet localhost 4444
gdb) target remote localhost:3333
错误现象
Runtime Error: target/samsung_s3c2410.cfg:26: invalid command name "jtag"
解决方法
就是调换一下interface和board的配置文件顺序
openocd -f interface/jlink.cfg -f board/mini2440.cfg
openocd jtag interface: command requires more arguments
去掉mini2440.cfg中的 jtag interface
#jtag interface
阅读(4016) | 评论(0) | 转发(0) |