Arduino Uno stuck on Uploading

Sketch uses 3086 bytes (9%) of program storage space. Maximum is 32256 bytes.
Global variables use 256 bytes (12%) of dynamic memory, leaving 1792 bytes for local variables. Maximum is 2048 bytes.
"C:\Users\Sundaram\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude" "-CC:\Users\Sundaram\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\Sundaram\AppData\Local\Temp\arduino-sketch-F3D38294A44C0B038195622C536BDC2C/Test.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\Sundaram\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

I got this error message. Please help me fix it.

The connection are right.
The board turns on when connected.
The ports are selected correctly.

This is the code I had typed:

#define RechoPin 9 
#define RtrigPin 8

long duration; 
int distance; 

void setup() {
  pinMode(RtrigPin, OUTPUT); 
  pinMode(RechoPin, INPUT); 
  Serial.begin(9600); 
  Serial.println("Ultrasonic Sensor HC-SR04 Test"); 
  Serial.println("with Arduino UNO R3");
}

void loop() {
 
  digitalWrite(RtrigPin, LOW);
  delayMicroseconds(2);
  
  digitalWrite(RtrigPin, HIGH);
  delayMicroseconds(10);
  digitalWrite(RtrigPin, LOW);
   
  duration = pulseIn(RechoPin, HIGH);
  
  distance = duration * 0.034 / 2; 
 
  Serial.print("Distance: ");
  Serial.print(distance);
  Serial.println(" cm");
}

Did you ever manage to upload using this computer?

It's not stuck, it failed.

You must try to find out why the access is denied. Something is blocking it.

Here are some pointers that might help in solving.

  1. Bluetooth on the computer might be interfering.
  2. Antivirus might block it.
  3. In a corporate environment, it might be blocked.
  4. Another program is also using the port.
  5. COM3 is not the Uno; does it say COM3 (not connected) if you disconnect the board?

Your topic was MOVED to its current forum category which is more appropriate than the original as it has nothing to do with Installation and Troubleshooting of the IDE

Did it ever work?

Correct board selected?

Try restarting the host machine.

Try a different port.

Try a different cable.

a7

Sorry, I thought this came under troubleshooting of the IDE :frowning:

So,
This happened:

Sketch uses 3086 bytes (9%) of program storage space. Maximum is 32256 bytes.
Global variables use 256 bytes (12%) of dynamic memory, leaving 1792 bytes for local variables. Maximum is 2048 bytes.
"C:\Users\Sundaram\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude" "-CC:\Users\Sundaram\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\Sundaram\AppData\Local\Temp\arduino-sketch-F3D38294A44C0B038195622C536BDC2C/Test.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\Sundaram\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": A device which does not exist was specified.



avrdude done.  Thank you.

Failed uploading: uploading error: exit status 1

I used a cable to upload
My Bluetooth was turned off
No other USB devices were connected
No other programs other than Microsoft edge (Browser) was running
And it clearly stated that it was Arduino UNO On port COM3
I specified it
And randomly, it just disconnected from the sotwasre, but it was connected to my Laptop physically, but when I re-inserted physically after taking it out, it connected again, but the error stayed.

Hi,
Have you tried uploading another code, like "Blink without Delay"?
What version IDE are you using?

Thanks.. Tom.. :smiley: :+1: :coffee: :australia:

I got the same error again,
And I am using version 2.0.1

Hi,

So you are using the ONLINE version, you should be in Arduino IDE 2.0 section of the forum

Have you tried using the PC based IDE?

Thanks.. Tom... :smiley: :+1: :coffee: :australia:

That is a matter for debate now that 2.0.0 has been official released rather than being in beta or release candidate status. Otherwise any topic where the poster is using 2.0 would belong in the 2.0 section

IDE 2.0.x is the PC based version :wink: I think that you must drink that coffee that is in your signature :rofl:

I didn't know they had finally clicked over to 2.0.x

Tom... :smiley: :+1: :coffee: :australia:

Let me have that coffee of yours :wink: So I can more clearly phrase my reply.

IDE 2.0.x is a PC based version.

Note:
When you visit https://www.arduino.cc/en/software, IDE 2.0.1 is the main download and 1.8.x is under legacy.

I understood you the first time. :+1:
I have down loaded the 2.0.1.
Will play with it later.

Thanks.. Tom... :smiley: :+1: :coffee: :australia:

Sooooooooooooooooooooooooooooooooooooo

what exactly am I to do now?

Hi,

Have you got rid of the ~~~ 222 ~~~ at the beginning of your code?
Try a legacy IDE, you don't need to delete the 2.0.1 version.

Thanks Tom.... :smiley: :+1: :coffee: :australia:

The what?

Hi,
Have you tried using an earlier version of the IDE?

Tom... :smiley: :smiley: :+1: :coffee: :australia:

Thank you guys!

It seemed to be a problem with my IDE and it worked flawlessly when I loaded with the legacy IDE (1.8.9)

If you were wondering, the serial monitor output was 235CM, although it could have just been my ceiling height.

Thank you all for your help. I may have only marked 1 reply as solution, but all of you replies helped me a lot. Thank you guys so much!

Hi,
When I loaded IDE 2.0.1, it wanted to do Library and board install updates, did you do those?

Thanks.. Tom... :smiley: :+1: :coffee: :coffee: :australia: :australia: