ESP32和ESP-PROG的调试


入手了一个esp-prog想尝试调试一下

发现步入了官方都没发现的坑

1.因为装的是官方的esp-idf离线版,里面驱动都已经下载好了。打开设备管理器,连esp-prog可以看见2个com。官方说是正常现象。

 

 

然后在esp-idf中输入自己工程的位置,配置工程都是顺风顺水的。

 

 

 

 

 

 

 

但是实际照着官方后面调试简介中的运行openocd,就开始遇见问题了

 

openocd -f board/esp32-wrover-kit-3.3v.cfg

输入后,esp-prog识别不到,官方也没给个解释

E:\project\uart_async_rxtxtasks>openocd -f board/esp32-wrover-kit-3.3v.cfg 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
Info : Listening on port 6666 for tcl connections Info : Listening on port 4444 for telnet connections Error: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED Error: libusb_open() failed with LIBUSB_ERROR_NOT_FOUND Error: no device found Error: unable to open ftdi device with vid 0403, pid 6010, description '*', serial '*' at bus location '*' Error: no device found Error: unable to open ftdi device with vid 0403, pid 6014, description '*', serial '*' at bus location '*' Assertion failed! Program: E:\ESP-TOOL\.espressif\tools\openocd-esp32\v0.10.0-esp32-20210401\openocd-esp32\bin\openocd.exe File: ../src/jtag/core.c, Line 343 Expression: jtag_trst == 0

后面百度发现,是驱动问题,需要下载Zadig工具,步骤可以参考大佬的博客,安装完之后,驱动正常,

 

 

 

重来一遍出现了这个,上面找不到另一个usb端口(怀疑是串口的),我都不知道成没成功。

 

 

 

E:\project\uart_async_rxtxtasks>openocd -f board/esp32-wrover-kit-3.3v.cfg 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
Info : Listening on port 6666 for tcl connections Info : Listening on port 4444 for telnet connections Error: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED Info : ftdi: if you experience problems at higher adapter clocks, try the command "ftdi_tdo_sample_edge falling" Info : clock speed 20000 kHz Info : JTAG tap: esp32.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1) Info : JTAG tap: esp32.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1) Info : esp32.cpu0: Target halted, PC=0x400D5295, debug_reason=00000001 Info : esp32.cpu1: Target halted, PC=0x400E4036, debug_reason=00000000 Info : Listening on port 3333 for gdb connections

最后百度查到乐鑫官方论坛中,技术人员说这是已经能和esp-prog的板子沟通正常了,可以去尝试debug。我当时很无语,因为我沟通正常也没能debug。

然后查找问题可能出在eclipse上,我用的是eclipse2021-06版的,里面有专门的espressif 关于gdb openocd 的配置。

打开debug configurations

双击esp-idf gdb openocd debugging

 

 

 

点击disable

 

 

 

根据自己的板子型号选择开发板

 

 

 这时它会出错,

 

 

 

 1~2行,说明openocd是运行正常的

3~7行,是错误报告。说明错误出现在它找不到boards/esp32-wrover-kit-3.3v.cfg

1 Open On-Chip Debugger  v0.10.0-esp32-20210401 (2021-04-01-15:46) 2 Licensed under GNU GPL v2 3 For bug reports, read 4     http://openocd.org/doc/doxygen/bugs.html
5 embedded:startup.tcl:26: Error: Can't find boards/esp32-wrover-kit-3.3v.cfg
6 in procedure 'script' 
7 at file "embedded:startup.tcl", line 26

可是我之前在esp-idf 4.3 cmd 执行过这个指令:

openocd -f board/esp32-wrover-kit-3.3v.cfg

 

 技术人员说没问题,那就一定没有问题。

翻看它说找不到文件的地方:

E:\ESP-TOOL\.espressif\tools\openocd-esp32\v0.10.0-esp32-20210401\openocd-esp32\share\openocd\scripts\board,找到了文件

 

 

 好的,破案了。

重新回到debug configurations的这个页面,把boards改成board就好

 

 

 

随后,日志正常输出!!!(看红色的那边)

 

 

 折腾了8小时,就只为调试。。。道路且长且珍惜


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM