3D Robotics

Arduino debugging tips


If you're trying to upload code with Arduino and you get an error message that looks something like this:
"Problem uploading code.....

avrdude: stk500_getsync(): not in sync: resp=0x78
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x78"

(or any other error report when uploading code, aside from the obvious ones like compile errors or choosing the wrong serial port)

Here are the most common causes and things to check.

  1. Did you check the "Set RTS on close" box in the Windows Com port, as instructed in the manual?
  2. Are you selecting the right board? For ArduPilotMega, if your board uses an ATMega1280 processor (the big chip on the APM board will say "ATmega1280") select "Arduino Mega (Atmega1280)". If you've got an ATMega2560 chip, select "Arduino Mega 2560". For the original ArduPilot and ArduIMU, choose "Arduino Duemilanove".
  3. Is the cable plugged into a USB hub? That can sometimes cause trouble. Try plugging it straight into your PC.
  4. Are you using the latest FTDI drivers? Install them if not. If you're still having trouble, try reinstalling them.
  5. Check your solder joints! It's a good idea to reheat and reflow all of the ones you did, just to be sure.
  6. Other errors that have caused this problem in the past include a power source (such as your ESC) that is putting out a voltage outside the acceptable range of 4-7v, faulty USB or FTDI cables, and corrupted FTDI drivers. When in doubt, try a different power source, a different cable or a different PC.

Additional things to check if you're using the original ArduPilot board (not ArduPilotMega):

  1. [For original ArduPilot board only] Is your FTDI cable plugged in the right way? The black wire or side marked "black" should be on ArduPilot's BLK pin.
  2. [For original ArduPilot board only] Are you using the DIYDrones or Adafruit FTDI cable? We've had trouble with other ones...
  3. [For original ArduPilot board only] Is the ArduPilot board powered on, ideally through your RC system or ESC? (You can NOT power it from the FTDI cable; this is a safety measure to avoid power conflicts.)

If those all look fine and you're still getting the error message (especially if you can successfully load code to other Arduino boards), you may have a corrupted FTDI driver or a bad FTDI cable. Try reinstalling on another PC and see if that does the trick. If it doesn't, you may need a replacement FTDI cable.

In some rare cases, a power glitch may have resulted in a corrupted ArduPilot bootloader on the ATMega chip. This tutorial will show you how to reload the bootloader. (Warning--for experts only and requires an AVR programmer. This should not be necessary for most people.)

