Hi, I'm using Arduino Mega2560 R3 for some days ago and I detected a problem when use the Serial Monitor.
Each time that I compile a program with serial instructions... Serial.begin(9600) and Serialprintln(STATUS) for example... when I try download the program in Arduino, the first time it works well but if I download a second time, Arduino IDE (2.00rc9.1) show this message:
Failed uploading: uploading error: exit status 1avrdude: ser_open(): can't open device "\.\COM6": Access denied.
After check all parameters, check windows (Win11) com ports, restart the computer.... but nothing, the port is blocked.
You are welcome. I'm glad if I was able to be of assistance.
By the way, since the time I wrote my previous reply, Arduino IDE 2.0.0-rc9.2 was released. This version has the upload bug fixed, so you can use that version if you like.
The nightly builds are useful for those who want to contribute to the development of the IDE by doing beta testing and then reporting any bugs they find. If you are interested in doing that, by all means feel free to continue using the latest nightly builds.
Hello @ptillisch, I'd like ask you again for some problems with COM port.
I have instaled Arduino IDE 2.0.0-rc9.2 and some time works well and others not.
My problem is when I download a program with Serial.begin(9600), when the Arduinos restart, if USB is connected, It didn't work the first time... I need to unplug the USB, to do a power off in Arduino, wait 5 secons, to do power on, connect the USB and to do a reset in Arduino board again, if not to do this, I can't read serial data.
If I download a program without "Serial data", works well or If a power on the Arduino and USB is unplug, works well.
Time line
00:00 to 0:30 - Compile and download, but the Serial Monitor it doesnt work, only appear squares...
00:30 to 01:33 - I need to do a reset, unplug USB, unplug power,to plug power, to plug USB again, and to do reset 2 times.
01:34 to 01:53 - Serial monitor works well
01:54 to 02:20 - Compile and download again, but Serial Monitor it doesn't work
02:21 to 02:44 - I need to do a reset again for restart Serial data.
02:45 to ens - Same to previos step.
Here you have other video with same problem...
[Dropbox - Ard_2.mp4 - Simplify your life]
Compile and download and nothing.
Reset 2 times the Arduino and nothing
BUT, in timeline 01:38, I unplug USB, restart Arduino and works well, I connect again the USB and system down. I need to restart again.
The problem always is the USB, if it's connected, serial monitor fail, but if it's unplug, works well.
I hope that these videos can help you to understand better the problem.