OpenOCD + DAP-LINK调试ESP32的失败经历

目的

手里有调试STM32的DAP-LINK,想试试通过JTAG调试ESP32

OpenOCD支持CMSIS-DAP

DAP-LINK支持的芯片,我手上这款描述如下,应该JTAG协议的都支持

平台

windows10 + ESP-IDF

ESP-WROOM-32E模组 + 烧录底座

DAP-LINK

乐鑫OpenOCD

使用乐鑫官方的OpenOCD,结果无法识别CMSIS-DAP设备

F:\Espressif\tools\openocd-esp32\v0.11.0-esp32-20220706\openocd-esp32\share\openocd\scripts>F:\Espressif\tools\openocd-esp32\v0.11.0-esp32-20220706\openocd-esp32\bin\openocd.exe -f interface/cmsis-dap.cfg
Open On-Chip Debugger  v0.11.0-esp32-20220706 (2022-07-06-15:48)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
adapter speed: 1000 kHz

Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Error: unable to find a matching CMSIS-DAP device


F:\Espressif\tools\openocd-esp32\v0.11.0-esp32-20220706\openocd-esp32\share\openocd\scripts>

官方OpenOCD

官方接口支持CMSIS-DAP,但是芯片并不支持ESP32

有cmsis-dap.cfg

没有esp32的cfg

使用官方OpenOCD,配置文件使用乐鑫的,CMSIS-DAP可以正常识别,但确实不支持ESP32芯片

F:\Espressif\tools\openocd-esp32\v0.11.0-esp32-20220706\openocd-esp32\share\openocd\scripts>openocd -f interface/cmsis-dap.cfg
Open On-Chip Debugger 0.11.0 (2021-11-18) [https://github.com/sysprogs/openocd]
Licensed under GNU GPL v2
libusb1 09e75e98b4d9ea7909e8837b7a3f00dda4589dc3
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
adapter speed: 1000 kHz

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: Atomic commands supported
Info : CMSIS-DAP: FW Version = 1.10
Info : CMSIS-DAP: Interface Initialised (JTAG)
Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 1 TDO = 1 nTRST = 0 nRESET = 1
Info : CMSIS-DAP: Interface ready
Info : clock speed 1000 kHz
Error: session transport was not selected. Use 'transport select <transport>'
Error: Transports available:
Error: swd
Error: jtag



F:\Espressif\tools\openocd-esp32\v0.11.0-esp32-20220706\openocd-esp32\share\openocd\scripts>openocd -f interface/cmsis-dap.cfg -f board/esp-wroom-32.cfg
Open On-Chip Debugger 0.11.0 (2021-11-18) [https://github.com/sysprogs/openocd]
Licensed under GNU GPL v2
libusb1 09e75e98b4d9ea7909e8837b7a3f00dda4589dc3
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
adapter speed: 1000 kHz

WARNING: boards/esp-wroom-32.cfg is deprecated, and may be removed in a future release.
target/esp32.cfg:53: Error: Unknown target type esp32, try one of arm7tdmi, arm9tdmi, arm920t, arm720t, arm966e, arm946e, arm926ejs, fa526, feroceon, dragonite, xscale, cortex_m, cortex_a, cortex_r4, arm11, ls1_sap, mips_m4k, avr, dsp563xx, dsp5680xx, testee, avr32_ap7k, hla_target, nds32_v2, nds32_v3, nds32_v3m, or1k, quark_x10xx, quark_d20xx, stm8, riscv, mem_ap, esirisc, arcv2, aarch64,  or mips_mips64
in procedure 'script'
at file "embedded:startup.tcl", line 26
at file "board/esp-wroom-32.cfg", line 5
at file "target/esp32.cfg", line 53

F:\Espressif\tools\openocd-esp32\v0.11.0-esp32-20220706\openocd-esp32\share\openocd\scripts>

结论

  1. 乐鑫OpenOCD不支持CMSIS-DAP

  2. 官方OpenOCD支持CMSIS-DAP,但是不支持乐鑫的芯片

  3. 寄,还是下单了ESPLink

posted @ 2023-01-01 17:12  新世纪摆烂战士  阅读(2839)  评论(0编辑  收藏  举报