I cannot manage to run debugger on the microcontroller I’m using. The microcontroller is based on esp32-s3, in particular it is this one: GitHub - Xinyuan-LilyGO/T-RGB. I start to think that maybe its not even possible on that particular board.
I’m using VSCode. I followed this guide to install the right drivers for USB to access the JTAG interface: Configure ESP32-S3 Built-in JTAG Interface - ESP32-S3 - — ESP-IDF Programming Guide latest documentation. It landed on COM6 and it is also the port for uploading. It is called “USB JTAG/serial debug unit (Interface 0)”. Then I updated the platformio.ini with this line: debug_tool = esp-builtin
Then when running “PIO Debug” it fails with the following messages:
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!
This looks like the access through USB port is not working, so I added to configuration file this line: debug_port = COM6
It looked more promissing, as after the build (before upload) it taken some time before it responded. However, after about a minute it ended with this error message:
Thank you (and Eduardo) for trying to help
The step by step guideline is pretty good. I did follow it, but ended at step 4.
I see something strange locally which very well can be behind the whole problem. When setting the ports with Zadig tool, I end up with this:
The “USB-JTAG/serial debug unit(Interface 0)” on COM6 seems to be correct, exactly as described in the guideline. But according to the guideline I should see something like “USB-Enhanced-SERIAL CH323” on a different COM. And this is what I don’t see, even though I completed the install with Zadig on “interface 2” and target “WinUSB” before.
So consequently I had to use the same COM for both upload and monitor port like this:
… but that probably does not make much sense. It ended up with the usual:
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!
Thank you for the answer, Zapta! When you say serial port 0, you mean UART0, right? I do use Zadig tool (I followed the above reference) - from what I understand it can map the UART port to COM. But while in the reference Eduardo managed to map 2 COM ports, I managed only one - I’m missing the “USB-Enhanced-SERIAL CH323”.
The errors you listed are what I get before I do the zadig setting, or when the zadiq setting is lost for some reason.
Error: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED
Error: libusb_open() failed with LIBUSB_ERROR_NOT_FOUND
Here is what I see on my computer (after zagid setting). Be careful with the zadig settings because I don’t know of a simple way to undo them. I use Acronis Try & Decide for risky stuff.
Windows device manager, before I plug in the debugger:
Windows device manager, after I plug in the debugger (only one port is added):
And I also see this:
In Zadig, interface 0 looks like this:
And interface 1 looks like this:
This is my platformio.ini. It uses the standard (non debugger related) USB/Serial port to run in release mode and the debugger to run in debug mode.
Finally got the debugger working! You were right, Zapta, the problem was related to usb driver and that it could be resolved by Zadig tool.
I found answer to my particular problem in this forum: libusb_get_string_descriptor_ascii() returns always LIBUSB_ERROR_NOT_FOUND -- libusb0.sys only · Issue #761 · libusb/libusb · GitHub
And the problem was that for the debugging JTAG interface, that is “Interface 2” I was using “libusb0” driver. When starting to use “libusbK”, the debugger started to work. This was the relevant text from the linked forum:
{{
Take note it is not recommended to use libusb0.sys with libusb Windows. It is mentioned in the wiki. Windows · libusb/libusb Wiki · GitHub
}}
Well, that was hard…