Arduino Nano ESP32 just changed USB identifiers or i think it did!

Hi everyone,

I am using IDE 2.2.1 and running it from the terminal by doing ./executable_name

My board was working fine.

I do not remember doing anything nasty.

It was just connected with the usb cable. It was using /dev/ttyACM0 and i could upload the code to the board just fine.

A lot happened so i may not be accurate in my description.

I noticed that at some arbitrary point the board was not identified as Arduino Nano ESP32.

I am starting the IDE from a linux terminal and after the init messages the following keeps repeating itself:

2023-09-29T09:21:32.641Z daemon INFO time="2023-09-29T12:21:32+03:00" level=info msg="sending command" command=CLOSE monitor=serial-monitor
time="2023-09-29T12:21:32+03:00" level=info msg="from discovery builtin:serial-discovery received message type: remove, port: /dev/ttyACM0"
2023-09-29T09:21:32.641Z daemon INFO time="2023-09-29T12:21:32+03:00" level=info msg="received message" error=true event_type=port_closed message="readfrom tcp 127.0.0.1:58672->127.0.0.1:44599: Port has been closed" monitor=serial-monitor
time="2023-09-29T12:21:32+03:00" level=info msg="monitor port has been closed externally" monitor=serial-monitor
time="2023-09-29T12:21:32+03:00" level=info msg="received message" error=true event_type=close message="port already closed" monitor=serial-monitor
time="2023-09-29T12:21:32+03:00" level=info msg="sending command" command=QUIT monitor=serial-monitor
time="2023-09-29T12:21:32+03:00" level=info msg="received message" error=false event_type=quit message=OK monitor=serial-monitor
time="2023-09-29T12:21:32+03:00" level=info msg="Killing monitor process" monitor=serial-monitor
2023-09-29T09:21:32.642Z discovery-log INFO {"eventType":"remove","port":{"matchingBoardsList":[],"port":{"address":"/dev/ttyACM0","label":"","protocol":"serial","protocolLabel":"","propertiesMap":[],"hardwareId":""}},"error":""}
2023-09-29T09:21:32.642Z daemon INFO time="2023-09-29T12:21:32+03:00" level=error msg="stopped decode loop: EOF" monitor=serial-monitor
time="2023-09-29T12:21:32+03:00" level=info msg="Monitor process killed" monitor=serial-monitor
2023-09-29T09:21:32.642Z monitor-service INFO monitor to /dev/ttyACM0 using serial closed by server
2023-09-29T09:21:33.034Z daemon INFO time="2023-09-29T12:21:33+03:00" level=info msg="from discovery builtin:serial-discovery received message type: add, port: /dev/ttyACM0"
2023-09-29T09:21:33.035Z discovery-log INFO {"eventType":"add","port":{"matchingBoardsList":[{"name":"ESP32S3 Dev Module","fqbn":"esp32:esp32:esp32s3","isHidden":false}],"port":{"address":"/dev/ttyACM0","label":"/dev/ttyACM0","protocol":"serial","protocolLabel":"Serial Port (USB)","propertiesMap":[["pid","0x1001"],["serialNumber","34:85:18:7A:A5:9C"],["vid","0x303a"]],"hardwareId":"34:85:18:7A:A5:9C"}},"error":""}
2023-09-29T09:21:33.143Z monitor-service INFO starting monitor
2023-09-29T09:21:33.144Z daemon INFO time="2023-09-29T12:21:33+03:00" level=info msg="Required tool" tool="arduino:dfu-util@0.11.0-arduino5"
2023-09-29T09:21:33.144Z daemon INFO time="2023-09-29T12:21:33+03:00" level=info msg="Required tool" tool="esp32:esptool_py@4.5.1"
time="2023-09-29T12:21:33+03:00" level=info msg="Required tool" tool="esp32:mklittlefs@3.0.0-gnu12-dc7f933"
time="2023-09-29T12:21:33+03:00" level=info msg="Required tool" tool="esp32:mkspiffs@0.2.3"
time="2023-09-29T12:21:33+03:00" level=info msg="Required tool" tool="esp32:openocd-esp32@v0.11.0-esp32-20221026"
time="2023-09-29T12:21:33+03:00" level=info msg="Required tool" tool="esp32:xtensa-esp-elf-gdb@11.2_20220823"
time="2023-09-29T12:21:33+03:00" level=info msg="Required tool" tool="esp32:xtensa-esp32s3-elf-gcc@esp-2021r2-patch5-8.4.0"
time="2023-09-29T12:21:33+03:00" level=info msg="Starting monitor process" monitor=serial-monitor
2023-09-29T09:21:33.144Z daemon INFO time="2023-09-29T12:21:33+03:00" level=info msg="Monitor process started successfully!" monitor=serial-monitor
time="2023-09-29T12:21:33+03:00" level=info msg="sending command" command="HELLO 1 \"arduino-cli 0.34.0\"" monitor=serial-monitor
2023-09-29T09:21:33.145Z daemon INFO time="2023-09-29T12:21:33+03:00" level=info msg="received message" error=false event_type=hello message=OK monitor=serial-monitor
time="2023-09-29T12:21:33+03:00" level=info msg="sending command" command=DESCRIBE monitor=serial-monitor
2023-09-29T09:21:33.145Z daemon INFO time="2023-09-29T12:21:33+03:00" level=info msg="received message" error=false event_type=describe message=OK monitor=serial-monitor
time="2023-09-29T12:21:33+03:00" level=info msg="sending command" command=QUIT monitor=serial-monitor
2023-09-29T09:21:33.145Z daemon INFO time="2023-09-29T12:21:33+03:00" level=info msg="received message" error=false event_type=quit message=OK monitor=serial-monitor
time="2023-09-29T12:21:33+03:00" level=info msg="Killing monitor process" monitor=serial-monitor
2023-09-29T09:21:33.145Z daemon INFO time="2023-09-29T12:21:33+03:00" level=error msg="stopped decode loop: EOF" monitor=serial-monitor
time="2023-09-29T12:21:33+03:00" level=info msg="Monitor process killed" monitor=serial-monitor
2023-09-29T09:21:33.147Z daemon INFO time="2023-09-29T12:21:33+03:00" level=info msg="Required tool" tool="arduino:dfu-util@0.11.0-arduino5"
time="2023-09-29T12:21:33+03:00" level=info msg="Required tool" tool="esp32:esptool_py@4.5.1"
time="2023-09-29T12:21:33+03:00" level=info msg="Required tool" tool="esp32:mklittlefs@3.0.0-gnu12-dc7f933"
time="2023-09-29T12:21:33+03:00" level=info msg="Required tool" tool="esp32:mkspiffs@0.2.3"
time="2023-09-29T12:21:33+03:00" level=info msg="Required tool" tool="esp32:openocd-esp32@v0.11.0-esp32-20221026"
time="2023-09-29T12:21:33+03:00" level=info msg="Required tool" tool="esp32:xtensa-esp-elf-gdb@11.2_20220823"
time="2023-09-29T12:21:33+03:00" level=info msg="Required tool" tool="esp32:xtensa-esp32s3-elf-gcc@esp-2021r2-patch5-8.4.0"
2023-09-29T09:21:33.147Z daemon INFO time="2023-09-29T12:21:33+03:00" level=info msg="Starting monitor process" monitor=serial-monitor
2023-09-29T09:21:33.147Z daemon INFO time="2023-09-29T12:21:33+03:00" level=info msg="Monitor process started successfully!" monitor=serial-monitor
2023-09-29T09:21:33.147Z daemon INFO time="2023-09-29T12:21:33+03:00" level=info msg="sending command" command="HELLO 1 \"arduino-cli 0.34.0\"" monitor=serial-monitor
2023-09-29T09:21:33.148Z daemon INFO time="2023-09-29T12:21:33+03:00" level=info msg="received message" error=false event_type=hello message=OK monitor=serial-monitor
2023-09-29T09:21:33.148Z daemon INFO time="2023-09-29T12:21:33+03:00" level=info msg="sending command" command=DESCRIBE monitor=serial-monitor
time="2023-09-29T12:21:33+03:00" level=info msg="received message" error=false event_type=describe message=OK monitor=serial-monitor
time="2023-09-29T12:21:33+03:00" level=info msg="sending command" command="CONFIGURE bits 8" monitor=serial-monitor
time="2023-09-29T12:21:33+03:00" level=info msg="received message" error=false event_type=configure message=OK monitor=serial-monitor
2023-09-29T09:21:33.148Z daemon INFO time="2023-09-29T12:21:33+03:00" level=info msg="sending command" command="CONFIGURE dtr on" monitor=serial-monitor
time="2023-09-29T12:21:33+03:00" level=info msg="received message" error=false event_type=configure message=OK monitor=serial-monitor
time="2023-09-29T12:21:33+03:00" level=info msg="sending command" command="CONFIGURE parity none" monitor=serial-monitor
2023-09-29T09:21:33.148Z daemon INFO time="2023-09-29T12:21:33+03:00" level=info msg="received message" error=false event_type=configure message=OK monitor=serial-monitor
time="2023-09-29T12:21:33+03:00" level=info msg="sending command" command="CONFIGURE rts on" monitor=serial-monitor
time="2023-09-29T12:21:33+03:00" level=info msg="received message" error=false event_type=configure message=OK monitor=serial-monitor
time="2023-09-29T12:21:33+03:00" level=info msg="sending command" command="CONFIGURE stop_bits 1" monitor=serial-monitor
time="2023-09-29T12:21:33+03:00" level=info msg="received message" error=false event_type=configure message=OK monitor=serial-monitor
time="2023-09-29T12:21:33+03:00" level=info msg="sending command" command="CONFIGURE baudrate 9600" monitor=serial-monitor
2023-09-29T09:21:33.148Z daemon INFO time="2023-09-29T12:21:33+03:00" level=info msg="received message" error=false event_type=configure message=OK monitor=serial-monitor
time="2023-09-29T12:21:33+03:00" level=info msg="sending command" command="OPEN 127.0.0.1:40013 /dev/ttyACM0" monitor=serial-monitor
2023-09-29T09:21:33.149Z daemon INFO time="2023-09-29T12:21:33+03:00" level=info msg="received message" error=false event_type=open message=OK monitor=serial-monitor
2023-09-29T09:21:33.149Z daemon INFO time="2023-09-29T12:21:33+03:00" level=info msg="Port /dev/ttyACM0 successfully opened"
2023-09-29T09:21:33.149Z monitor-service INFO Using port configuration for serial:/dev/ttyACM0: {"settingsList":[{"settingId":"bits","value":"8"},{"settingId":"dtr","value":"on"},{"settingId":"parity","value":"none"},{"settingId":"rts","value":"on"},{"settingId":"stop_bits","value":"1"},{"settingId":"baudrate","value":"9600"}]}
2023-09-29T09:21:33.149Z monitor-service INFO started monitor to /dev/ttyACM0 using serial
2023-09-29T09:21:33.150Z monitor-service INFO No port configuration changes have been detected. No need to send configure commands to the running monitor serial:/dev/ttyACM0.

