ESP32C3 with OpenOCD
Posted: Fri Nov 18, 2022 3:25 pm
I'm working on a windows 10 computer using Visual Studio Code 1.73.1, ESP IDF 4.4.2 and OpenOCD 0.11.0. My development board is an ESP32C3 DevkitM-1 V1.0. I've been porting a product to the Espressif system, but I'm at a point where I need to debug some pointer issues and need live debugging. I had yet to get OpenOCD working so I set out to make it work. Since the ESP32C3 has a JTAG system built in I should be able to debug using a USB cable plugged into the dev kit. I have an ESP-PROG board as well, that I have tried plugging into the Correct pins on the ESP32C3 (which is different than just the ESP32) and have not had sucess with that. I have use zadig and tried a couple of different drivers for both the ESP-PROG ftdi chip and for the DevkitM-1 without changing results.
Some of the tutorials that I watched made it sound like OpenOCD came bundled with ESP IDF, but I did not see it. I added it in along side my IDF installation and that seems to be ok. Ultimately I plan on automating the launch of OpenOCD as explained in this tutorial: https://www.youtube.com/watch?v=uq93H7T7cOQ, but right now I am launching OpenOCD from the Powershell terminal from within VSCode. The command that seems the most appropriate for using the built in JTAG is 'openocd -f $OPENOCD_SCRIPTS/board/esp32c3-builtin.cfg'. Here is the output:
'Error: The specified debug interface was not found (esp_usb_jtag)' is my issue. It seems that a debug adapter is missing. I'm not sure if this is hardware (like an incorrect driver so OpenOCD cannot find the hardware) or a chunk of software (to link OpenOCD to the driver). I've dug through the .cfg files and they are there and the files they are dependent on seem to be there. In esp_usb_jtag.cfg line 6 is 'adapter driver esp_usb_jtag' and this happens to be in the interface folder, so it seems to exist to this point.
I've tried searching for the error that I am having, but I have been unable someone else that has had this same error.
I have tried a few other .cfg files and they all fail as well with or without the ESP-PROG board.
What am I missing here to get OpenOCD to play nice with the ES32C3?
Some of the tutorials that I watched made it sound like OpenOCD came bundled with ESP IDF, but I did not see it. I added it in along side my IDF installation and that seems to be ok. Ultimately I plan on automating the launch of OpenOCD as explained in this tutorial: https://www.youtube.com/watch?v=uq93H7T7cOQ, but right now I am launching OpenOCD from the Powershell terminal from within VSCode. The command that seems the most appropriate for using the built in JTAG is 'openocd -f $OPENOCD_SCRIPTS/board/esp32c3-builtin.cfg'. Here is the output:
Code: Select all
PS C:\projects\Espressif_prj\myLifterESP> openocd -f $OPENOCD_SCRIPTS/board/esp32c3-builtin.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
Error: The specified debug interface was not found (esp_usb_jtag)
The following debug adapters are available:
1: ftdi
2: usb_blaster
3: usbprog
4: jlink
5: vsllink
6: rlink
7: ulink
8: arm-jtag-ew
9: hla
10: osbdm
11: opendous
12: aice
13: picoprobe
14: cmsis-dap
15: xds110
16: st-link
I've tried searching for the error that I am having, but I have been unable someone else that has had this same error.
I have tried a few other .cfg files and they all fail as well with or without the ESP-PROG board.
What am I missing here to get OpenOCD to play nice with the ES32C3?