ESP32-C3 Unresolved inclusions, Solved OpenOcd Problem
Posted: Sun May 23, 2021 3:05 pm
Edited to show solution to OpenOCD ESP32-C3 ( see at the end)
I have modified my ESP32-C3 devkit to use the internal USB. I can program the device from both idf.py and Eclipse (!). I have a number of problems:
1) I can compile and flash successfully, however, Eclipse shows unresolved inclusions so when I go to flash I get an "error" but if I ignore I can flash. Various permutations of "clean", index, freshen, etc. have no effect. This would likely render attempts to debug useless. I am on Eclipse Version: 2021-03 (4.19.0) Build id: 20210312-0638 which is the one the ESP-IDF downloaded.
Usually with Eclipse you can simple add files to the project but that does not seem to be an option here.
Edit I discovered I also get the following CMake Warning at C:/Users/bjpic/Desktop/esp-idf/tools/cmake/crosstool_version_check.cmake:28 (message): but I do not know what that means
2) When I try and use the built in JTAG debugger it fails.
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 : only one transport option; autoselect 'jtag'
adapter speed: 40000 kHz
Thanks
Warn : Interface already configured, ignoring
Warn : Transport "jtag" was already selected
force hard breakpoints
Started by GNU MCU Eclipse
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: esp_usb_jtag: could not find or open device!
The details are
Error in final launch sequence
Failed to execute MI command:
-target-select remote localhost:3333
Error message from debugger back end:
localhost:3333: No connection could be made because the target machine actively refused it.
Failed to execute MI command:
-target-select remote localhost:3333
Error message from debugger back end:
localhost:3333: No connection could be made because the target machine actively refused it.
localhost:3333: No connection could be made because the target machine actively refused it.
My debug configuration is
-s ${openocd_path}/share/openocd/scripts -f interface/esp_usb_jtag.cfg -f board/esp32c3-builtin.cfg
I have tried opening Windows Firewall local port 3333 and local port all ports and it doesn't seem to matter.
Solution to OpenOCD ESP32-C3:
Apparently the proper driver was only partially installed for the ESP32-C3 USB port. I downloaded this tool https://visualgdb.com/UsbDriverTool/ and it showed warning triangle on the JTAG port. I selected it, right clicked, and installed the Libusb-WinUSB driver. After that OpenOCD loads fine. I still have the unresolved inclusions problem which I believe stops me from debugging. I will make a new post.
I have modified my ESP32-C3 devkit to use the internal USB. I can program the device from both idf.py and Eclipse (!). I have a number of problems:
1) I can compile and flash successfully, however, Eclipse shows unresolved inclusions so when I go to flash I get an "error" but if I ignore I can flash. Various permutations of "clean", index, freshen, etc. have no effect. This would likely render attempts to debug useless. I am on Eclipse Version: 2021-03 (4.19.0) Build id: 20210312-0638 which is the one the ESP-IDF downloaded.
Usually with Eclipse you can simple add files to the project but that does not seem to be an option here.
Edit I discovered I also get the following CMake Warning at C:/Users/bjpic/Desktop/esp-idf/tools/cmake/crosstool_version_check.cmake:28 (message): but I do not know what that means
2) When I try and use the built in JTAG debugger it fails.
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 : only one transport option; autoselect 'jtag'
adapter speed: 40000 kHz
Thanks
Warn : Interface already configured, ignoring
Warn : Transport "jtag" was already selected
force hard breakpoints
Started by GNU MCU Eclipse
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: esp_usb_jtag: could not find or open device!
The details are
Error in final launch sequence
Failed to execute MI command:
-target-select remote localhost:3333
Error message from debugger back end:
localhost:3333: No connection could be made because the target machine actively refused it.
Failed to execute MI command:
-target-select remote localhost:3333
Error message from debugger back end:
localhost:3333: No connection could be made because the target machine actively refused it.
localhost:3333: No connection could be made because the target machine actively refused it.
My debug configuration is
-s ${openocd_path}/share/openocd/scripts -f interface/esp_usb_jtag.cfg -f board/esp32c3-builtin.cfg
I have tried opening Windows Firewall local port 3333 and local port all ports and it doesn't seem to matter.
Solution to OpenOCD ESP32-C3:
Apparently the proper driver was only partially installed for the ESP32-C3 USB port. I downloaded this tool https://visualgdb.com/UsbDriverTool/ and it showed warning triangle on the JTAG port. I selected it, right clicked, and installed the Libusb-WinUSB driver. After that OpenOCD loads fine. I still have the unresolved inclusions problem which I believe stops me from debugging. I will make a new post.