The board is constantly in bootloader mode since i can see the RGB led to be purple. If i follow the procedure of shorting B1 to the GND, then pressing/releasing the RST button and then unshorting B1 from the GND the RGB led stays purple (after being green while B1 is shorted) and i no longer see the messages above being repeated.

While in the bootloader mode (after doing the procedure with B1 & RTS) i can burn the bootloader using the menu Tools->Burn boot loader and i see the following:

Connecting...
Chip is ESP32-S3 (revision v0.1)
Features: WiFi, BLE
Crystal is 40MHz
MAC: 34:85:18:7a:a5:9c
Uploading stub...
Running stub...
Stub running...
Erasing flash (this may take a while)...
Chip erase completed successfully in 1.6s
Hard resetting via RTS pin...

After that (burning the boot loader) the board while having purple on the RGB led is again printing the messages i posted above every sec or so.

If i probe the board info using the menu Tools->Get board info i get a dialog saying:

BN: ESP32S3 Dev Module
VID: 0x303a
PID: 0x1001
SN: 34:85:18:7A:A5:9C

while another new board that i tried shows:

BN: Arduino Nano ESP32
VID: 0x2341
PID: 0x0070
SN: 3485187B4220 (yes w/o the semicolons)

I have no idea what happened.

I occasionally sense ESDs here at my desk while so this could be one culprit. Not sure.

