Arduino failing?

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
mwm
 
Posts: 19
Joined: Thu Mar 07, 2013 7:10 pm

Arduino failing?

Post by mwm »

I've got a brand new arduino uno (arrived yesterday). Uploading to it fails with the message: avrdude: stk500_getsync(): not in sync: resp=0x86

I'm pretty sure the rest of the setup (USB cables, drivers, Arduino IDE, etc.) is right - if I plug in an older Uno, iI can upload just fine.

Any suggestions on fixing this? I already tried "burn bootloader", and get the same results.

User avatar
adafruit_support_bill
 
Posts: 88141
Joined: Sat Feb 07, 2009 10:11 am

Re: Arduino failing?

Post by adafruit_support_bill »

First make sure you have the right COM port and board type selected.

Do you see any led activity on the board when you attempt to upload?

User avatar
mwm
 
Posts: 19
Joined: Thu Mar 07, 2013 7:10 pm

Re: Arduino failing?

Post by mwm »

Well, they look right to me. And I'm pretty sure that if they were wrong, my older Uno wouldn't work.

When I hit upload, led 13 goes through it's reset dance, the rx light blinks once, then the rx/tx lights blink in sync with each other a few times, as if the data were being echoed, then 13 blinks a few times, and finally the tx light blinks a final time.

User avatar
adafruit_support_bill
 
Posts: 88141
Joined: Sat Feb 07, 2009 10:11 am

Re: Arduino failing?

Post by adafruit_support_bill »

I'm pretty sure that if they were wrong, my older Uno wouldn't work
Different Unos typically show up on different COM ports. But if you are getting led activity as you describe, then the port is probably set correctly. And it sounds like both the 16U2 and 328P are alive.

If you select "File->Preferences" and check the box for verbose output on upload, there will be some diagnostic information printed to the IDE output window when you upload. Do an upload and post the output.

User avatar
mwm
 
Posts: 19
Joined: Thu Mar 07, 2013 7:10 pm

Re: Arduino failing?

Post by mwm »

Hmm. My arduino's normally show up in the order they connect. In particular, if I only have one plugged in and replace it (as in when doing such tests), I always get the same port.

Code: Select all

Binary sketch size: 3,948 bytes (of a 32,256 byte maximum)
/usr/local/arduino/hardware/tools/avr/bin/avrdude -C/usr/local/arduino/hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega328p -carduino -P/dev/ttyU0 -b115200 -D -Uflash:w:/tmp/build4591132254406120592.tmp/rgb_lcd_example.cpp.hex:i 

avrdude: Version 5.11, compiled on Feb 27 2013 at 18:31:21
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "/usr/local/arduino/hardware/tools/avr/etc/avrdude.conf"
         User configuration file is "/export/mwm/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/ttyU0
         Using Programmer              : arduino
         Overriding Baud Rate          : 115200
avrdude: Send: 0 [30]   [20] 
avrdude: Send: 0 [30]   [20] 
avrdude: Send: 0 [30]   [20] 
avrdude: Recv: . [86] 
avrdude: stk500_getsync(): not in sync: resp=0x86

avrdude done.  Thank you.
And just for reference, here's a burn to a working Uno:

Code: Select all

Binary sketch size: 3,948 bytes (of a 32,256 byte maximum)
/usr/local/arduino/hardware/tools/avr/bin/avrdude -C/usr/local/arduino/hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega328p -carduino -P/dev/ttyU0 -b115200 -D -Uflash:w:/tmp/build4591132254406120592.tmp/rgb_lcd_example.cpp.hex:i 

avrdude: Version 5.11, compiled on Feb 27 2013 at 18:31:21
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "/usr/local/arduino/hardware/tools/avr/etc/avrdude.conf"
         User configuration file is "/export/mwm/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/ttyU0
         Using Programmer              : arduino
         Overriding Baud Rate          : 115200
avrdude: Send: 0 [30]   [20] 
avrdude: Send: 0 [30]   [20] 
avrdude: Send: 0 [30]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [10] 
         AVR Part                      : ATMEGA328P
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PC2
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

[Actual download elided]

avrdude: verifying ...
avrdude: 3948 bytes of flash verified
avrdude: Send: Q [51]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [10] 

avrdude done.  Thank you.


User avatar
adafruit_support_bill
 
Posts: 88141
Joined: Sat Feb 07, 2009 10:11 am

Re: Arduino failing?

Post by adafruit_support_bill »

One more thing to try: Press the reset button as the compile completes and the upload starts. The timing is a bit tricky, it usually takes several tries to get it right.

If that doesn't work. Contact [email protected] with a link to this thread for a replacement.

User avatar
mwm
 
Posts: 19
Joined: Thu Mar 07, 2013 7:10 pm

Re: Arduino failing?

Post by mwm »

The replacement got here today. Thank you for that. I haven't checked it yet, because...

In chasing a problem with some code on a Leonardo, the USB Stack maintainer suggested a patch to avrdude (I'm not sure why). That fixed things.

I see the stk500_getsync() issue with various arduino's at random, some more often than others. Hitting reset and/or trying again often works (but didn't in this case). I suspect it's a timing issue of some sort, and this Uno was in the tail of the distribution curve.

Searching the web for this problem turns up people with the problem, but no solutions. I'm letting you know about it so you can have people try it in the future, and hopefully the search engines will start finding this solution.

Here's the patch:

Code: Select all

 --- stk500.c.orig      2013-06-28 13:00:11.000000000 +0200
 +++ stk500.c   2013-06-28 13:01:13.000000000 +0200
 @@ -91,10 +91,11 @@
    /*
     * First send and drain a few times to get rid of line noise
     */
 -
 -  stk500_send(pgm, buf, 2);
 -  stk500_drain(pgm, 0);
 -  stk500_send(pgm, buf, 2);
 +
 +  /*
 +   * XXX The Arduino only sends the sync sequence once after modem open.
 +   * XXX Only drain once!
 +   */
    stk500_drain(pgm, 0);

    stk500_send(pgm, buf, 2);

User avatar
adafruit_support_bill
 
Posts: 88141
Joined: Sat Feb 07, 2009 10:11 am

Re: Arduino failing?

Post by adafruit_support_bill »

Thanks for posting. We'll check it out.

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”