I continually get an error when trying to upload with the new IDE. There are no compile issues and the code uploads fine with the old IDE. Occasionally, the 2.0 will upload. This typically happens after closing and reopening the app and using the tools menu to select the port and board instead of the automatic drop down menu. Currently, the port options list old ports that are now not connected. Plugging in to a new port does not updated the port list.
Below are 2 different error messages that I get. The first is basic and appears when the IDE cannot see the correct ports. The second is the typical message I get when uploading. The code is not relevant for this issue. I'm sorry for any formatting issues, this is my first post, please point them out so I can correct it for the future. Thank you for the help.
Failed uploading: uploading error: exit status 1
avrdude: Version 6.3-2019
Hi @cpondy. Thanks for giving the Arduino IDE 2.0.0 release candidate a try, and for your report. Thanks also to @scberthe for your valuable advice.
There is a bug in Arduino IDE 2.0.0-rc9.1 that causes uploads to fail when Serial Monitor is open:
This bug has already been fixed and will be available in tonight's nightly build of the Arduino IDE 2.x. Until then, please make sure to close Serial Monitor before uploading as a workaround for the bug:
Hi @wezz19. Thanks for your report. The fix is already in the latest nightly, so uploads failing are unexpected.
Please provide me with instructions I can follow to reproduce the issue. Include the names of whichever boards you are using since it is possible it could be specific to certain boards.
Strangely the IDE works without issues today. Only tested for 5 mins though.
Yesterday it didn't want to detect the COM port so the usual unplug/ reconnect worked but uploads failed every single time and worked most of times if I pressed the upload button again.
I also restarted the computer a few times but still the same issues. Plus one time when I started the IDE there was a warning that the language server wasn't running. That was fixed by restarting the IDE.
Since I can't reproduce it today it could have been something with the computer maybe. I will do more testing maybe tomorrow if I have time. This happened with a crowduino nano. But if it happens again I will test with an official Micro and Uno also just to make sure it's not something with this board. (Win10 21H2 fully updated)
Did some testing today (with the same computer and nightly build) and after about one hour, and about 10 uploads maybe, the uploads started failing for the nano. They failed about 30-50% of times when I pressed upload. Like before, another press on upload was successful, except for the first time it failed. That time the upload only worked on the third try.
Then I switched to an official Uno, which didn't get the same COM port though. Uploaded over 5 times but it never failed. Then I switched back to the nano and uploaded over 5 times but everything worked.
I wonder if something is reset when switching boards. So maybe I need to test with the Uno for over an hour.
The next time you encounter the issue, please post the full upload output here. It might contain some useful information about the problem.
I normally request the verbose upload output in this case, but unfortunately there is currently a bug that can sometimes make the verbose output even less informative than the non-verbose, so if possible please provide the output from a failed upload with and without the Show verbose output during: ☐ upload preference enabled.
I'll provide instructions for doing so:
Select File > Preferences from the Arduino IDE menus.
Uncheck the checkbox next to Show verbose output during: ☑ compilation
Check the checkbox next to Show verbose output during: ☐ upload.
Click the OK button.
Attempt an upload, as you did before.
After the upload fails, right click on the black "Output" pane at the bottom of the Arduino IDE 2.x window.
From the context menu, click Copy All.
This copies the full output to the clipboard.
Open a forum reply here by clicking the Reply button.
Click the </> 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.
Press Ctrl+V.
This will paste the error output from the upload into the code block.
Move the cursor outside of the code tags before you add any additional text to your reply.
Click the Reply button to post the output.
There is another report of uploads failing when using the Arduino IDE 2.x nightly build here:
Up until quite recently I always thought verbose meant something written in capital letters .
Yeah I saw that bug report but it mentioned that the port was not found. In my case it is but access is denied for some reason.
I have been doing some testing for a few hours with the official Uno with rc9.2, but no issues at all. And I tested on both my computers. Haven't been working on the same sketch thought, since the nano is soldered to a custom made circuit board but I had a spare RTC board of the same model used, and I can disconnect the display so I should be able to test that sketch using the Uno next week.
Could the I2C bus disturb the serial traffic in some way if the display and nano draws too much from the usb port? While in use, everything is powered by it's own 12V power supply but I never have that connected when I do updates to the code.
EDIT: According to my Keweisi usb meter everything just draws about 20mA, so that can't be the issue at least.
Until I can reproduce this reliably in rc9.2 it's no use to put much thought into this but I wanted to give you a small update.
As with you, they were not able to reproduce it after the report. This makes it difficult to do any investigation, but at least I am keeping an eye out for reports and for any occurrences of it on my system. I notified the members of the IDE development team and requested they do the same.
I'm not really knowledgeable about PC hardware at that level. The only related reports I have seen is when the protection circuitry on the USB port shuts it off completely. But that has a very distinctive symptom that doesn't match your experience at all.
I have had infrequent problems throughout my decade of Arduino use where the port gets stuck open for no discernable reason and it only becomes functional again after restarting the computer (not even a restart of the IDE restores it). The symptoms of that match well with yours in that the port remains visible, but the IDE can't access it to upload or open the Serial Monitor while the port is in that "stuck open" state.
I have never correlated that problem with a specific activity in the IDE or version of the IDE. It happens to me once every few months at most and is not reproducible so I never investigated it.
I got the access is denied again a few times with the IDE 2.0.0. Happened after about 3h of use and over 10 uploads.
I'm currently using the same crowduino nano but since it seems to be happening again I should test with the official Uno or Micro I have.
Sketch uses 18696 bytes (60%) of program storage space. Maximum is 30720 bytes.
Global variables use 1189 bytes (58%) of dynamic memory, leaving 859 bytes for local variables. Maximum is 2048 bytes.
"C:\Users\wezz\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude" "-CC:\Users\wezz\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf" -v -V -patmega328p -carduino "-PCOM3" -b115200 -D "-Uflash:w:C:\Users\wezz\AppData\Local\Temp\arduino-sketch-5224C303249A5733932B25BF87E417D0/WakeupLight_LCD.ino.hex:i"
avrdude: Version 6.3-20190619
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "C:\Users\wezz\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf"
Using Port : COM3
Using Programmer : arduino
Overriding Baud Rate : 115200
avrdude: ser_open(): can't open device "\\.\COM3": Access is denied.
avrdude done. Thank you.
Failed uploading: uploading error: exit status 1
When the serial monitor is open, I upload the program and get this error message. This error does not occur in IDE V1.8.19. Having to manually close the serial monitor is a pain.
Sketch uses 3704 bytes (11%) of program storage space. Maximum is 32256 bytes.
Global variables use 210 bytes (10%) of dynamic memory, leaving 1838 bytes for local variables. Maximum is 2048 bytes.
avrdude: ser_open(): can't open device "\\.\COM6": Access is denied.
Failed uploading: uploading error: exit status 1
Are you still experiencing the problem of uploads failing with an "Access is denied" error when Serial Monitor is open?
There is a formal bug report that looks similar to your original problem (getting "access denied" error when uploading using Arduino IDE 2.x):
I did some experimentation and found I am able to reproduce the fault under certain specific conditions.
If you are still experiencing this problem, please tell me which USB chip your Uno board has. The chip is usually located on the bottom of the board on the end nearest the USB socket.
If it isn't clear, alternatively you can provide the link to where you bought the board from and we'll see if we can determine the chip from the product listing.