Can anyone try to guess what could be wrong?

Thanks
Manos

Hello Manos,
thanks for the very informative post! All is working as expected, and it can be easily fixed - but I understand the surprise... :slight_smile:

Unfortunately the Arduino ESP32 core has always had a different handling of the "Burn bootloader" action - it actually only erases the whole Flash (as you reported in the post), leaving the board permanently in the same state as doing the trick with B1+GND.
To restore the standard Arduino Nano ESP32 programming, you should follow this guide instead - basically just set a "Programmer" in the Tools menu and then use Upload using Programmer to load any sketch.

Let me know if that works for you!

Thanks lburelli for the prompt response!

Programming the board is now impossible because the USB identifiers have changed as i indicated in my last post.

Doing a "lsusb" in my terminal now shows (i am attaching only the line that shows up after connecting the board via usb cable):

Bus 001 Device 072: ID 303a:1001 Razer Razer Basilisk Essential

Seeing the link you attached, i remembered being there half an hour ago but something seemed to work despite the fact that i am almost sure i followed that procedure step by step.

Fortunately following it again worked so a big thumbs up to you. Thank you so much!

The usb identifiers are back to normal!

My best regards.
Manos

Happy to have helped!

OT:

That commercial product name definitely shouldn't be there: 303a:1001 is Espressif's native bootloader USB ID. Somebody should free the ESP32 in that mouse! :rofl:

