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
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
+ 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原文链接:https://www.f2er.com/ubuntu/350576.html