Source: https://mokxi.com/learn/avrdude-stk500-getsync-not-in-sync

Learn

# avrdude: stk500_getsync(): not in sync, and how to get the upload through

Beginner

Written by the Mokxi team

Start building free Open the editor

Or see every lesson.

- 455 parts on the bench
- 43 boards running now
- 1.00x real time, on every board

Click to open it in the editor

The LED on pin 13 blinks once a second. Open it in the editor and press Send to board to put the same sketch on a real Uno.

This error comes after the sketch has compiled, while the Arduino IDE is putting it on the board. avrdude, the program that does the uploading, resets the board and sends a "get in sync" message to its bootloader, the small program that runs for about a second after a reset and listens for a new sketch. not in sync: resp=0x00 means avrdude asked, ten times, and never got the right answer back. The upload never started, so nothing on the board changed.

So this is never a problem with your code. It is the conversation between the computer and the board: the wrong port, the wrong board or bootloader speed, something on the board’s serial pins, or a board that is not resetting. The checklist below goes from the most likely cause to the least. The circuit above is Blink, the sketch to try first on a board that will not take an upload.

## What the message is telling you

A failed upload in the Arduino IDE 1.8 looks like avrdude: stk500_recv(): programmer is not responding followed by avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00, repeated up to attempt 10. The Arduino IDE 2 prints the same avrdude lines and ends with Failed uploading: uploading error: exit status 1. The "programmer" is the bootloader on your board: avrdude talks to it as a programmer that speaks the STK500 protocol.

The resp= value is the byte that came back instead of the answer. 0x00 usually means nothing useful came back at all. Other values, often changing from one attempt to the next, usually mean something did answer, but not at that speed or not in that language: the wrong baud rate for the bootloader, or the old sketch still running and printing because the reset did not happen.

## The checklist, most likely first

The port. In Tools, Port, pick the one that appears when you plug the board in and disappears when you unplug it. On Windows it is a COM number, on a Mac a /dev/cu.usbmodem or /dev/cu.usbserial name, and on Linux /dev/ttyACM0 or /dev/ttyUSB0.

The board and the bootloader. A Nano clone almost always needs Tools, Processor, ATmega328P (Old Bootloader), because it carries the older bootloader that listens at 57600 baud, while the IDE’s plain Nano setting talks at 115200. This is the most common fix for this error on a Nano. On an Uno, check that the board really is set to Arduino Uno.

Nothing on pins 0 and 1. They are the board’s serial port, the same two wires the upload uses. A Bluetooth module, a GPS or another board on them can drown out the bootloader. Unplug whatever is on them while you upload.

Nothing else holding the port. Close the Serial Monitor in another IDE window, a 3D printer host and any other program that opens serial ports. A busy port usually gives can't open device or Access is denied instead, so check this when you see either.

The cable and the driver. Some USB cables only carry power. If no new port appears when you plug the board in, try another cable. A clone with a CH340 or CP2102 USB chip may also need its driver on Windows and on older versions of macOS.

The reset. avrdude restarts the board through the serial port’s DTR line, which a capacitor on the board turns into a reset pulse. If that is not happening, press the board’s reset button yourself just as the IDE’s status changes from compiling to uploading. If that gets it through, the board’s auto-reset is the fault.

No bootloader. A new ATmega328P chip, or one that was written with a programmer, may have no bootloader to answer. Burn one with a second Arduino running the ArduinoISP example, or upload through that programmer instead.

## Uploading from Mokxi instead

Mokxi can upload to an Uno, a Nano, a Mega 2560, a Leonardo, a Micro, a Pro Mini or a Pro Micro from Chrome or Edge on a computer or a Chromebook, with nothing to install: press Send to board, then Upload, and pick the port. It speaks the same STK500 protocol avrdude does to an Uno or a Nano, so the same causes stop it and the same checklist applies.

Two things are done for you. If an Uno project gets no answer at the Uno’s 115200 baud, Mokxi tries once more by itself at 57600, the old bootloader’s speed, because many Nano clones and a few Uno clones carry it. A Nano project lets you choose the Arduino Nano (old bootloader), and if the plain Nano gets no answer, the error suggests it. When nothing answers at all, the card says "No board found" and names the usual suspects: the wrong board, a cable that only charges, or the wrong port.

## Questions

What does avrdude stk500_getsync() not in sync mean?

The computer could not get the board’s bootloader to answer, so the upload never started. Check the port, the board and processor setting (Old Bootloader for most Nano clones), and anything connected to pins 0 and 1.

What does resp=0x00 mean?

That the bootloader’s answer never came, which usually means nothing answered at all: the wrong port, a board that did not reset, or no bootloader. A value that changes between attempts usually means the wrong baud rate.

Why does my Nano clone say not in sync?

Because most clones carry the old bootloader at 57600 baud. In the Arduino IDE choose Tools, Processor, ATmega328P (Old Bootloader). In Mokxi, choose Arduino Nano (old bootloader) in the upload card.

Does this error mean my board is broken?

Usually not. Work through the checklist first: the port, the processor setting, pins 0 and 1, the cable and the reset. A missing bootloader or a damaged USB chip are the rarer causes.

Related

## Keep going

Arduino "exit status 1": Find the Real Error Arduino Compile Errors Explained, With the Fixes Blink an LED with Arduino: Wiring and the Resistor Arduino Simulator for Chromebook, Free in Chrome Help: send a program to a real board The Arduino Nano in the simulator The project page, with the full sketch Beginner

Sources

## Where the facts on this page come from

- AVRDUDE, the uploader the Arduino IDE runs
- Optiboot, the Uno’s bootloader, at 115200 baud

## Build this for real

Open the editor, change a value and watch the number move with it. Nothing to install, and no account needed.

Start building free Open the editor
