user@user:~/openocd$ sudo ./configure
checking for makeinfo... makeinfo
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
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
...
#####################中间省略##########################...
libjaylink configuration summary:
- Package version ................0.2.0
- Library version ................1:0:1
- Installation prefix ............ /usr/local
- Building on .................... x86_64-pc-linux-gnu
- Building for................... x86_64-pc-linux-gnu
Enabled transports:
- USB ............................yes
- TCP ............................yes
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)
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)
Andes JTAG Programmer yes(auto)
CMSIS-DAP Compliant Debugger yes(auto)
Nu-Link Programmer yes(auto)
Cypress KitProg Programmer yes(auto)
Altera USB-Blaster Compatible no
ASIX Presto Adapter no
OpenJTAG Adapter no
Linux GPIO bitbang through libgpiod no
SEGGER J-Link Programmer yes(auto)
Bus Pirate yes(auto)
Use Capstone disassembly framework no
编译
user@user:~/openocd$ sudomake
安装
user@user:~/openocd$ sudomakeinstall
查看版本(安装成功)
user@user:~/openocd$ openocd --version
Open On-Chip Debugger 0.11.0+dev-00615-gbe0d68eb6 (2022-03-15-23:06)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
2. 配置OpenOCD
修改jlink.cfg
## SEGGER J-Link## http://www.segger.com/jlink.html#
adapter driver jlink
# add swd config
transport select swd
# add speed config
adapter speed 20000#khz# The serial number can be used to select a specific device in case more than# one is connected to the host.## Example: Select J-Link with serial number 123456789## adapter serial 123456789
应用配置
user@user:~/openocd$ sudo openocd -f /usr/local/share/openocd/scripts/interface/jlink.cfg -f /usr/local/share/openocd/scripts/target/stm32f4x.cfg
Open On-Chip Debugger 0.11.0+dev-00615-gbe0d68eb6 (2022-03-15-23:06)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
adapter speed: 50000 kHz
Info : Listening on port 6666for tcl connections
Info : Listening on port 4444for telnet connections
Info : J-Link ARM-OB STM32 compiled Aug 22201219:52:04
Info : Hardware version: 7.00
Info : VTarget =3.300 V
Info : clock speed 2000 kHz
Info : SWD DPIDR 0x00000000