Dealing With “AVRDude: stk500_getsync(): not in sync” Errors

These error messages are not only common, but also very annoying. Their text is unfriendly and unhelpful; so what’s really the problem, and what can you do to fix it if and when it happens to you?

AVRDude Sync error screenshot
AVRDude Sync error

The Problem Personified

Let’s say your name is Dude – better yet, AVRDude. You work in an office, and one day your boss comes in and gives you a little paper note. “Hey AVRDude,” she says, “this is the phone number of a Mr. R. Duino. Please call him and tell him to turn some lights on and off.” So you unfold the note, see a number and dial. It rings. What could possibly go wrong at this stage? Here are a few possibilities:

  • No one picks up the phone
  • Phone was left on Mr. Duino’s bed, and his cat accepts the call
  • Mr. Duino answers, but the line is so noisy he can’t hear you
  • He can hear you but he doesn’t speak your language

Of course, lots of other things can go wrong: the number could be incorrect, Mr. Duino could neglect his duties after talking to you, and so on. In this case, however, we are dealing with issues where the communication channel is established (the phone rings) and the addressee is willing in principle, but the message can’t get through.

A Bit More Technical

In the story above, the boss is of course the Arduino IDE on your PC. When you attempt to upload your code, assuming it compiled successfully, the IDE invokes the AVRDude program and tells it to pass the compiled code to the Arduino board.  Now, on most Arduino boards (except Leonardo and Micro, I believe), there’s a dedicated USB-to-Serial chip near the USB connector. This is the “telephone”, and it’s connected (via pins 0 & 1) to Mr. Duino, who is actually the ATmega microcontroller.

 As you may recall, every normal Arduino board has a Bootloader burnt on the microcontroller. This Bootloader listens for communications for a short while after a board reset, and if there’s incoming compiled code, he burns it before yielding control to your program. So basically, all the “AVRDude: stk500_getsync(): not in sync” errors (such as “avrdude: stk500_getsync(): not in sync: resp=0x00” or “avrdude: stk500_getsync(): not in sync: resp=0x01“) happen when the USB-to-Serial chip can’t talk to the Bootloader properly. This may happen for many different reasons, both hardware and software.

Things To Do And Try

First, be calm. If you get this kind of error, it means at least part of your system works! 🙂

1. Make sure you selected the correct target in the Arduino IDE. In the Tools menu, did you pick the right Port, Board and Processor (where applicable)? Sometimes, all it takes is a little slip of the mouse… and if you’re not sure, try different options. It won’t harm the board.

2. Ensure solid connections. Weak electrical connections can cause a lot of trouble. Try a different USB cable and a different USB port, and verify the connectors are all the way in. If you work with Pro Mini boards, or otherwise connect directly to the Arduino board pins, ascertain that all the wires make good contact. If a wire goes into a hole in a PCB, solder it! Sometimes, even breadboards can fail – try different rows.

3. Keep the communication lines clean. The RX/TX pins (#0 & #1) on the Arduino board are connected directly to the microcontroller’s UART communication pins, so if you connected them to something else in addition (e.g. a Bluetooth or GPS module), there will be conflict and chaos. Disconnect external components temporarily; if you intend to solder components in the system, consider putting DIP switches or jumpers on these lines so you can disconnect them physically when required.

 4. If you use an external USB-to-Serial module: Some modules have problematic pinouts. Does the “reset” pin on the module actually reset the Arduino? Try several times to hold the Arduino Reset button pressed almost until the uploading process starts. Still no luck? Try to cross RX and TX between the module and the board.

5. Bootloader Be Good: Could it be that your microcontroller doesn’t have the right Bootloader – or any Bootloader at all? Did you ever replace the microcontroller on this board, or attempted programming a new bootloader onto it? Perhaps you bought a cheap Arduino clone whose manufacturer “forgot” to put a Bootloader in the first place? If so, now may be a good time to consider programming a decent, appropriate  Bootloader.

6. How ’bout them drivers: Yes, the software drivers on your PC may be wrong for this particular board. Check out this guide first. If all else fails, try to uninstall and re-install the entire Arduino IDE – the newest version, if possible.

What Next

As far as I can recall, the above six options cover all cases of “stk500_getsync()” errors I’ve seen. That doesn’t mean that the list is exhaustive, though; there are always surprises. If you discover a new cause or solution, please let me know so I can update the list.

3 thoughts on “Dealing With “AVRDude: stk500_getsync(): not in sync” Errors”

  1. we have the same problem and did all listed above. what else can we do? please HELP thanks!!!

    1. Well, if it’s not any of the “ususal suspects”, it will be very hard to tell what the problem could be without actually playing around with the board. So I suggest you find a hackerspace near you with experienced Arduino users, and ask there. Also, if you hven’t already, try your board on another computer. Good luck!

  2. I am certain I would take longer to digest what follows after the introduction.
    My high appreciation for the introductory comparison!
    Suresh

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.