Port doesn't exist, exit status 2

I'm using Arduino IDE 2.3.2 on Windows 11 machine.

I have 2 Seeed ESP32-C3 boards. I followed the directions on the getting started page for the board (Getting Started with Seeed Studio XIAO ESP32C3 | Seeed Studio Wiki) and had both boards working fine. I am making one board a BLE server, and the other a BLE client.

(Not sure if paragraph is relevant)
To save time plugging and unplugging boards, I tried plugging both in to my laptop at the same time. In the IDE I was disappointed to find I didn't get both com ports showing up under Tools > Ports. I was only able to see the first board I had plugged in. So I went back to plugging in one board at a time. (/Not sure if paragraph is relevant)

One of the boards consistently shows up as Port: Com 3
the other consistently shows up as Port: Com 5.
Every time I try uploading new code to the board that shows up on Port: COM3 I get an error saying the port doesn't exist
However, the board that shows up as Port: Com 5 I can upload new code to.

Here's the full error message I get when attempting to upload to the COM3 board:

Sketch uses 968826 bytes (73%) of program storage space. Maximum is 1310720 bytes.
Global variables use 34700 bytes (10%) of dynamic memory, leaving 292980 bytes for local variables. Maximum is 327680 bytes.
esptool.py v4.6
Serial port COM3

A fatal error occurred: Could not open COM3, the port doesn't exist
Failed uploading: uploading error: exit status 2

The board is plugged in to my machine.

When I open Device Manager I do see Ports (COM & LPT) > USB Serial Device (COM3)

If I open the Serial Monitor, I can see the messages the board is sending ("Waiting on a client connection to notify...")

The code I have compiles just fine. It's just uploading when I get "port doesn't exist" error.

I've tried restarting my computer several times, I've tried pressing both the Reset button on the ESP32-CW. Neither has worked.

I'm obviously not great at Arduino, so any advice anyone can give me would be very appreciated! I'm ready to pull my hair out!

Run Zadig.....

Okay, I'm running Zadig, and had it list all devices. What do I do next?
image

The other post on this topic said to reinstall the libusbK driver but I'm not sure how to do that.

Sorry, this is outside my wheelhouse.

Right now I only have my COM3 board plugged in, but when I run Zadig I see 2 items labeled "USB JTAG/serial debug unit"... I'm guessing those correspond to my 2 boards?

Why are both boards listed when only 1 board is plugged in right now?

For the USB JTAG... (Interface 0) device it says the driver is
"usbser (v10.0.22621.2506)"
and I can replace it with either

  • WinUSB (v6.1.7600.16385)
    *libusb-win32 (v1.2.7.3)
    *libusbK (v3.1.0.0) <---- This is what the other Zadig post mentions
  • USB Serial (CDC)

For the USB JTAG...(Interface 2) device the driver is
"WINUSB (v10.0.22621.2506)
and I get the same replacement options.

I see both devices have the same version number, but one is "usbser" and the other is "WINUSB." Is one of the drivers corrupted and not appropriately identified?
Is "libusbK" the correct replacement driver?
Is the Interface 0 device the driver to replace?

Normally I select whatever device I have and Zadig will recommend a driver for it.
I always take note of what driver was installed also , so I can revert back if it does not work.

Very strange that Zadig would list a device that is not plugged in though.
Perhaps clear all your browser history and run Ccleaner or similar and see what Zadig comes up with then.

Other than that I am out of suggestions.

Even stranger,
with the COM3 board plugged in, Zadig lists both
USB JTAG/serial debug unit (Interface 0)
and
USB JTAG/serial debug unit (Interface 2)

when I unplug the COM3 board, both of those devices disappear.

Then when I plug in the COM5 board (the one that worked), BOTH of those devices appear in Zadig again. The same driver is listed for each device that was listed with board COM3.
The one difference was the order in which the devices were listed. For the uploadable COM5 board, Interface 2 was listed first.

I tried uninstalling and reinstalling the Arduino IDE, but nothing changed.

Would uninstalling & reinstalling the Arduino Agent maybe correct the drivers? When I go to try that, there is no Uninstall.exe in the C:\Users\{username}\AppData\Roaming\ArduinoCreateAgent folder. Is there a different way to do it in Windows 11?

I cleared all my browser history and ran CCleaner. It said to update my USB Type - C Policy Controller. I did and it made no difference.

Another thing to file under "Things I Tried That Failed"...

With the COM3 board connected, I opened Zadig, selected USB JTAG/serial debug unit (Interface 0) and installed WinUSB (v6.1.7600.16385)
...And now the board doesn't show up at all in the Arduino IDE. In the Tools menu, "Port" is grayed out.

To make matters worse, now the COM5 board doesn't show up either!!!

Don't misunderstand me! I really appreciate your help bluejets! But I hope you'll excuse me while I go to go sit in a corner and rock back and forth crying in frustration for awhile.

Next, I followed Zadig's instructions for how to restore a driver (https://github.com/pbatard/libwdi/wiki/FAQ#Zadig)

I opened Device Manager, and under "Universal Serial Bus devices" there were 2 listed devices both labeled "USB JTAG/serial debug unit." I found the one where the driver provider was "libwdi" - meaning it was the driver I just replaced in Zadig. Then I right-clicked "Properties", clicked the "Driver" tab, and did "Uninstall Device."

Then I unplugged and replugged the COM3 board.

According to the Zadig FAQ page, the original driver should have been reinstalled. Instead, only the 1 "USB JTAG/serial debug unit" device remains in Device Manager. Also, the COM3 board became reassigned to COM7, but I still can't upload new code to it.

Meanwhile, when I plug in the COM5 board, both instances of "USB JTAG/serial debug unit" are present in Device Manager, but "Port" is still grayed out in the Tools menu of the Arduino IDE.

Bottom line: Now the 1 board that I could previously upload code to isn't recognized, and I still can't upload new code to the 2nd board.

I have 2 Seeed Xiao ESP32-C3 boards and one of them started giving me a "port does not exist error" when I tried uploading anything to it. I've been trying to fix this problem for the last 5 hours, and only made it worse.

Question 1: These ESP32-C3 boards plug in using USB-C. When I plug in Board A, two devices appear in Device Manager > Universal Serial Bus devices. The devices are labaled "USB JTAG/serial debug unit" Instance 0 and Instance 2. Should this be happening? When I plug in an Arduino Uno using USB Type-B, only 1 device appears in Device Manager. Why do 2 devices appear for the Type-C ESP32-C3s?

Question 2: Using Zadig, I can tell that the driver for Instance 0 is "usbser (v10.0.2261.2506)". In an attempt to solve my original "port does not exist error," I plugged in Board B and deleted its Instance 0 from Device Manager. Result: the Arduino IDE can't even see Board B when it's plugged in.
Assuming I do need both devices listed in Device Manager, how do I make device Instance 0 reappear for Board B?

I have merged your cross-posts @bfree42.

Cross-posting is against the Arduino forum rules. The reason is that duplicate posts can waste the time of the people trying to help. Someone might spend a lot of time investigating and writing a detailed answer on one topic, without knowing that someone else already did the same in the other topic.

Repeated cross-posting can result in a suspension from the forum.

In the future, please only create one topic for each distinct subject matter. This is basic forum etiquette, as explained in the "How to get the best out of this forum" guide. It contains a lot of other useful information. Please read it.

Thanks in advance for your cooperation.

Hi @bfree42.

A single USB device can produce multiple interfaces. For example, a device might have one interface for the virtual serial port and another for HID. So these are two interfaces of the single board and it is expected that you will see two of them.

I'm not familiar with a procedure in Device Manager that could be described as "deleted its instance".

I see the options to "Uninstall Device" and "Disable Device". When you say you "deleted its instance", do you mean that you did one of those things? If so, which one did you do?

Although it seems the situation has since snowballed into other problems on top of this original issue, I thought I should add a note about one possible cause of this "the port doesn't exist" error.

As would be expected by the wording of the message, one of the causes of this error is attempting to upload to a port that doesn't exist (as would happen, for example, if you selected the port of a board, unplugged it from your computer, then attempted an upload).

Unintuitively, this error also occurs if you attempt to upload to the board while some other process already has the port open. When working with other microcontrollers/uploader tools, we get a more intuitive error message like "access is denied" when the upload fails under these conditions.

Arduino IDE is smart enough to automatically close the port connection by its integrated Serial Monitor and Serial Plotter tools before starting an upload to avoid that connection from interfering with the upload. So we would not expect that having either of those tools open during an upload would cause this upload failure, but if we are lacking any other potential causes, it would be worthwhile to make sure Serial Monitor and Serial Plotter are closed before attempting an upload.

You can close Serial Monitor by clicking the X icon on the "Serial Monitor" tab in the bottom panel of the Arduino IDE window to close the tab:

Here's a follow up just in case somebody has a similar problem and finds this thread:

To get Board B working again (the one that had 2 "serial debug units")...
Go to Device Manager > Universal Serial Bus devices> then right click on each instance of "USB JTAG/serial debug unit" and click on "Uninstall device." Then unplug the board and plug it back in again. That's it. Then it worked.

To fix the original problem of "port doesn't exist"...
Unplug the board, then press and hold the "B" button on the ESP32-C3 board while plugging it back in. That got it working again so I could upload programs.

Thank you again to everyone who tried to help me!!!

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.