Starting debugger fails: "LIBUSB_ERROR_NOT_SUPPORTED"

Hi
I bought the esp32 nano boards and followed the debugging guide step by step for windows. However I am not able to connect the debugger...
Getting the following error:
CDRTOSConfigure
Info : only one transport option; autoselect 'jtag'
Info : esp_usb_jtag: VID set to 0x303a and PID to 0x1001
Info : esp_usb_jtag: capabilities descriptor set to 0x2000
Warn : Transport "jtag" was already selected
Info : Listening on port 50001 for tcl connections
Info : Listening on port 50002 for telnet connections
Error: esp_usb_jtag: could not find or open device!

Any help please?

Hi
In my ealier post I was trying with windows and method 2 as mentioned the debugging guide..
Now I tried with Method 1 (windows only) and I was able to upload the code using "Sketch->Upload using programmer" option.
After that I did hard reset by pressing the reset button (with B1 and GND open). TIll then everything works as described.
Now when I attach the GDB I get the following error:
Info : esp_usb_jtag: VID set to 0x303a and PID to 0x1001
Info : esp_usb_jtag: capabilities descriptor set to 0x2000
Warn : Transport "jtag" was already selected
Info : Listening on port 50001 for tcl connections
Info : Listening on port 50002 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!

Hi @pthakkar. This error indicates you have not installed the drivers for the Nano ESP32 board.

This can happen under either of the following conditions:

  • You installed the "esp32" boards platform instead of the "Arduino ESP32 Boards" platform.
    Although both platforms provide support for the Nano ESP32, only the "Arduino ESP32 Boards" platform installs the board's drivers.
  • You installed the "Arduino ESP32 Boards" platform, but then dismissed the Windows UAC dialog for the driver installer:

    Do you want to allow this app from an unknown publisher to make changes to your device?

    dpinst-amd64.exe

The solution will be to (re?)install the "Arduino ESP32 Boards" platform, making sure to approve the driver installation offer:

  1. Select Tools > Board > Boards Manager... from the Arduino IDE menus to open the "Boards Manager" view in the left side panel.
  2. Scroll down through the list of boards platforms until you see the "Arduino ESP32 Boards" entry.
  3. If you see a label like "2.0.13 installed", hover the mouse pointer over the "Arduino ESP32 Boards" entry, click the โ—โ—โ— icon, select "Remove" from the menu and then wait for the uninstallation process to finish.
  4. Click the "INSTALL" button at the bottom of the "Arduino ESP32 Boards" entry.
  5. You should now see a "User Account Control" dialog about dpinst-amd64.exe asking whether you "want to allow this app from an unknown publisher to make changes to your device". Click the "Yes" button in the dialog.
  6. Wait for the installation process to finish, as indicated by a notification at the bottom right corner of the Arduino IDE window:

    Successfully installed platform ...

After you have done that, try using the debugger again, following the tutorial. Hopefully it will work this time. If not, please let us know and we'll provide further assistance.

1 Like

Hi

I repeated the steps as suggsted by you. The debugger do seems to get connected by I get a lots of errors:

Error: libusb_bulk_write error: LIBUSB_ERROR_IO
Error: esp_usb_jtag: device not found!
Error: esp_usb_jtag: failed to revive USB device!
Error: libusb_bulk_write error: LIBUSB_ERROR_IO
Error: esp_usb_jtag: device not found!
Error: esp_usb_jtag: failed to revive USB device!
Error: missing data from bitq interface
Error: libusb_bulk_write error: LIBUSB_ERROR_IO
Error: esp_usb_jtag: device not found!
Error: esp_usb_jtag: failed to revive USB device!
Error: missing data from bitq interface
Error: Failed to exec JTAG queue!
Error: Failed to read debug stubs address location (-104)!
Polling target esp32s3.cpu0 failed, trying to reexamine
Error: libusb_bulk_write error: LIBUSB_ERROR_IO
Error: esp_usb_jtag: device not found!
Error: esp_usb_jtag: failed to revive USB device!
Error: libusb_bulk_write error: LIBUSB_ERROR_IO
Error: esp_usb_jtag: device not found!
Error: esp_usb_jtag: failed to revive USB device!
Error: libusb_bulk_write error: LIBUSB_ERROR_IO
Error: esp_usb_jtag: device not found!
Error: esp_usb_jtag: failed to revive USB device!
Error: missing data from bitq interface
Error: [esp32s3.cpu0] Unexpected OCD_ID = 0b339fd2
Examination failed, GDB will be halted. Polling again in 6300ms

OK, I think this is good progress at least!

Which version of Arduino IDE are you using (e.g., "2.0.1")? The version is shown on the window title bar and also in the dialog that opens when you select Help > About (or Arduino IDE > About Arduino IDE for macOS users) from the Arduino IDE menus.

I am using version 2.3.2

Version: 2.3.2
Date: 2024-02-20T10:04:35.814Z
CLI Version: 0.35.3

Copyright ยฉ 2024 Arduino SA

OK, this is the reason for the the new problem. There was a major reworking of the debugger configuration system in Arduino IDE 2.3.0. Due to the unusual implementation of the debugging configuration used by the "esp32" platform to overcome limitations of the initial system, debugging support is temporarily lost for ESP32-based boards when using Arduino IDE versions 2.3.0 and newer.

The platform has already been migrated to the new system:

So now the only thing we are waiting for is a new release of the platform. Once that happens, you will be able to update the "Arduino ESP32 Boards" platform via the Arduino IDE Boards Manager as usual and
debugging will work in the latest versions of Arduino IDE.

For now, please use Arduino IDE 2.2.1 when you want to use the debugger with the Nano ESP32 or other ESP32-based boards.

