Failed uploading: uploading error: exit status 1

I know there were a lot of topic here with this issue, but since this error represents a lot of issues related with the Arduino, I need to create a topic for my own case.

So when I try to upload example sketch of blinking built in led (or whatever) I get this:

avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00

My Arduino was working some days ago, and it "was broken" about 4-5 days ago. And i spent about a week to find the problem by myself, but false.

I tried to burn a new bootloader using these programmers, but got different errors for different programmers (sorry, couldn't take a screenshot when this menu is opened):

Important note: I can use my Arduino to upload a sketch to my ESP32 cam and it works as needed when I change the board to ESP32. The L led is blinking as expected. Reset button and reseting via pins are working as expected. So my Arduino IS NOT BURNED.

MY ARDUINO STILL OUTPUTS TO SERIAL THE DATA FROM OLD SKETCH!

Characteristics:

Board: Arduino Uno with ATMEGA328P microcontroller
Port: /dev/ttyACM0 (successfully connected)
VID: 0x2341
PID: 0x0043
SN: some_long_number_which_I_couldnt_copy
Programmer: Not sure, just connected the Arduino to my PC via USB.

Hello?

I don't really know what happened, but try using a different USB cable or port and see if the error goes away. You can also try using a powered USB hub to provide more stable power to your Arduino board.

Also, certain devices or shields that are linked to the Arduino pins might cause disruptions in the serial communication between your computer and the Arduino. This is particularly valid for pins 0 and 1, which are designated for serial communication. To eliminate this potential issue, you can attempt disconnecting any devices or shields currently connected to the Arduino pins and observe if the error goes away. Additionally, you may consider uploading an empty sketch (devoid of any code in setup() or loop()) to ensure that there are no remnants of previous code occupying the pins.

Looks like there is no bootloader now, right? Zero response means no answer from the target.

I can use my Arduino to upload a sketch to my ESP32 cam and it works as needed when I change the board to ESP32.

What does it mean? Are you using UNO's 0 &1 pins? What about 328P chip?

@1noahb1 thanks for your reply. I have only one USB cable and it was working to upload sketches to ESP32 cam through arduino uno.

Uploading a fully empty sketch shows the same problem. Also nothing is connected to any pin

Not sure about bootloader.

What does it mean? Are you using UNO's 0 &1 pins? What about 328P chip?

I've connected ESP32 to RX and TX and could successfully upload a sketch to ESP32. In addition - UNO outputs to serial the latest successfully uploaded code (just print "1")

So I can say that my UNO is alive - I can use it for uploading code to ESP32 and it sends an output to serial.

But something is wrong and I cannot upload anything new to UNO

I also tried to connect to different ports on PC, but the same result.

But what did you do with ATmega328P chip? Do you know it is normally connected to Rx, Tx pins?

It's my microcontroller

I am familiar with UNO. This photo does not help.
You are using UNO as USB/serial transceiver for ESP32, right?
What about the 328P in such situation? You cannot have connected 2 devices to the same serial line.
Maybe for Tx it is OK, but not for Rx. That is why I am asking. Did you pull out ATmega before you connected it to ESP32. In addition, isn't ESP32 3.3V device? You should use voltage level tranceiver 5V/3.3V.
You wrote there is an old sketch in 328P which works so I am confused. It looks like also the bootloader is still there.
BTW if you are trying upload sketch to UNO, you cannot have anything connected to pins 0 and 1.
They are exclusively dedicated for uploading during this process, otherwise it fails.

You are using UNO as USB/serial transceiver for ESP32, right?

Sometimes, when there is a need in uploading new sketch to esp

What about the 328P in such situation? You cannot have connected 2 devices to the same serial line.

I know. I use UNO as transceiver OR as ordinary arduino. Not both at the same time.

In addition, isn't ESP32 3.3V device? You should use voltage level tranceiver 5V/3.3V.

Is 5V and I'm connecting it to 5v pin. ESP works as needed - without any problem, UNO works as transceiver as needed - without any problem

You wrote there is an old sketch in 328P which works so I am confused. It looks like also the bootloader is still there.

Yeah, it(UNO) still outputs "1" from old sketch where I just had println("1")

BTW if you are trying upload sketch to UNO, you cannot have anything connected to pins 0 and 1.
They are exclusively dedicated for uploading during this process, otherwise it fails.

Yes I know. I use 1 and 0 pins ONLY when working with ESP. If there is no work with ESP - I want to work with arduino and after removing ESP from arduino and uploading arduino code - I see the errors from the opic question.. In addition I'd to say that RX led is enabling (i.e. arduino is sending output via serial port) Even that led is working, everything is working on this freaking chip, but not sketch uploading

Hi @alkhachatryan. I'm going to ask you to post the full verbose output from an upload attempt.


:exclamation: This procedure is not intended to solve the problem. The purpose is to gather more information.


Please do this:

  1. Select File > Preferences... (or Arduino IDE > Settings... for macOS users) from the Arduino IDE menus.
    The "Preferences" dialog will open.
  2. Uncheck the box next to Show verbose output during: compilation in the "Preferences" dialog.
  3. Check the box next to Show verbose output during: ☐ upload.
  4. Click the "OK" button.
  5. Attempt an upload, as you did before.
  6. Wait for the upload to fail.
  7. You will see a "Upload error: ..." notification at the bottom right corner of the Arduino IDE window. Click the "COPY ERROR MESSAGES" button on that notification.
  8. Open a forum reply here by clicking the "Reply" button.
  9. Click the <CODE/> 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.
    Code block icon on toolbar
  10. Press the Ctrl+V keyboard shortcut (Command+V for macOS users).
    This will paste the error output from the upload into the code block.
  11. Move the cursor outside of the code block markup before you add any additional text to your reply.
  12. Click the "Reply" button to post the output.

Look, if do not pull out the 328P (another option is keep it down by grounding the RESET pin, the best with small resistor ~1k or smaller) you can use it as transceiver for another device only with some lucky circumstances.

Oh, finally I could get some kind of debug thing. Here is the output.

FQBN: arduino:avr:uno
Using board 'uno' from platform in folder: /home/alexey/.arduino15/packages/arduino/hardware/avr/1.8.6
Using core 'arduino' from platform in folder: /home/alexey/.arduino15/packages/arduino/hardware/avr/1.8.6

Detecting libraries used...
/home/alexey/.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=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -I/home/alexey/.arduino15/packages/arduino/hardware/avr/1.8.6/cores/arduino -I/home/alexey/.arduino15/packages/arduino/hardware/avr/1.8.6/variants/standard /tmp/arduino/sketches/4F5858614D2930A47A28156DBC398173/sketch/sketch_jan7a.ino.cpp -o /dev/null
Generating function prototypes...
/home/alexey/.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=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -I/home/alexey/.arduino15/packages/arduino/hardware/avr/1.8.6/cores/arduino -I/home/alexey/.arduino15/packages/arduino/hardware/avr/1.8.6/variants/standard /tmp/arduino/sketches/4F5858614D2930A47A28156DBC398173/sketch/sketch_jan7a.ino.cpp -o /tmp/107577906/sketch_merged.cpp
/home/alexey/.arduino15/packages/builtin/tools/ctags/5.8-arduino11/ctags -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives /tmp/107577906/sketch_merged.cpp
Compiling sketch...
/home/alexey/.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 -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -I/home/alexey/.arduino15/packages/arduino/hardware/avr/1.8.6/cores/arduino -I/home/alexey/.arduino15/packages/arduino/hardware/avr/1.8.6/variants/standard /tmp/arduino/sketches/4F5858614D2930A47A28156DBC398173/sketch/sketch_jan7a.ino.cpp -o /tmp/arduino/sketches/4F5858614D2930A47A28156DBC398173/sketch/sketch_jan7a.ino.cpp.o
Compiling libraries...
Compiling core...
Using precompiled core: /tmp/arduino/cores/arduino_avr_uno_4d14a6cb04b57017ef4416cd3fa01e79/core.a
Linking everything together...
/home/alexey/.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 /tmp/arduino/sketches/4F5858614D2930A47A28156DBC398173/sketch_jan7a.ino.elf /tmp/arduino/sketches/4F5858614D2930A47A28156DBC398173/sketch/sketch_jan7a.ino.cpp.o /tmp/arduino/sketches/4F5858614D2930A47A28156DBC398173/../../cores/arduino_avr_uno_4d14a6cb04b57017ef4416cd3fa01e79/core.a -L/tmp/arduino/sketches/4F5858614D2930A47A28156DBC398173 -lm
/home/alexey/.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 /tmp/arduino/sketches/4F5858614D2930A47A28156DBC398173/sketch_jan7a.ino.elf /tmp/arduino/sketches/4F5858614D2930A47A28156DBC398173/sketch_jan7a.ino.eep
/home/alexey/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-objcopy -O ihex -R .eeprom /tmp/arduino/sketches/4F5858614D2930A47A28156DBC398173/sketch_jan7a.ino.elf /tmp/arduino/sketches/4F5858614D2930A47A28156DBC398173/sketch_jan7a.ino.hex

/home/alexey/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-size -A /tmp/arduino/sketches/4F5858614D2930A47A28156DBC398173/sketch_jan7a.ino.elf
Sketch uses 444 bytes (1%) 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.
"/home/alexey/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/bin/avrdude" "-C/home/alexey/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf" -v -V -patmega328p -carduino "-P/dev/ttyACM0" -b115200 -D "-Uflash:w:/tmp/arduino/sketches/4F5858614D2930A47A28156DBC398173/sketch_jan7a.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 "/home/alexey/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf"
         User configuration file is "/home/alexey/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/ttyACM0
         Using Programmer              : arduino
         Overriding Baud Rate          : 115200
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00

avrdude done.  Thank you.

Failed uploading: uploading error: exit status 1

Hm, however, looks like there is nothing in this log

It is true that it doesn't result in any more information about the errors. However, it is useful to verify that the IDE was correctly configured (e.g., correct board selected from the Tools > Board menu, correct port selected from the Tools > Port menu). I see that you do have everything correctly configured so we can eliminate those possible causes of the upload failure.


Please try this experiment and then report back with the results:


:exclamation: This procedure is not intended to solve the problem. The purpose is to gather more information.


  1. Connect the Arduino board to your computer with a USB cable.
  2. Press and release the button on the Arduino board that is marked "RESET".

Now please reply here on the forum thread with the answer to the following question:

  • Did you see the "L" LED blink multiple times quickly immediately after you released the "RESET" button?

I see that you already mentioned the LED:

However, it is not clear whether you are referring to the LED blinking as the result of the sketch that happens to be running on the board, or this short sequence of quick blinks after a reset that is independent from the sketch (it is done by the bootloader program). I am asking whether the latter occurs.

Check the video

It looks like the bootloader is still there - fast 3 blinks immediately after reset is entry point to the bootloader.

1 Like

Thanks. The video makes it clear that the bootloader program is present and at least functional enough to make the blink. Even though this doesn't provide evidence of a problem with the bootloader, I am left with two possible causes of the upload failure:

  • The bootloader program is partly corrupted
  • There is physical damage to the hardware

In the case of your specific UNO board, which has the socketed ATmega328P microcontroller chip, it might be possible to recover the board from physical damage by replacing the ATmega328P. However, that requires acquiring a replacement chip (unless you happen to have one on hand) and burning the bootloader to the new chip (unless the seller of the one you acquire installed the bootloader on the chip in advance, which is less common).

On the other hand, it might be possible for you to attempt to restore a corrupted bootloader right away by performing a "Burn Bootloader" operation. As I mentioned above, even if that doesn't recover the board, the experience might still be useful to you later if you attempt to replace the ATmega328P. I should warn you though that there is no guarantee that the "Burn Bootloader" operation will restore your board. If you have the necessary hardware on hand and are up for a challenge it is worth a try at least:

Prepare ISP programmer

You will need an ISP programmer. If you don't have a programmer, you can use a spare Arduino board as an "Arduino as ISP" programmer.

Arduino as ISP

The following instructions are for using an Arduino board as an "Arduino as ISP" programmer. If you have a dedicated programmer, you can skip to the next set of instructions.

Although the "Arduino as ISP" only works for programming targets of the AVR architecture, you can also use boards of a variety of architectures (e.g., "AVR", "SAMD", "megaAVR") as an "Arduino as ISP" programmer.


In the instructions below, the board used as an "Arduino as ISP" is referred to as the "programmer board". The board the bootloader is being burned on is referred to as the "target board".


  1. Disconnect the USB cable of the Arduino boards from your computer.

  2. Make the following connections between the "programmer board" and the "target board".
    Refer to the "Connections" table on the SPI library reference page to determine the pin numbers.

    Programmer Target
    CIPO (AKA "MISO") CIPO
    VCC 5V (VCC on 3.3 V boards)
    SCK SCK
    COPI (AKA "MOSI") COPI
    10 RESET
    GND GND
  3. Connect the "programmer board" to your computer with a USB cable.

  4. Select File > Examples > 11.ArduinoISP > ArduinoISP from the Arduino IDE menus.
    The "ArduinoISP" sketch will open in Arduino IDE.

  5. Select your "programmer board" from Arduino IDE's Tools > Board menu.

  6. Select the port of your "programmer board" from Arduino IDE's Tools > Port menu.

  7. Select Sketch > Upload from the Arduino IDE menus.

  8. Wait for the upload to finish.

You are now ready to burn the bootloader using your "Arduino as ISP" programmer.

Burn Bootloader

Instructions for burning the bootloader:

  1. Connect an ISP programmer to your Arduino board.
    If you are using an "Arduino as ISP", then you have already connected it according to the previous instructions.
  2. Select the target board from the Tools > Board menu and any other custom Tools menus (e.g., Tools > Processor).
  3. Select the appropriate programmer from the Tools > Programmer menu.
  4. Tools > Burn Bootloader
  5. Wait for the process to finish successfully.
  6. Disconnect the USB cable of the programmer from your computer.
  7. Disconnect the programmer from the "target board".

Conclusion

Now connect the "target board" to your computer with a USB cable and try uploading again. Does the upload succeed now?

Is it possible to burn it through esp? I have only 1 uno and 1 esp32 cam