关于openocd,用cmsis-dap时报错

DJZ1992
Posts: 10
Joined: Fri Jul 09, 2021 9:15 am

关于openocd,用cmsis-dap时报错

Postby DJZ1992 » Thu Jul 22, 2021 1:23 pm

用cmsis-dap时进行openocd时报错,如下。
是不是官方安装软件内安装的openocd不支持cmsisi-dap?需要重新编译一下openocd?
Open On-Chip Debugger v0.10.0-esp32-20210401 (2021-04-01-15:46)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Error: The specified debug interface was not found (cmsis-dap)
The following debug interfaces are available:
1: ftdi
2: usb_blaster
3: esp_usb_jtag
4: esp_usb_jtag
5: ft232r
6: jlink
7: vsllink
8: ulink
9: hla
10: osbdm
11: opendous
12: aice
13: xds110
14: jtag_esp_remote

ESP_Gargamel
Posts: 518
Joined: Wed Nov 14, 2018 8:45 am

Re: 关于openocd,用cmsis-dap时报错

Postby ESP_Gargamel » Fri Jul 23, 2021 1:57 am

不支持,不能确认 openocd 里开启 cmsisi-dap 后是否能很好支持,可能会花费你一定时间,建议买个 ftdi 类的仿真器。

DJZ1992
Posts: 10
Joined: Fri Jul 09, 2021 9:15 am

Re: 关于openocd,用cmsis-dap时报错

Postby DJZ1992 » Sun Jul 25, 2021 6:15 am

按照教程,搞了两天,简直了。
我在window下编译,./bootstrap和./configure都可以了。但是make的时候报错

一个是编译过程中有错
In file included from ./src/target/algorithm.h:25,
from src/target/riscv/riscv-011.c:15:
src/target/riscv/riscv-011.c: In function ‘dbus_scan’:
./src/helper/binarybuffer.h:93:19: error: ‘out’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
93 | buffer[i / 8] &= ~(1 << (i % 8));
|

另一个是最后的报错
make[2]: Leaving directory '/d/esp32/openocd-esp322'
make[1]: *** [Makefile:4508: all-recursive] Error 1
make[1]: Leaving directory '/d/esp32/openocd-esp322'
make: *** [Makefile:2104: all] Error 2

ESP_Gargamel
Posts: 518
Joined: Wed Nov 14, 2018 8:45 am

Re: 关于openocd,用cmsis-dap时报错

Postby ESP_Gargamel » Mon Jul 26, 2021 7:48 am

如果你对 openocd 不是特别熟悉,外加这又是在 windows 平台编译,会需要你一定时间去解决此类问题。所以之前已建议购买个仿真器,节省时间,比如使用 ESP-PROG:https://item.taobao.com/item.htm?spm=a1 ... 3567062944
如果能解决相关编译问题,那自然是最好的,也请分享给大家。
另外,找到个相关的仓库,供参考:https://github.com/vllogic/openocd_cmsis-dap_v2,先看下他的 wiki。

DJZ1992
Posts: 10
Joined: Fri Jul 09, 2021 9:15 am

Re: 关于openocd,用cmsis-dap时报错

Postby DJZ1992 » Tue Jul 27, 2021 6:45 am

谢谢。
用您给的连接中的方法,最后make遇到了和之前一样的error
最后发现只要搜索全文件的uint32_t status;
改为:
uint32_t status=0;
再make,就可以成功

DJZ1992
Posts: 10
Joined: Fri Jul 09, 2021 9:15 am

Re: 关于openocd,用cmsis-dap时报错

Postby DJZ1992 » Tue Jul 27, 2021 6:49 am

ESP_Gargamel wrote:
Mon Jul 26, 2021 7:48 am
如果你对 openocd 不是特别熟悉,外加这又是在 windows 平台编译,会需要你一定时间去解决此类问题。所以之前已建议购买个仿真器,节省时间,比如使用 ESP-PROG:https://item.taobao.com/item.htm?spm=a1 ... 3567062944
如果能解决相关编译问题,那自然是最好的,也请分享给大家。
另外,找到个相关的仓库,供参考:https://github.com/vllogic/openocd_cmsis-dap_v2,先看下他的 wiki。
make成功后,总是连不上esp32.
报错如下:
Administrator@MUSE-20210310SK MINGW32 /d/ESP/openocd_cmsis-dap_v2-esp32-yuanma/openocd_cmsis-dap_v2-esp32
# openocd -f interface/cmsis-dap.cfg -f target/esp32.cfg
Open On-Chip Debugger 6de1c90a-dirty (2021-07-27-12:38)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : CMSIS-DAP: SWD Supported
Info : CMSIS-DAP: JTAG Supported
Info : CMSIS-DAP: FW Version = 0254
Info : CMSIS-DAP: Serial# = 07000001066cff495252836687214753a5a5a5a597969908
Info : CMSIS-DAP: Interface Initialised (JTAG)
Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 1 TDO = 1 nTRST = 0 nRESET = 1
Error: CMSIS-DAP command CMD_DAP_SWJ_CLOCK failed.

Assertion failed: jtag_trst == 0, file src/jtag/core.c, line 343

ESP_Gargamel
Posts: 518
Joined: Wed Nov 14, 2018 8:45 am

Re: 关于openocd,用cmsis-dap时报错

Postby ESP_Gargamel » Tue Jul 27, 2021 11:45 am

这个问题,麻烦再到 openocd_cmsis-dap_v2 仓库去咨询一下。

DJZ1992
Posts: 10
Joined: Fri Jul 09, 2021 9:15 am

Re: 关于openocd,用cmsis-dap时报错

Postby DJZ1992 » Fri Jul 30, 2021 1:15 am

你好,我买了esp-prog,但是应该使用interface里的哪一个cfg呢?
没有看到又esp-prog.cfg文件。
使用esp-usb-jtag也不行,usbprog也不行。。。

Who is online

Users browsing this forum: DJZ1992, ESP_Gargamel and 15 guests