Arduino UNO r3: "Error Occurred while uploading Sketch"

Hello,

I’m brand new to Arduino. I’ve spent several hours this past week trying to sort this out and think it’s time I cry “Uncle” and present my issue here.

My problem started with my first project using an Elegoo starter kit. I wrote the “Blinking light Project” sketch with variations to the blink time, since my board is already blinking (LED at Pin 13). I Verified my code, then tried uploading my sketch. After about 5 minutes I got an "Error Occurred while uploading Sketch" message. I’ve since confirmed Com ports, Verbose settings, board setting, checked for pins and completed several clean installs of Arduino from the Elegoo and Arduino sites. Still no luck.

The details below are from a (real) Arduino UNO R3:

Windows 10 (4-5 year old, low milage, lots of available storage, laptop)
Arduino 1.8.13 (Clean installed from the Arduino.cc website)
Sketch book Location - C drive: …Documents/Arduino folder
Both Verbose boxes checked
Board “Arduino UNO”
Port: COM9 (ARDUINO UNO)
Programmer: AVRISP mkll

Below is my error code. This arrives after about 5 minutes of my computer trying to upload my sketch.

Could this be a timing out issue? – Dunno…

Thanks in advance! Apologies, if this is the incorrect sub forum to post this.

BB

C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\bigdog 2\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\bigdog 2\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\bigdog 2\Documents\Arduino\libraries -fqbn=arduino:avr:uno -vid-pid=2341_0043 -ide-version=10813 -build-path C:\Users\BIGDOG~1\AppData\Local\Temp\arduino_build_33032 -warnings=none -build-cache C:\Users\BIGDOG~1\AppData\Local\Temp\arduino_cache_684400 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=C:\Users\bigdog 2\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.3.0 -prefs=runtime.tools.arduinoOTA-1.3.0.path=C:\Users\bigdog 2\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.3.0 -prefs=runtime.tools.avrdude.path=C:\Users\bigdog 2\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17 -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=C:\Users\bigdog 2\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17 -prefs=runtime.tools.avr-gcc.path=C:\Users\bigdog 2\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7 -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino7.path=C:\Users\bigdog 2\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7 -verbose C:\Users\bigdog 2\Documents\Arduino\BlinkLED_Lesson1\BlinkLED_Lesson1.ino

C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\bigdog 2\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\bigdog 2\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\bigdog 2\Documents\Arduino\libraries -fqbn=arduino:avr:uno -vid-pid=2341_0043 -ide-version=10813 -build-path C:\Users\BIGDOG~1\AppData\Local\Temp\arduino_build_33032 -warnings=none -build-cache C:\Users\BIGDOG~1\AppData\Local\Temp\arduino_cache_684400 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=C:\Users\bigdog 2\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.3.0 -prefs=runtime.tools.arduinoOTA-1.3.0.path=C:\Users\bigdog 2\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.3.0 -prefs=runtime.tools.avrdude.path=C:\Users\bigdog 2\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17 -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=C:\Users\bigdog 2\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17 -prefs=runtime.tools.avr-gcc.path=C:\Users\bigdog 2\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7 -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino7.path=C:\Users\bigdog 2\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7 -verbose C:\Users\bigdog 2\Documents\Arduino\BlinkLED_Lesson1\BlinkLED_Lesson1.ino

Using board 'uno' from platform in folder: C:\Users\bigdog 2\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.3

Using core 'arduino' from platform in folder: C:\Users\bigdog 2\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.3

Detecting libraries used...

"C:\Users\bigdog 2\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Users\bigdog 2\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.3\cores\arduino" "-IC:\Users\bigdog 2\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.3\variants\standard" "C:\Users\BIGDOG~1\AppData\Local\Temp\arduino_build_33032\sketch\BlinkLED_Lesson1.ino.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE

Over character limit. To be continued...

Linking everything together...

"C:\Users\bigdog 2\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-gcc" -w -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=atmega328p -o "C:\Users\BIGDOG~1\AppData\Local\Temp\arduino_build_33032/BlinkLED_Lesson1.ino.elf" "C:\Users\BIGDOG~1\AppData\Local\Temp\arduino_build_33032\sketch\BlinkLED_Lesson1.ino.cpp.o" "C:\Users\BIGDOG~1\AppData\Local\Temp\arduino_build_33032/..\arduino_cache_684400\core\core_arduino_avr_uno_ea836d639a4cd54e69224db8d652d32b.a" "-LC:\Users\BIGDOG~1\AppData\Local\Temp\arduino_build_33032" -lm

"C:\Users\bigdog 2\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-objcopy" -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 "C:\Users\BIGDOG~1\AppData\Local\Temp\arduino_build_33032/BlinkLED_Lesson1.ino.elf" "C:\Users\BIGDOG~1\AppData\Local\Temp\arduino_build_33032/BlinkLED_Lesson1.ino.eep"