Hi there,

Sorry to be a pain in the butt.

Seems like the problem is back but in a new form.

After recovering, as per your suggestions, i was trying to debug the code i wrote.

The debug button was disabled and when i hovered over it with the mouse i got a hint saying "No board selected". That however seemed strange because the board was indeed selected. Not sure what to guess.

Following this guide i selected Tools->USB mode->Debug mode and hit "upload". The upload never completed and got stuck for some time. Finally it got unstuck by itself and gave me an error message - don't remember what it was.

Since then the board's USB identifiers are again different. I can now see in the drop down control in the IDE "Arduino Nano ESP32" and associated port /dev/ttyS0 which does not work. A new device called "ESP32S3 Dev Module is now in the drop down and associated port is /dev/ttyACM0 which does not work either.

The board is now in a different erroneous state. After power up / reset it is not stuck in bootloader mode but rather in a state that seemingly indicates that the on board code is executing.

Using the "Arduino Nano ESP32" & /dev/ttyS0 to upload the code results in compiling the code and then giving me error "dfu-util: No DFU capable USB device available
Failed uploading: uploading error: exit status 74".

Using the "Arduino Nano ESP32" & /dev/ttyACM0 to upload the code results in getting the error:
"Platform 'esp32:esp32' not found: platform not installed
Compilation error: Platform 'esp32:esp32' not found: platform not installed"

Again i apologize for the inconvenience and asking for help.

I would not expect using a menu function to render the board useless and that is really weird.

Regards
Manos

If you want to debug, it may be simpler to stick to the guide's "Method 1" (B1+GND) for as long as the debugging is enabled. This will confuse the IDE, so you always need to manually select the correct board.

Always follow these steps when uploading changes:

  • short B1+GND, click RESET button, remove B1+GND;
  • check that "Esptool" is selected in "Tools" -> "Programmer";
  • program via "Sketch" -> "Upload using Programmer" and not the Upload button;
  • click the RESET button (no B1+GND this time!).

Also,

Platform 'esp32:esp32' not found

When manually choosing the board, take care to select the Arduino Nano ESP32 (Arduino ESP32 Boards) option, not the one ending with (esp32). ttyACM0 is probably the right port.

Let me know if this helps!
Luca

Hi Luca,

Thanks for your response.

The difference between the upload button and the upload using programmer menu is now clear to me!

The board that i reported as being identified as "ESP32S3 Dev Module" is now back to normal by using the B1+GND (method 1).

Ok, with the board being "ok", i will start from scratch to give you a clear idea of the steps i take:

*I am using a linux box (linux mint 20.3 cinnamon). I have downloaded ver. 2.2.1 (precompiled) and running ./arduino-ide to start the ide. At this point the board is NOT connected to the USB port.

  1. I start the ide (by running ./arduino-ide in the related folder).

  2. I click on menu File->New sketch and a new IDE window opens up. I close the old one and keep the one with the new sketch. In the board selector drop down control i can only see "Arduino Nano ESP32" & port /dev/ttyS0. The debug button IS enabled. I save the sketch with a name "new01".

  3. I connect the board to the USB port. I almost instantly see the board selector drop down control showing 3 options: 1) The one i already mentioned above, 2) "Arduino Nano ESP32" & port /dev/ttyACM0 and 3) "Arduino Nano ESP32" 1-7. *The third option appeared after i added a udev rule for the board to function. After connecting the USB port, the board selector drop down control automatically shows in bold option 2. All Options work for uploading the code to the board. At this point i have not tried pressing the debug button yet.

*The menu Tools->Get board info returns:

BN: Arduino Nano ESP32
VID: 0x2341
PID: 0x0070
SN: 3485187AA59C (w/o semicolons)

  1. I follow the guide in the page "Debugging with the Nano ESP32". I select menu Tools->USB mode->Debug mode (Hardware CDC), menu Tools->Programmer->Esptool (was already selected), menu Sketch->Optimize for debugging.

5.0) Apply Method 1: Short B1 to GND & keep shorted & confirm the RGB goaes constant green, press & release the RST button and confirm that the RGB goes purle, remove the short between B1 & GND. Now,

5.1) I confirm that the board selector drop down control now shows 2 options: 1) "Arduino Nano ESP32" & port /dev/ttyS0, 2) "WiFiduinoV2" & port /dev/ttyACM0 and none of the two is in bold.

5.2) I manually select the board by using the "Select other board and port" from the board selector drop down control. Board selected: "Arduino Nano ESP32" & port /dev/ttyACM0 Serial Port (USB).

