Arduino IDE 2.3.2 debugger not working

Continuing the discussion from Problems using Arduino IDE debugger:

Hi all,
I'm having the same issue as fnarcis.
What catchers my eye is that openocd is trying to connect to esp_usb_jtag @ VID 0x303a PID 0x1001 but this USB device is not present.
I only see the Nano ESP32 USB device:
Bus 001 Device 015: ID **2341:0070** Arduino SA Nano ESP32
My host OS is Ubuntu 22.04.04 and I use the IDE ver. 2.3.2.
I have created the required UDEV file according to the Debugging Guide.
Uploading works fine but debugging does not.
Does any one have any idea what I might be doing wrong here?

Hi @seurat.

As was mentioned in the 2.3.0 release announcement:

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_Linux_64bit.AppImage (or arduino-ide_2.2.1_Linux_64bit.zip if you prefer using the ZIP package).
  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 "esp32" boards platform has been released.


There is already a guide for using the Arduino IDE 2.2.1 debugger with the Nano ESP32 board:

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

Once the new release of the "Arduino ESP32 Boards" platform comes out, you will be able to use that same guide with Arduino IDE >=2.3.0.

Hello @ptillisch,

Thank you for making me read through the Debugging Guide once more.
I have finally got debugging to work:

  • I installed the IDe ver. 2.2.1
  • I set the IDE according to the Debugging Guide. Debug Mode: Hardware CDC is important.
  • I then uploaded a sketch using "Upload using Programmer".
  • Afterwards I the device USB-ID was: Bus 001 Device 089: ID 303a:1001 Espressif USB JTAG/serial debug unit
  • If the Nano ESP32 is placed in boot mode it will identify itself as: Bus 001 Device 088: ID 2341:0070 Arduino SA Nano ESP32. Debugging will not work in this mode.

To use builtin debugging the device must not be in boot mode! Make sure it identifies itself as: Espressif USB JTAG/serial debug unit
I hope this helps anyone still having trouble getting the debugging to work.

2 Likes

Is the Nano ESP32 debugging capability restored in the IDE 2.3.3 by the 2.18 Board Manager release or should we wait for a future Board Manager release?

I did a very quick test using the blink test and it seemed to be working.

1 Like

It is indeed, thanks for pointing this out!

Perhaps I spoke to soon as I can't get any I/O to happen when using the debugger.

For example, I modified the blink sketch to do a Serial.print in loop():

void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(LED_BUILTIN, OUTPUT);

  Serial.begin(115200);
  delay(2000);

  Serial.println("Serial starting");
}

// the loop function runs over and over again forever
void loop() {
  static int i = 1;
  digitalWrite(LED_BUILTIN, HIGH);  // turn the LED on (HIGH is the voltage level)
  delay(1000);                      // wait for a second
  digitalWrite(LED_BUILTIN, LOW);   // turn the LED off by making the voltage LOW
  delay(1000);                      // wait for a second
  Serial.println("Serial: " + String(i));
  i = i+1;
}

The initial Serial.println call in setup() does work but I never see the call in the loop() do anything.

I am running IDE v 2.3.3 but I want to also install IDE version 2.2.1 to see if I can get Nano ESP32 debugging working for me. In July 2023 @ptillisch posted that this could be done on Windows using the .zip install file.

I have downloaded the 2.2.1 .zip file but I would appreciate some details on where to install this so as not to break the existing 2.3.3 installation.

Hi @dtone1. You can unzip the file to any location that is convenient. It doesn't matter where. It won't cause any problems for your 2.3.3 installation.

You mentioned that you have created the required UDEV file according to the debugging guide. Are these files configured correctly? Is it possible that there are issues with device permissions and access control, or that the system has not reloaded the UDEV rules?

A permissions problem will cause the debugger to fail to start completely (with an error like "libusb_open() failed with LIBUSB_ERROR_ACCESS"). That type of problem won't cause the debugger to only work partially as reported by @dtone1:

That was @seurat who said that, not me. He was using Ubuntu Linux, I am using Windows 11 and do not need the UDEV file.

I have unzipped the 2.2.1 file and tried to use the 2.2.1 IDE in debug mode. When I press the debug button I get the following:

A regular compile and upload on 2.2.1 works and the Serial.print inside loop() works.

The same debug compile and load on 2.3.3 does start the debugger and stop at a breakpoint, but Serial.print inside loop() does not work.

Back to IDE 2.3.3 and board 2.0.18-20240930 - the current latest versions.

I find that I can get Serial0 prints to work while using the debugger, but not regular Serial prints. I would love to know if there is a way around this.

I do see regular Serial prints inside Setup() but not inside Loop() - very weird.

In order to get the Serial0 prints I use a USB connector with a Prolific PL2303C chip inside it, made by Dtech and bought off Amazon.

Warning!!!! Do not connect the red +ve line as it puts out 5V, but you do need the black gnd connected. I have the green line in TX0 (embossed TX1 on my board???) and the white line in RX0. You need to have a USB connection into the Nano's USB-C connector for uploading and for powering the Nano, and another USB connection into the Dtech port.

This is my test code - just a slightly modified Blink:

// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(LED_BUILTIN, OUTPUT);

  Serial.begin(115200);
  delay(2000);
  Serial.println("Serial starting - 18 Nov 2024 #2");

  Serial0.begin(115200);
  delay(2000);
  Serial0.println("Serial0 starting - 18 Nov 2024 #2");
}

// the loop function runs over and over again forever
void loop() {
  static int i = 1;
  digitalWrite(LED_BUILTIN, HIGH);  // turn the LED on (HIGH is the voltage level)
  delay(1000);                      // wait for a second
  digitalWrite(LED_BUILTIN, LOW);   // turn the LED off by making the voltage LOW
  delay(1000);                      // wait for a second
  Serial.println("Serial: " + String(i));
  Serial0.println("Serial0: " + String(i));
  i = i+1;
}