FPGAの書き換えツールとしてOpenOCDを準備する。
$ sudo apt-get install -y git gcc g++ autoconf automake libtool pkg-config make libusb-1.0-0-dev libhidapi-dev libgpiod-dev libftdi1-dev
$ sudo apt install libftdi*-dev
$ git clone https://github.com/openocd-org/openocd.git
$ ./bootstrap
+ aclocal --warnings=all
+ libtoolize --automake --copy
+ autoconf --warnings=all
+ autoheader --warnings=all
+ automake --warnings=all --gnu --add-missing --copy
configure.ac:24: installing 'build-aux/compile'
configure.ac:42: installing 'build-aux/config.guess'
configure.ac:42: installing 'build-aux/config.sub'
configure.ac:19: installing 'build-aux/install-sh'
configure.ac:19: installing 'build-aux/missing'
Makefile.am: installing './INSTALL'
Makefile.am: installing 'build-aux/depcomp'
Makefile.am:26: installing 'build-aux/mdate-sh'
Makefile.am:26: installing 'build-aux/texinfo.tex'
Setting up submodules
Submodule 'jimtcl' (https://github.com/msteveb/jimtcl.git) registered for path 'jimtcl'
Submodule 'src/jtag/drivers/libjaylink' (https://gitlab.zapb.de/libjaylink/libjaylink.git) registered for path 'src/jtag/drivers/libjaylink'
Submodule 'tools/git2cl' (https://git.savannah.nongnu.org/git/git2cl.git) registered for path 'tools/git2cl'
Cloning into '/home/hidemi/openocd/jimtcl'...
Cloning into '/home/hidemi/openocd/tools/git2cl'...
Cloning into '/home/hidemi/openocd/src/jtag/drivers/libjaylink'...
Submodule path 'jimtcl': checked out '1933e5457b9512d39ebbe11ed32578aada149f49'
Submodule path 'src/jtag/drivers/libjaylink': checked out '0d23921a05d5d427332a142d154c213d0c306eb1'
Submodule path 'tools/git2cl': checked out '8373c9f74993e218a08819cbcdbab3f3564bbeba'
Generating build system...
libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, 'build-aux'.
libtoolize: copying file 'build-aux/config.guess'
libtoolize: copying file 'build-aux/config.sub'
libtoolize: copying file 'build-aux/install-sh'
libtoolize: copying file 'build-aux/ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
libtoolize: copying file 'm4/libtool.m4'
libtoolize: copying file 'm4/ltoptions.m4'
libtoolize: copying file 'm4/ltsugar.m4'
libtoolize: copying file 'm4/ltversion.m4'
libtoolize: copying file 'm4/lt~obsolete.m4'
configure.ac:44: installing 'build-aux/ar-lib'
configure.ac:37: installing 'build-aux/compile'
configure.ac:30: installing 'build-aux/missing'
libjaylink/Makefile.am: installing 'build-aux/depcomp'
Bootstrap complete. Quick build instructions:
./configure ....
$ ./configure
checking for makeinfo... no
configure: WARNING: Info documentation will not be built.
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking whether make supports the include directive... yes (GNU style)
checking dependency style of gcc... gcc3
checking for gcc option to accept ISO C99... none needed
checking for ranlib... ranlib
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.23... yes
checking build system type... aarch64-unknown-linux-gnu
checking host system type... aarch64-unknown-linux-gnu
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert aarch64-unknown-linux-gnu file names to aarch64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert aarch64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... (cached) ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /usr/bin/dd
checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking for an ANSI C-conforming const... yes
checking for unsigned long long int... yes
checking for long long int... yes
checking for library containing ioperm... no
checking for library containing dlopen... -ldl
checking for library containing openpty... -lutil
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking elf.h usability... yes
checking elf.h presence... yes
checking for elf.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking malloc.h usability... yes
checking malloc.h presence... yes
checking for malloc.h... yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking poll.h usability... yes
checking poll.h presence... yes
checking for poll.h... yes
checking for strings.h... (cached) yes
checking sys/ioctl.h usability... yes
checking sys/ioctl.h presence... yes
checking for sys/ioctl.h... yes
checking sys/param.h usability... yes
checking sys/param.h presence... yes
checking for sys/param.h... yes
checking sys/select.h usability... yes
checking sys/select.h presence... yes
checking for sys/select.h... yes
checking for sys/stat.h... (cached) yes
checking sys/sysctl.h usability... yes
checking sys/sysctl.h presence... yes
checking for sys/sysctl.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for sys/types.h... (cached) yes
checking for unistd.h... (cached) yes
checking for arpa/inet.h... yes
checking for netinet/in.h... yes
checking for netinet/tcp.h... yes
checking whether to enable assertions... yes
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
checking whether byte ordering is bigendian... no
checking for strndup... yes
checking for strnlen... yes
checking for gettimeofday... yes
checking for usleep... yes
checking for realpath... yes
checking whether to build a release... no
checking whether to build Doxygen as HTML... yes
checking whether to build Doxygen as PDF... no
checking whether to enable verbose USB I/O messages... no
checking whether to enable verbose USB communication messages... no
checking whether to enable malloc free space logging... no
checking for LIBUSB1... yes
configure: libusb-1.0 header bug workaround: LIBUSB1_CFLAGS changed to "-isystem /usr/include/libusb-1.0"
checking for CAPSTONE... no
checking for HIDAPI... no
checking for HIDAPI... yes
checking for LIBFTDI... yes
checking for LIBGPIOD... yes
checking for LIBJAYLINK... no
checking for environ in unistd.h and stdlib.h... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
=== configuring in jimtcl (/home/hidemi/openocd/jimtcl)
configure: running /bin/bash ./configure.gnu --disable-option-checking '--prefix=/usr/local' --cache-file=/dev/null --srcdir=.
No installed jimsh or tclsh, building local bootstrap jimsh0
Host System...aarch64-unknown-linux-gnu
Build System...aarch64-unknown-linux-gnu
C compiler... cc -g -O2
C++ compiler... c++ -g -O2
Build C compiler...cc
Checking for stdlib.h...ok
Checking for restrict...ok
Checking for long long...ok
Checking for sizeof int...4
Checking whether the C compiler accepts -fno-unwind-tables...yes
Checking whether the C compiler accepts -fno-asynchronous-unwind-tables...yes
Checking for time.h...ok
Checking for sys/time.h...ok
Checking for sys/socket.h...ok
Checking for netinet/in.h...ok
Checking for arpa/inet.h...ok
Checking for netdb.h...ok
Checking for util.h...not found
Checking for pty.h...ok
Checking for sys/un.h...ok
Checking for dlfcn.h...ok
Checking for unistd.h...ok
Checking for dirent.h...ok
Checking for crt_externs.h...not found
Checking for execinfo.h...ok
Checking for sizeof time_t...8
Checking libs for inet_ntop...none needed
Checking libs for socket...none needed
Checking for ualarm...ok
Checking for lstat...ok
Checking for fork...ok
Checking for system...ok
Checking for select...ok
Checking for execvpe...ok
Checking for geteuid...ok
Checking for mkstemp...ok
Checking for isatty...ok
Checking for regcomp...ok
Checking for waitpid...ok
Checking for sigaction...ok
Checking for sys_signame...not found
Checking for sys_siglist...ok
Checking for isascii...ok
Checking for syslog...ok
Checking for opendir...ok
Checking for readlink...ok
Checking for sleep...ok
Checking for usleep...ok
Checking for pipe...ok
Checking for getaddrinfo...ok
Checking for utimes...ok
Checking for shutdown...ok
Checking for socketpair...ok
Checking for link...ok
Checking for symlink...ok
Checking for fsync...ok
Checking for dup...ok
Checking for umask...ok
Checking for localtime...ok
Checking for gmtime...ok
Checking for strptime...ok
Checking for realpath...ok
Checking for isinf...ok
Checking for isnan...ok
Checking for vfork...ok
Checking libs for backtrace...none needed
Checking libs for openpty...-lutil
Checking for sysinfo...ok
Checking for struct sysinfo.uptime...ok
Checking for struct stat.st_mtimespec...not found
Checking for struct stat.st_mtim...ok
Checking for struct flock...ok
Checking for sys/types.h...(cached) ok
Checking if -D_FILE_OFFSET_BITS=64 is needed...no
Checking for fseeko...ok
Checking for ftello...ok
Checking for make...ok
Checking for asciidoc...no
Checking for sed...ok
Checking for _NSGetEnviron...not found
Checking environ declared in unistd.h...yes
Checking for sys/types.h...(cached) ok
Checking for sys/stat.h...(cached) ok
Checking for mkdir with one arg...no
Checking for S_IXUSR...ok
Checking for S_IRWXG...ok
Checking for S_IRWXO...ok
Enabling references
Building static library
Extension jsonencode...enabled
Extension json...enabled
Extension aio...enabled
Extension array...enabled
Extension clock...enabled
Extension eventloop...enabled
Extension exec...enabled
Extension file...enabled
Extension readdir...enabled
Extension glob...enabled
Extension history...enabled
Extension interp...enabled
Checking libs for dlopen...-ldl
Extension load...enabled
Extension nshelper...enabled
Extension namespace...enabled
Extension oo...enabled
Extension pack...enabled
Extension package...enabled
Extension posix...enabled
Extension regexp...enabled
Extension signal...enabled
Extension stdlib...enabled
Extension syslog...enabled
Extension tclcompat...enabled
Extension tree...enabled
Checking for clock_gettime...ok
Using built-in regexp
Jim static extensions: aio array clock eventloop exec file glob history interp json jsonencode load namespace nshelper oo pack package posix readdir regexp signal stdlib syslog tclcompat tree
Created jim-config.h
Created jimautoconf.h
Created Makefile from Makefile.in
Created tests/Makefile from tests/Makefile.in
Created examples.api/Makefile from examples.api/Makefile.in
Created build-jim-ext from build-jim-ext.in
Created jimtcl.pc from jimtcl.pc.in
OpenOCD configuration summary
--------------------------------------------------
MPSSE mode of FTDI based devices yes (auto)
ST-Link Programmer yes (auto)
TI ICDI JTAG Programmer yes (auto)
Keil ULINK JTAG Programmer yes (auto)
ANGIE Adapter yes (auto)
Altera USB-Blaster II Compatible yes (auto)
Bitbang mode of FT232R based devices yes (auto)
Versaloon-Link JTAG Programmer yes (auto)
TI XDS110 Debug Probe yes (auto)
CMSIS-DAP v2 Compliant Debugger yes (auto)
OSBDM (JTAG only) Programmer yes (auto)
eStick/opendous JTAG Programmer yes (auto)
Olimex ARM-JTAG-EW Programmer yes (auto)
Raisonance RLink JTAG Programmer yes (auto)
USBProg JTAG Programmer yes (auto)
Espressif JTAG Programmer yes (auto)
CMSIS-DAP Compliant Debugger yes (auto)
Nu-Link Programmer yes (auto)
Cypress KitProg Programmer yes (auto)
Altera USB-Blaster Compatible yes (auto)
ASIX Presto Adapter yes (auto)
OpenJTAG Adapter yes (auto)
SEGGER J-Link Programmer no
Bus Pirate yes (auto)
Dummy Adapter no
Use Capstone disassembly framework no
$ make
$ make install
Tweet
write: 2024/08/05/ 10:00:00