Other problems can include "Serial port not found" (just check that you've selected the right serial port in the Tools menu. It's the one assigned when you first plugged in the FTDI cable--probably 5 or higher), and the Arduino IDE freezing (try unplugging the FTDI cable. If that doesn't work, just reboot your computer).
E-mail me when people leave their comments –

You need to be a member of diydrones to add comments!

Join diydrones


  • 3D Robotics
    Feri, that old post you found is way out of date. The manual is correct. Try doing it without the shield, and just plug in the GPS in the main ArduPilot board and connect D6 to ground.
  • Dale,

    I really appreciate your information, very helpfull.

    But for now i thinks the problems is in hardware, because i already tried the same procedure on top of the 6 floors of my lab, i still can't get the GPS locked status.

    Thank you very much.

  • Hi Chris,

    For a couple days, I've done what you've recommend for me.
    But it's just the same, i still can't get the GPS lock status and the GPS Red Led still turning on and flashing.

    But when I checked the board, i found something that's make me little confuse..

    Here are the conditions

    * I already follow the instructions on ArduPilot 2.x manual (http://docs.google.com/View?id=ddjmqgw3_43gm6gvggf) and got all the components installed.

    * On the ArduPilot 2.x complete manual above, the bind plug should be like picture below


    But, on this page, Using ArduPilot 2.x in the field (http://diydrones.com/profiles/blogs/using-ardupilot-2x-in-the)
    I found that i have to connet the bind plug on pin D6 and D7


    So, where should i put the bind plug / jumper? Or should i put the bind plug and jumper together at the same time?

  • Feri,
    try walking around outside.

    my neighborhood has houses relatively close together and large trees. if I go outside and just stand in the backyard (reasonably clear view of sky, but not so good view low toward south), it may take a while to get lock. if I go walk down the street, then it gets a look in a minute or so. this is if it has not been on recently, and the programming to sirf mode was done again.

    I think I read that the gps device keeps track of where it was last time, which satelites to use. so after having walked around outside, I can come back in the house, and it gets lock right away. because it saw those satelites recently I speculate.

    If I turn it on in the house, for the first time, even with it in a south facing window (gps sats are to the south for me in north america? I think I read?), it may not get a lock for 30 min, if at all.

    so what you describe may be just normal, or at least similar to me.

    hope that helps.
  • 3D Robotics
    If the bind plug is in, the setup process should blink the yellow LED twice while it's reprogramming the EM406 into binary, at which point the EM406's LED should turn off (actually just very dim). If that's not happening, you've got a hardware issue, such as poor solder joint or a bent pin in the GPS connector. Try again with the EM406 plugged into the ArduPilot's GPS connector, not the shield's.
  • Thanks for your reply.

    I already set the GPS mode on configuration file. Since i'm using the EM406, based on manual, i have to set the GPS protocol in to SIRF (1=SIRF)

    #define GPS_PROTOCOL 1 // 0 = NMEA, 1=SIRF, 2=uBlox, Choose protocol

    When i power the ardupilot board, the GPS LED always turning on (red).

    So, I can't get the GPS locked (blue gps lock status solid blue) because the GPS is not working?

    Do you have any idea what should i do now?


    Feri Ametia Pratama.
  • 3D Robotics
    Have you selected the EM406 in the configuration file (easystar.h)? Your GPS LED should not be on (the autopilot programs it into binary mode during the setup process, which turns off the LED)
  • Hi Chris..
    I have some problems here with my ardupilot that i just purchased 2 weeks ago
    I really hope you can help me to solve the problems...

    here are the hardwares:
    newest ardupilot from sparkfun
    ardushield kit from diydrones store
    EM406 GPS module (already have it on my lab)
    MLX90247 thermopile from diydrones store
    FTDI cale from diydrones store

    I prepared the hardware as written in manual, and get my ardupilot board connected with shield and sensors (thermopile and gps).
    I was succed on compiling the code to the board without any error.
    I'm using the arduino 0017 as compiler and the ardupilot v24 code from ardupilot google code page.

    I'm using separate power source (not from esc) and already removed the jumper as written in manual.
    I'm using 3-cell li-po about 360mah

    here is the problems,
    * I can't get solid blue led GPS Lock status

    when i connected the battery:
    red ardushield power led : on (solid)
    red GPS power led : on (solid)
    yellow led on ardupilot board : flashing
    blue led GPS lock : flashing

    I tried to get the signal outside to get the clear sky but after 5 till 10 minutes nothing happens, the yellow and blue led keep flashing (with bind plug connected)

    i already followed the comments drom ardupilot main page and this debuggin tips, but i didn't find the solutions of my problems.

    and from manual and your postings, i found that the the sensor will not working before we get the gps locked.

    Feri Ametia Pratama.
  • I have the same problem just like everyone else.
    I followed the listed things to check, but nothing works.
    Here's what I have on the screen.

    avrdude: stk500_get sync(): not in sync: resp=0x00
    avrdude: stk500_disable(): protocol error, expect = 0x14, resp=0x51

    I powered a ardupilot with power supply at 5V to the pins right next to FTDI cable, and I also tried a battery connected to the pins right next to 'analog 0'.
    none seems to work and it would be great if anyone has gone through this step and finally got it working.

    Could you guys tell me what I've done wrong?

  • Okay Orderd 1 order number is 1873. :(

    But basicaly SparkFun Recommends it.

    We highly recommend the following items to accompany this product:
    An EM406 GPS module
    An FTDI Basic or FTDI cable for programming
    An extended EM406 GPS cable
    An Expansion Board with airspeed sensor
    XY and Z sensors
This reply was deleted.