I'll provide instructions you can follow to install Arduino IDE 2.2.1:

  1. Click the following link to open the page for the 2.2.1 release in the Arduino IDE GitHub repository:
    Release 2.2.1 ยท arduino/arduino-ide ยท GitHub
  2. From the list of download links under the "Assets" section of the page, click the link with the name arduino-ide_2.2.1_Windows_64bit.exe (or arduino-ide_2.2.1_Windows_64bit.msi / arduino-ide_2.2.1_Windows_64bit.zip if you prefer those packages).
  3. Wait for the download to finish.
  4. Install Arduino IDE from the downloaded file as you would normally do.

When using Arduino IDE 2.2.1, you will find that Arduino IDE periodically shows an "Update Available" dialog to offer you an update to the newer version of Arduino IDE. You must not accept these updates until after you see that a new version of the "Arduino ESP32 Boards" boards platform has been released.

The IDE will show a notification when the new release of the "Arduino ESP32 Boards" platform is available:

Updates are available for some of your boards.

Hi...That worked....Was able to attach the debugger to the board....However that was a blinky program I was using....
Now I am trying with my actual code where I am trying to interface an I2C sensor....There the debug option(net to the board name) is not getting enabled...

Great! I'm glad you were able to use the debugger.

There was a bug in Arduino IDE versions 2.2.0 and 2.2.1 that caused this:

The bug was fixed in 2.3.0, but unfortunately you can't use that version of Arduino IDE right now due to the temporary loss of debugger compatibility with the Nano ESP32 board. However, there is an easy workaround that will cause the button to be enabled as expected. I'll provide instructions you can follow to do that:

  1. Select Tools > Board > Arduino AVR Boards > Arduino Uno from the Arduino IDE menus.
    โ“˜ The Arduino Uno board was selected arbitrarily. You can select any board other than the "Arduino Nano ESP32" for this step.
  2. Select Tools > Board > Arduino ESP32 Boards > Arduino Nano ESP32 from the Arduino IDE menus once again.

You should now find that the "Start Debugging" button is enabled.

Any updates on this regarding on when 2.0.15 (including the fix) will be released for Arduino IDE 2.3.x?
In my BOARDS MANAGER there are the "Arduino ESP32 Boards" version 2.0.13 and "esp32" version 2.0.16, like shown in the image below:

image

If I install the esp32 package, it fails with:

Info : only one transport option; autoselecting 'jtag'
Info : esp_usb_jtag: VID set to 0x303a and PID to 0x1001
Info : esp_usb_jtag: capabilities descriptor set to 0x2000
Info : Listening on port 50001 for tcl connections
Info : Listening on port 50002 for telnet connections
Error: esp_usb_jtag: could not find or open device!
/home/bmeneg/.arduino15/packages/esp32/tools/openocd-esp32/v0.12.0-esp32-20230921/bin/../share/openocd/scripts/target/esp_common.cfg:9: Error: 
at file "/home/bmeneg/.arduino15/packages/esp32/tools/openocd-esp32/v0.12.0-esp32-20230921/bin/../share/openocd/scripts/target/esp_common.cfg", line 9

So I'm not sure if anything would change if the official Arduino package gets updated.
But 2.0.17 is already released but 2.0.13 is the latest in the IDE still.

Thanks.

Hi @bmeneguele.

Did you follow the setup instructions from the tutorial?:

https://docs.arduino.cc/tutorials/nano-esp32/debugging/#ide-setup

The 2.0.17 release was of the "esp32" boards platform, not of the "Arduino ESP32 Boards" platform. The newest available release of the "Arduino ESP32 Boards" platform is 2.0.13 so the fact that you see that version in your Boards Manager is expected.

Although the "Arduino ESP32 Boards" platform will generally follow the releases of the "esp32" platform on which it is based, the releases of each project are managed independently by different organizations. In cases where the changes shipped in a release of the "esp32" platform aren't relevant to users of the Nano ESP32 board supported by the "Arduino ESP32 Boards" platform, Arduino may decide it isn't worth the effort for the maintainers and disruption for the users to make a pointless release. Certainly there have been some very relevant changes in the recent releases of the "esp32" platform, and these will definitely be shipped by Arduino in an upcoming release of the "Arduino ESP32 Boards" platform, but it might take some time for the maintainers of the platform to find the time to prepare the release.

Until then, using the "esp32" platform will be a reasonable workaround in cases like this where the changes only available in the recent releases of that platform are needed.

Hi @ptillisch .

Did you follow the setup instructions from the tutorial?:

https://docs.arduino.cc/tutorials/nano-esp32/debugging/#ide-setup

Yes. I'm currently using Linux and have uploaded the code for debugging using the method 2 indicated in the tutorial. At the same time, I've also added the udev rules to the correct directory (/etc/udev/rules.d/) and added my user to the dialout group.

Until then, using the "esp32" platform will be a reasonable workaround in cases like this where the changes only available in the recent releases of that platform are needed.

Does it mean that the better place for seeking help on for the "esp32" failure would be directly on their github repo?

Thanks for the info!

Unfortunately the instructions in the tutorial are a bit difficult to follow due to the author's choice to document multiple methods for configuring the board into "Debug mode".

It is easy to miss this essential step that follows:

https://docs.arduino.cc/tutorials/nano-esp32/debugging/#manual-reset

After uploading a sketch using either Method 1 or Method 2 make sure to also manually reset the board by pressing the reset button once . Otherwise, it may not properly connect via USB and not show up inside the IDE.

If that reset is not performed, starting the debugger will fail with the "esp_usb_jtag: could not find or open device!" error you encountered.

So if you missed the reset step, please reset the board and then try starting the debugger once again.

No. This is the appropriate place to seek help.

Unless you see documentation explicitly stating otherwise, a GitHub repository is never the appropriate place to seek help. GitHub repositories should only be used to contribute to the development of a project.