1,軟件安裝平台:CentOS 5.5
2,開發板硬件環境:Mini2440
3,下載最新版http://www.linuxidc.net/thread-2217-1-1.html,當前版本Openocd-0.4.0
安裝時參考文章http://www.linuxidc.com/Linux/2011-05/35966.htm
這裡http://www.linuxidc.com/Linux/2011-05/35967.htm說,很重要的一步是安裝libusb工具。不安裝,編譯openocd 時會提示找不到usb.h文件,該文件即為libusb工具的頭文件。該工具可在sourceforge上找到。但是我在安裝之前沒有安裝這個libusb庫,也沒發現有報錯問題,這可能與具體的系統軟件環境有關。
二,安裝過程(安裝時還要注意參考OpenOCD Manual)
1,解壓當前目錄下
[root@localhost ~]# unzip /smbroot/openocd-0.4.0.zip
3,進入openocd目錄
[[root@localhost ~]# cd openocd-0.4.0
[root@localhost openocd-0.4.0]#
[root@localhost openocd-0.4.0]# ls
aclocal.m4 config.guess configure.in doc ltmain.sh NEWS TODO
AUTHORS config.h.in contrib Doxyfile.in Makefile.am README tools
ChangeLog config.sub COPYING INSTALL Makefile.in src
compile configure depcomp install-sh missing tcl
[root@localhost openocd-0.4.0]#
4,執行 configure 配置命令
在執行配置命令之前,先了解下相關配置選項的作用。
有關configure 配置參數可參考http://www.linuxidc.com/Linux/2011-05/35968.htm
--prefix=PREFIX 用來指定安裝位置,默認是安裝在/usr/local/下
--enable-FEATURE用來啟用被禁用的特性,FEATURE是特性的名字
root@localhost openocd-0.4.0]# ./configure --enable-jlink
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
...... ......
config.status: executing depfiles commands
config.status: executing libtool commands
[root@localhost openocd-0.4.0]#
5,然後執行make 編譯和make install安裝
[root@localhost openocd-0.4.0]# make
...... ......
[root@localhost openocd-0.4.0]# make install
...... ......
make install-data-hook
make[3]: Entering directory `/root/openocd-0.4.0'
for i in $(find ./tcl -name '*.cfg' -o -name '*.tcl' | sed -e 's,^./tcl,,'); do \
j="/usr/local/share/openocd/scripts/$i" && \
mkdir -p "$(dirname $j)" && \
/usr/bin/install -c -m 644 ./tcl/$i $j; \
done
make[3]: Leaving directory `/root/openocd-0.4.0'
make[2]: Leaving directory `/root/openocd-0.4.0'
make[1]: Leaving directory `/root/openocd-0.4.0'
[root@localhost openocd-0.4.0]#
6,查看安裝結果,
[root@localhost openocd-0.4.0]# openocd -v
Open On-Chip Debugger 0.4.0 (2011-03-28-11:40)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.berlios.de/doc/doxygen/bugs.html
[root@localhost openocd-0.4.0]#
清除安裝時產生的中間文件
[root@localhost openocd-0.4.0]# make distclean
Making distclean in doc
..... ......
rm -f Makefile
[root@localhost openocd-0.4.0]#