5.3) Upload the empty sketch to the board by selecting menu Sketch->Upload Using Programmer instead of the upload button!!! The upload process is completed successfully.

  1. I manually reset the board by pressing/releasing the RESET button on the board. Nothing changes in the board selector drop down control.

  2. I confirm that the Tools menu shows: "Board: Arduino Nano ESP32", "Port: /dev/ttyACM0". Selecting menu Tools->Get board info shows a dialog with the following:

BN: WiFiduinoV2
VID: 0x303a
PID: 0x1001
SN: 34:85:18:7A:A5:9C

  1. I confirm that at this point there is a file (new tab in the IDE) named: "debug_custom.json". I delete that from the file system. No changes are observed in the board selector drop down control.

  2. I press the debug button and i get an error:

gdb error

If not mistaken, this thread suggests the issue remains unresolved.

*They are right discussing the fact that ESP32-S3 is not ARM and also that a risk-V gdb exec is there.

I have only installed the Arduino DebugUtils (by Arduino) so far. There are a few debuggers in the library manager. Should i install any of them?

Regards
Manos

Again thanks for pointing everything out!
What you did was perfect... up to this step:

Whoops, that was part of the debug functionality and is pretty important as it sets the proper debugger: without that file, the error you (and the people in the old thread you found) have seen is expected.
The guide say to remove it if you want to debug using another board, and what we meant with this was "something that does not use an ESP32". :slight_smile: Sorry about this confusion, we will clarify this to avoid this mistake again!

PS. Not sure why the IDE mentions another Arduino on ttyS0 on your machine... :man_shrugging: it's probably due to a previous test where you tried that combination and now the IDE remembers it. You can safely ignore that!

Thanks,

Even so, i was not able to enable the debug button on my existing project. Not sure what is going on.
No matter what i do the debug button stays disabled giving me a hint "No board selected".
Any hint on that?

Thanks
Manos

Hi @paradigmshift. There is a bug in Arduino IDE 2.2.0 and 2.2.1 that can cause the behavior you describe:

I'll provide instructions you can follow for the workaround:

  1. Select Tools > Board > Arduino AVR Boards > Arduino Uno from the Arduino IDE menus.
  2. Select Tools > Board > Arduino ESP32 Boards > Arduino Nano ESP32 from the Arduino IDE menus.
    (or if you are using the full ESP32 boards platform instead of "Arduino ESP32 Boards", Tools > Board > esp32 > Arduino Nano ESP32)

After doing that, you should find that the debug button is enabled as expected.

Thank you ptillisch,

That did the trick. Every time i open-up the ide i have to select another board and then re-select the Nano ESP32.

Now, the debug button is enabled and seems to be starting the process but there is another error. The following is a copy/paste of the Output tab terminal. There is some Greek text as part of the path

Waiting for gdb server to start...[2023-10-05T06:29:27.765Z] SERVER CONSOLE DEBUG: onBackendConnect: gdb-server session connected. You can switch to "DEBUG CONSOLE" to see GDB interactions.
/home/manos/.arduino15/packages/esp32/tools/openocd-esp32/v0.11.0-esp32-20221026/bin/openocd -c "gdb_port 50000" -c "tcl_port 50001" -c "telnet_port 50002" -s /home/manos/Arduino/Shin -f /home/manos/Arduino/arduino_2.2.1/resources/app/plugins/cortex-debug/extension/support/openocd-helpers.tcl -f debug.cfg
Open On-Chip Debugger v0.11.0-esp32-20221026 (2022-10-26-14:47)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
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: libusb_open() failed with LIBUSB_ERROR_ACCESS
Error: esp_usb_jtag: could not find or open device!

[2023-10-05T06:29:27.779Z] SERVER CONSOLE DEBUG: onBackendConnect: gdb-server session closed
GDB server session ended. This terminal will be reused, waiting for next session to start...

Then i created the udev rules file as suggested in the link Debugging with the Nano ESP32

In order to make it work i had to reboot the pc. Running the command $ sudo udevadm control --reload was not able to make it work even after re-starting the IDE.

IT IS NOW WORKING.

Things i noticed:

  1. Switching between Normal & Debug modes requires setting the board in boot-loader mode (RGB: purple), then selecting menu Sketch->Upload using programmer, the resetting the board.

  2. The board is randomly recognized when in debug mode (after having done the B1-GND procedure).

  3. The board has to be explicitly selected for the debug to work - otherwise execution does not stop at breakpoints even if debug is seemingly working.

Thanks for your time and effort.

Best regards.

Manos

This just saved me, thank you so much!