openOCD在ubuntu16.04上的安装

OPENOCD适用于微处理器的debug和烧写。


1.下载相关库:

sudo apt-get install build-essential pkg-config autoconf automake libtool libusb-dev libusb-1.0-0
-dev libhidapi-dev
sudo apt-get install libtool  
libsysfs-dev


2.下载openocd源码:


git clone git://git.code.sf.net/p/openocd/code openocd

3.编译并安装openocd:

cd openocd
sudo ./bootstrap
sudo ./configure
make
sudo make install

4.测试是否安装成功:

openocd --version

测试如下:

Open On-Chip Debugger 0.10.0+dev-00207-g4109263 (2017-11-14-20:14)
Licensed under GNU GPL v2
For bug reports,read
	http://openocd.org/doc/doxygen/bugs.html


一些错误

错误1:./bootstrap 报错:

+ automake --gnu --add-missing --copy
src/Makefile.am:4: error: bad characters in variable name '%C%_openocd_SOURCES'
Makefile.am:143:   'src/Makefile.am' included from here
src/Makefile.am:7: error: bad characters in variable name '%C%_libopenocd_la_SOURCES'
Makefile.am:143:   'src/Makefile.am' included from here
src/Makefile.am:11: error: bad characters in variable name '%C%_openocd_LDADD'
Makefile.am:143:   'src/Makefile.am' included from here
src/Makefile.am:13: error: bad characters in variable name '%C%_openocd_LDADD'
Makefile.am:143:   'src/Makefile.am' included from here
src/Makefile.am:16: error: bad characters in variable name '%C%_openocd_LDADD'
Makefile.am:143:   'src/Makefile.am' included from here
src/Makefile.am:18: error: bad characters in variable name '%C%_openocd_LDADD'
Makefile.am:143:   'src/Makefile.am' included from here
src/Makefile.am:21: error: bad characters in variable name '%C%_libopenocd_la_CPPFLAGS'
Makefile.am:143:   'src/Makefile.am' included from here
src/Makefile.am:26: error: bad characters in variable name '%C%_libopenocd_la_CPPFLAGS'
Makefile.am:143:   'src/Makefile.am' included from here
src/Makefile.am:27: error: bad characters in variable name '%C%_libopenocd_la_CPPFLAGS'
Makefile.am:143:   'src/Makefile.am' included from here
src/Makefile.am:29: error: bad characters in variable name '%C%_libopenocd_la_CPPFLAGS'
Makefile.am:143:   'src/Makefile.am' included from here
src/Makefile.am:30: error: bad characters in variable name '%C%_libopenocd_la_CPPFLAGS'
Makefile.am:143:   'src/Makefile.am' include


缺少超级用户权限:

sudo ./bootstrap


错误2:

+ aclocal
+ libtoolize --automake --copy
+ autoconf
configure.ac:12: error: possibly undefined macro: AC_MSG_WARN
      If this token and others are legitimate,please use m4_pattern_allow.
      See the Autoconf documentation.
configure.ac:36: error: possibly undefined macro: AC_disABLE_SHARED
configure.ac:37: error: possibly undefined macro: AC_PROG_LIBTOOL
configure.ac:204: error: possibly undefined macro: AC_DEFINE
configure.ac:608: error: possibly undefined macro: AC_MSG_NOTICE

缺少libtool和libsysfs-dev

安装:

sudo apt-get install libtool  
libsysfs-dev

相关文章

ubuntu退出redis的示例:指定配置文件方式启动源码redis:roo...
ubuntu中mysql改密码忘了的解决方法:1.在终端中切换到root权...
ubuntu安装mysql失败的解决方法原因:可能是原有的MySQL还有...
使用centos和ubuntu建站的区别有以下几点1.CentOS是Linux发行...
ubuntu图形界面和字符界面切换的方法:可以通过快捷键CTRL+A...
ubuntu中重启mysql失败的解决方法1.首先,在ubuntu命令行中,...