Cannot upload when Serial Monitor is open

IDE v2 RC5
Windows 10 / 64 Pro

I'm using an FDTI board to program my Pro mini. After many times uploading code I found the IDE would not upload when the serial monitor was "open" (i.e. in a tab next to the output tab).

If I shutdown the IDE and restart it now will upload code with the serial monitor "open". This is what I consider "normal" behavior.

I realize I've not given enough detail to troubleshoot but I figured mentioning it might be seen by others who have experienced this.


Sketch uses 11420 bytes (37%) of program storage space. Maximum is 30720 bytes.
Global variables use 622 bytes (30%) of dynamic memory, leaving 1426 bytes for local variables. Maximum is 2048 bytes.


Compilation complete.
avrdude: ser_open(): can't open device "\.\COM5": Access is denied.

Upload error: Failed uploading: uploading error: exit status 1

Hi @JohnRob. There are a couple of known bugs that would cause this to happen if you had Serial Monitor open in a previous IDE window:

The only upload problem I'm aware of that would occur if you only ever had Serial Monitor open in a single IDE window during the session is timing specific:

If you are able to determine that the problem you had is not one of these known bugs, please let us know here on the forum or via an issue report on GitHub if you prefer.

1 Like

I believe I experienced " Upload fails in subsequent windows with Serial Monitor open"

Thank you.

can you tell me the difference between File/Quit and File/close editor ?
It seems the File/close editor does nothing. I ask because I tried the close editor sometime during the session with the serial monitor (above) problem.

Thanks for checking.

I was also puzzled by this unfamiliar "File" menu item. It turns out that "Editor" is referring to what we normally call a "tab" in the Arduino world.

This menu item will often have no effect because the primary source files of the sketch are always open. However, it is possible to open other editors. For example, if you right click on some code from a library in your sketch and then select "Go to Definition" from the context menu, the file containing the definition will open in a tab. Since this file is not part of the sketch project, its tab (or "editor") is closable and so you will find that selecting File > Close Editor from the Arduino IDE menus does close that tab.

But you can also close the tab via the more intuitive and convenient "X" icon on the tab, so I have proposed that this menu item be removed:

Thanks for the reply.

Would it also be possible to "close" a sketch but have arduino IDE open?

Now to change projects I have to OPEN the 'new' one then close what was the current project.

My intuition is to close the old one then open another.

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