STILL OPEN: Uploading fails, COM Port issue

Behavior is not limited to a particular board or board family, and several USB cables have been tested. I recall experiencing similar issues with legacy IDE, but I have not found a solution yet.

I am using Windows 11 with IDE version 2.1.1, and currently working with the NANO 33 IoT. I have ensured that drivers are up to date.

When I connect the USB cable, the device manager displays "Arduino NANO 33 IoT bootloader (COM3)". As expected, IDE automatically selects COM3.

However, when I try to upload, I receive the following error message: "No device found on COM3. Failed uploading: uploading error: exit status 1."

Sometimes, I am able to resolve this issue by resetting the board with 2 clicks. This allows the uploading process to complete, but an additional board named "Arduino 33 IoT (COM4)" appears in the device manager.

Deleting the COM4 entry in the device manager (uninstalling the device) or other unused entries under Universal Serial Bus Controllers (visible when activating the "Show Hidden Devices" option under the View menu) does not help.

Resetting the PC temporarily resolves the issue, and a few uploads may work without any problems. However, after a while, the problem reoccurs.

I'm not familiar with the Nano33 IoT. But to my knowledge that should not happen. The board should identify itself as Nano33 IoT (COM4 ). Only after a reset (double tap or software reset by the IDE), it should change to Arduino NANO 33 IoT bootloader (COM3).

Each of these modes (normal and bootloader) has it's own VID/PID and that is how Windows knows which driver to use.

Either there is a problem on the board that it sends the incorrect VID/PID to your PC or the association on the PC is incorrect. I would uninstall the drivers for both COM3 and COM4.