"C:\Users\bigdog 2\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-objcopy" -O ihex -R .eeprom "C:\Users\BIGDOG~1\AppData\Local\Temp\arduino_build_33032/BlinkLED_Lesson1.ino.elf" "C:\Users\BIGDOG~1\AppData\Local\Temp\arduino_build_33032/BlinkLED_Lesson1.ino.hex"

"C:\Users\bigdog 2\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-size" -A "C:\Users\BIGDOG~1\AppData\Local\Temp\arduino_build_33032/BlinkLED_Lesson1.ino.elf"

Sketch uses 932 bytes (2%) of program storage space. Maximum is 32256 bytes.

Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes.

C:\Users\bigdog 2\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude -CC:\Users\bigdog 2\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf -v -patmega328p -carduino -PCOM9 -b115200 -D -Uflash:w:C:\Users\BIGDOG~1\AppData\Local\Temp\arduino_build_33032/BlinkLED_Lesson1.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\bigdog 2\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf"

Using Port : COM9

Using Programmer : arduino

Overriding Baud Rate : 115200

An error occurred while uploading the sketch

Since posting here, I’ve continued to search for remedies to my "Error Occurred while uploading Sketch" issue, but still can’t figure it out. Most similar issues are squared away with simple attention to com port / preference settings or a new USB cable.

I’ve experimented with several clean installs of every version of Windows Arduino IDE software available from the Arduino.cc and Elegoo.com websites. They all automatically recognize and load my boards settings. That said, I understand Arduino IDE 1.8.13 for “Windows (windows 7 and newer)" from the Arduino.cc site, is the preferred software for my Windows 10 laptop, and what I am sticking with until recommend otherwise.

I uploaded Arduino IDE 1.8.13 on a neighbors Windows 10 tower and WAS ABLE to upload my blinking light sketch without any problem. So, at least I know my Arduino and Elegoo UNO’s work.

Here are some things I think I need to check. Most are in areas I’m not very familiar with but hoping it may ring a bell for one of you:

Is the error code I posted useful, or I need to resubmit using a different “Verbose” preference setting?

Baud Rate? “Overriding Baud Rate: 115200” --- Should this be more like 9600?

Firewall or Virus protection restriction? --- I haven’t seen any error messages or warnings, but my code isn’t getting through for some reason.

Java issue? -- Dunno

Drivers? – my Com Port is automatically recognized as “COM9 (ARDUINO UNO)” -- Is there a way to confirm my driver version, or is that a standard part of the IDE upload?

Placing IDE software on a different drive. --- I only have a C drive. I suspect they are referring to setting up a dedicated partition? --- I’ve heard this mentioned a couple of times, but seems like overkill for such small sketch uploads (My blinking light sketch is 932 bytes). I’ve used this laptop with full blown Photoshop for illustration work without any lag or speed issues.

Bootloader? – Not certain what these are for, but sound like they may perform some sort of jump starting… Maybe?

I’d appreciate any advice you can offer. - Thanks in advance!

barebulb:
Baud Rate? “Overriding Baud Rate: 115200” --- Should this be more like 9600?

No. This part of the output is normal and expected. It will be shown on any successful upload as well.

barebulb:
Bootloader? – Not certain what these are for, but sound like they may perform some sort of jump starting…

I doubt it. Bootloader problems can certainly cause upload failures, but when the problem is on the microcontroller end of things avrdude is able to provide some useful error messages as it attempts repeatedly to do an upload.

barebulb:
I’d appreciate any advice you can offer. - Thanks in advance!

Unfortunately, this is a tricky problem. Normally, we get some nice error messages when the upload fails and these give us some idea of the reason. But very rarely we get reports like yours where it just dies without any useful output at all. That makes it difficult to troubleshoot.

I have been making a collection of this type of report for the last couple years with the intention of going back to review them all to see if I can learn more about the issue from the discussion on those threads. I haven't found the time to do that, but I'll share the list in case you want to take a look:

Other than that, I can suggest you to run the command from the command line (i.e., Windows cmd) with some flags added to make the output more verbose. It's possible this will give some helpful information:

Do an upload in the Arduino IDE.

After the upload fails, find the avrdude command the Arduino IDE generated for the upload. It will look something like this:

barebulb:

C:\Users\bigdog 2\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude -CC:\Users\bigdog 2\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf -v -patmega328p -carduino -PCOM9 -b115200 -D -Uflash:w:C:\Users\BIGDOG~1\AppData\Local\Temp\arduino_build_33032/BlinkLED_Lesson1.ino.hex:i

Copy the command to the clipboard.

Paste the command into a text editor (you can use the Arduino IDE's editor if you like).

Add the following flags to the command: -v -v -v
Each -v makes the output more verbose. Added to the existing -v added by the Arduino IDE, this quadruple verbose setting will normally give more output than a mere mortal is capable of comprehending.

Wrap all paths in the command in quotes (") (this is required when there are spaces in the path).

Copy the modified command to the clipboard.

Start a command line terminal.

Paste the modified command into the command line terminal.

Press the "Enter" key.

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