Arduino Forum

Products => Arduino Zero => Topic started by: MikD on Apr 29, 2019, 07:35 pm

Title: Same COM port many times
Post by: MikD on Apr 29, 2019, 07:35 pm
IDE 1.8.9
Win 10 Pro US

Recently I am having issues with the Arduino IDE resulting in seeing the very same COM port number often twice and to a lesser degree up to four times. This despite the Device Manager only having one Arduino Zero COM port listed.

When it happens the uploading fails to finish but sometimes the code is still uploaded. Sometimes I have to unplug and restart the PC before I can proceed. I have tried to reburn the bootloader but in vain.

Double clicking the reset button doesn't help either - as it does when the upload COM port isn't found. But probably this is no surprise because the COM port is seen multiple times.

Why is this?

What can I do to stop this from happening?

It might be that this is something related to 1.8.9 because I can't remember if it has happened before.

Title: Re: Same COM port many times
Post by: pert on May 04, 2019, 09:33 am
I don't know why this happens, but I have the same problem with my MKR boards and the issue has been reported a few other times here:

I associate the problem with having the Serial Monitor open when I upload to the board. However, I just did a bunch of uploads using Arduino IDE 1.8.9 while the Serial Monitor was open and the board printing to it and now I can't reproduce the problem. If I could find a set of steps I could follow to reliably reproduce the issue, I could open a bug report with the Arduino developers. I don't really like to do that when I can't provide such a set of steps because it's extremely difficult to investigate and fix a problem if you can't reproduce it. If you manage to find a way to reliably cause this issue, please let me know, or open a bug report.

I've found the workaround for the problem is to close all Arduino IDE windows, unplug the board, then restart the Arduino IDE and plug it in again. That's much less of a hassle than restarting my computer (which is what I was previously using as a workaround).

There is a report of duplicate ports here: (
but that's about network ports, so I don't think it's relevant. However, the pluggable discovery system was introduced in Arduino IDE 1.8.9 so if the problem does not occur in IDE versions prior to 1.8.9, it is possible that some change made with the pluggable discovery system is the culprit.
Title: Re: Same COM port many times
Post by: pert on May 05, 2019, 06:20 am
I managed to find a way to reliably reproduce this issue. The way to do it is to unplug the board while Serial Monitor is open. That does it every time.

I plug my Arduino boards into a USB hub that's seen better days, so it's possible that I sometimes get a momentary loss of USB connectivity if I jiggle the cable or bang my work bench, which could have been causing the same thing to be happening even when I didn't intentionally unplug the cable.

I found that the duplicate Tools > Port menu entries issue didn't occur when using the beta build of the Arduino IDE, but that the spurious upload error still did occur with that IDE version. The issue does not occur with Arduino IDE 1.8.8.

I opened a bug report in the Arduino IDE repository about this: (
Title: Re: Same COM port many times
Post by: MikD on May 05, 2019, 08:25 am
Hi pert and the forum

Thanks for getting back to me.

Here is another way to replicate problem:

Open Serial Monitor
Press reset
Close Serial Monitor
Open Serial Monitor

Then one more COM port entry with the same number is visible.

I hope this and your description can help the IDE developers.

Title: Re: Same COM port many times
Post by: pert on May 05, 2019, 08:49 am
Nice one! That's better than my approach.
Title: Re: Same COM port many times
Post by: MikD on May 06, 2019, 04:20 pm
I don't know but can this help in any way in making the Arduino IDE/Zero USB communication and allocation more robust:
Title: Re: Same COM port many times
Post by: chrisrenson on Jul 14, 2019, 09:14 pm
I am experiencing the duplicate COM  port described above. It happens every time I try to run my sketch, which makes the whole setup virtually unusable. I am new to Arduino, so I don't know how long I should expect to wait for this bug to get fixed. Can anyone tells me what to expect?

Not surprisingly, the Serial.available() test fails in this case, so I can't execute a to get input.

Also, can someone tell me more about the suggestion to use Arduino IDE/Zero USB. What do I need to try? Very frustrated by being dead in the water.
Title: Re: Same COM port many times
Post by: pert on Jul 14, 2019, 10:36 pm
Hi chrisrenson. One of the Arduino developers already made a fix for the issue. It has not yet been released in a production version of the Arduino IDE, but a beta tester version is available here: (

Note that I describe two issues here:

Although these issues are both caused by the same event, the test build I linked above only fixes the second issue. The first issue is merely cosmetic and is fixed in the Arduino IDE beta build. So both issues have been fixed, but separately, and there is currently no one version of the IDE that contains both fixes.

Note that the upload error message is false. The upload actually does finish successfully. So you could continue to use the regular Arduino IDE and just ignore the spurious upload errors. If you do that, make sure to turn on File > Preferences > Show verbose output during: upload so that you can see from the contents of the black console window after the upload whether the upload error was spurious or legitimate.