Questions:

  1. If you manage to upload, upload the blink sketch. Does the problem persist?
  2. You mention that it does not depend on board / board family. Do all those boards have native USB (e.g. Leonardo, Micro) or have you also experienced upload issues with e.g. Uno, Mega or Nano (that don't have native USB; if you have those boards).

Thanks for taking the time to help me here.

I have uninstalled both COM3 and COM4 multiple times now. However, I'm unsure if the uninstallation process removes the actual device driver because I haven't been restarting my PC each time. Whenever I do restart, uploading sketches only works temporarily before encountering issues.

Whether I try uploading the "blink" sketch, an empty sketch, or a full sketch, it doesn't make a difference. The problem persists.

Without making any changes to the setup (NANO 33 IoT on COM3), I connected an Arduino UNO, which got installed on COM4. In the IDE I selected the UNO and received the following error:

"avrdude: ser_open(): can't open device "\\.\COM4": Access is denied.
Failed uploading: uploading error: exit status 1"

After disconnecting both boards and uninstalling the devices, I reconnected the UNO to COM3 and still encountered the same error.

Next, I disconnected a printer that was connected to my PC and also uses a USB type B cable. I connected the printer cable to the UNO, so it is a new cable and a different physical port on my PC. The UNO was assigned COM3, but I encountered the same error when attempting to upload.

I also attempted to manually select a higher port number on Device Manager, but the results remained the same.

Upon checking the device manager, looks like both the UNO and the NANO uses the same driver at C:\WINDOWS\system32\DRIVERS\usbser.sys.

Hi @ninora

The "Access is denied" error happens when the port is open in another application. Only one application can have a serial port open at a time so Arduino IDE can't perform an upload under these conditions.

Check to see whether you have any applications running on your computer that might use the port. If they are, close them and then try the upload again.

If that doesn't help, try restarting your computer. In rare occasions, a glitch causes the port to get stuck open. This is one possible cause of the "Access is denied" error. Restarting your computer restores the port to the normal working state and so fixes that particular cause of the error.

To clarify, I am using the NANO where the error message displayed is "No device found."

When I tested the UNO for comparison it showed "Access is denied."

No other application is accessing COM ports.

While rebooting the PC does help, it is not a valid solution. It would be nice if it were possible to reset the specific port itself.

I understand. That one is more mysterious to me.

My previous reply was specifically about the "Access is denied." error since I am more familiar with the common causes of that error.

What do you mean by "help"? Does the "Access is denied." error still occur when uploading to the UNO after you reboot your PC?

After rebooting the PC, everything works fine on all boards. However, the issues resurface after a certain period of time, ranging from minutes to hours or even days.

In addition to rebooting, other actions such as disconnecting and uninstalling devices in the Device Manager or entering bootloader mode have temporarily resolved the problems. However, after a while, the issues resurface again and the cycle repeats.

There is a known bug in Arduino IDE 2.x that can cause uploads to fail with this "Access is denied" error when you attempt an upload while Serial Monitor or Serial Plotter is open. A port can only be used by one process at a time, so Arduino IDE automatically closes the port in Serial Monitor and Serial Plotter during an upload, automatically opening it again after.

For some reason, that juggling of the port control is not working under certain conditions. So far, we have considered the required condition to be that the board uses an FTDI FT232R USB chip. The official Arduino UNO board and faithful clones use an ATmega16U2 chip instead and the cheap derivative boards generally use the WCH CH340 chip. For this reason, I do not have a strong suspicion that the "Access is denied" error you are getting when uploading to the Uno is caused by this bug. However, I do remember one report of a user experiencing the fault with a board that had a different USB chip so it is possible that the bug is the cause of the error you are getting after all.

If that bug is the cause of the problem you are having, the workaround will be to manually close the port in Serial Monitor/Serial Plotter before doing an upload. Please give that a try and then let me know if you still have the error while uploading:

Serial Monitor

  1. Click the X icon on the "Serial Monitor" tab in the bottom panel of the Arduino IDE window to close the tab:
  2. Upload the sketch.
  3. Open Serial Monitor again if needed (by clicking the icon on the IDE toolbar or the Tools > Serial Monitor menu item) after the upload is finished.

Serial Plotter

If you have the "Serial Plotter" window open, the procedure is a bit different from closing the Serial Monitor connection:

  1. Close the "Serial Plotter" window.
  2. If the "Serial Monitor" view is not already open, select Tools > Serial Monitor from the Arduino IDE menus to open it.
    ⓘ We must do an open/close cycle on Serial Monitor as a workaround for a bug in Serial Plotter
  3. Click the X icon on the "Serial Monitor" tab in the bottom panel of the Arduino IDE window to close the tab:
  4. Upload the sketch.
  5. Open Serial Monitor and/or Serial Plotter again if needed after the upload is finished.

Please let me know if you have any questions or problems while following those instructions.

Just ignore the UNO and Access Denied type of problem, my issue is with NANO 33 IOT causing "No device found on COM3. Failed uploading: uploading error: exit status 1."

Can anyone from IDE team reply to this ?

Can you share the VID and PID of the Nano33 IoT, both for bootloader and normal. Somebody with that board might be able to verify if they are correct.

Sure, here it is:

Arduino NANO 33 IOT

VID_2341
PID_8057

Arduino 1010 MKR

VID_2341
PID_0054

Thanks!

Sorry, I asked for the Nano 33 IoT, both normal and bootloader.

You can also provide both for the MKR 1010. Any other problematic boards?

I only have AVR based boards so might not be able to help much further.

Sorry about that, here's the complete info:

All VID's are 2341.

SAMD boards are showing two PID lines in normal mode and one line in Bootloader mode:

Nano 33 IOT

Normal:
PID_8057
PID_8057&MI_00

Bootloader:
PID_0057

MKR 1010

Normal:
PID_8054
PID_8054&MI_00

Bootloader:
PID_0054

UNO

PID_0043

I'm going to ask you to post the full verbose output from a failed upload to the board.


:exclamation: NOTE: These instructions will not solve the problem. They are only intended to gather more information about the problem.


Please do this:

  1. Select File > New Sketch from the Arduino IDE menus.
  2. Press and release the "RST" button on the board twice quickly.
    ⓘ The reason for this step is we want to make an initial successful upload and you reported that you can only get a successful upload after doing a double reset.
  3. Select the appropriate board and port from the Arduino IDE menus.
  4. Select Sketch > Upload from the Arduino IDE menus.
  5. Wait for the upload to finish successfully.
    If the upload fails, repeat the process until you get a successful upload.
    ⓘ The goal of this upload is to have a known sketch program running on the board so we can eliminate the sketch program as a variable in the upload failure.
  6. Select File > Preferences... from the Arduino IDE menus.
    The "Preferences" dialog will open.
  7. Uncheck the box next to Show verbose output during: ☑ compilation in the "Preferences" dialog.
  8. Check the box next to Show verbose output during: ☐ upload.
  9. Click the OK button.
  10. Attempt an upload, as you did before.
    :exclamation: For this upload, do not do the double reset.
  11. Wait for the upload to fail.
  12. You will see a "Upload error: ..." notification at the bottom right corner of the Arduino IDE window. Click the COPY ERROR MESSAGES button on that notification.
  13. Open a forum reply here by clicking the Reply button.
  14. Click the <CODE/> icon on the post composer toolbar.
    This will add the forum's code block markup (```) to your reply to make sure the error messages are correctly formatted.
    Code tags icon on toolbar
  15. Press Ctrl+V.
    This will paste the error output from the upload into the code block.
  16. Move the cursor outside of the code tags before you add any additional text to your reply.
  17. Click the Reply button to post the output.

As per your instructions, thanks!

Sketch uses 12244 bytes (4%) of program storage space. Maximum is 262144 bytes.
Global variables use 2996 bytes (9%) of dynamic memory, leaving 29772 bytes for local variables. Maximum is 32768 bytes.
Performing 1200-bps touch reset on serial port COM6
Waiting for upload port...
No upload port found, using COM6 as fallback
No device found on COM6
"C:\Users\Admin\AppData\Local\Arduino15\packages\arduino\tools\bossac\1.7.0-arduino3/bossac.exe" -i -d --port=COM6 -U true -i -e -w -v "C:\Users\Admin\AppData\Local\Temp\arduino\sketches\4795B7773B0FBB907DD76603A3AC2ED8/sketch_jul5a.ino.bin" -R
Failed uploading: uploading error: exit status 1

It seems like the issue has been resolved. In short, I updated the BIOS, and for anyone interested, I'll provide more details below. Thanks to everyone for your help; it is truly appreciated.

Like others, I was also focused on the Arduino side of things, such as the IDE and boards. This was mostly because connecting the boards always worked as expected, in both normal and bootloader modes, across various models.

However, I was bothered by the fact that Windows kept generating devices and installing multiple copies of the drivers for newly generated COM Ports. So, I started investigating the events and came across the following warning:

Device settings for USB\VID_2341&PID_0057\5&1382c907&0&1 were not migrated from the previous OS installation due to a partial or ambiguous device match.

A quick search led me to an article discussing this exact issue. I started following the steps mentioned in the article, some of which I had already tried before and others that didn't make any difference.

Until I reached the point where they suggested a BIOS upgrade. It made sense, but I wasn't happy about doing it when the service app notified me that my DELL warranty had expired last March.

As you already know, upgrading the BIOS fixed the issue.

I'm glad it is working now. Thanks for taking the time to post an update with your findings!

Regards,
Per

Well, it was too early to celebrate.

Everything was working perfectly fine. There were no error messages in the event log, and each upload went smoothly without any issues. However, things took a turn later in the day.

After rebooting, I logged what I was loading on the PC. I started with Device Manager, then Arduino IDE, Bing, and Chrome. That was it. I left the PC running after a successful upload. However, when I returned three hours later, it didn't even recognize the NANO.