Openocd 安装并在Eclipse环境下通过J-Link调试


一,安装前准备

1,软件安装平台:CentOS 5.5

2,开发板硬件环境:Mini2440

3,下载最新版http://www.bkjia.net/thread-2217-1-1.html,当前版本Openocd-0.4.0

安装时参考文章

这里说,很重要的一步是安装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 配置参数可参考

--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]#

  • 1
  • 2
  • 3
  • 4
  • 下一页

相关内容