Go Down

Topic: Avrdude error with Leonardo ISP (Read 4287 times) previous topic - next topic


Aug 18, 2012, 03:49 pm Last Edit: Aug 21, 2012, 02:18 am by wannabe_pilot Reason: 1
Hello all,

I am fairly new to all of this and I'm still trying to get my bearings, but I've exhausted every outlet that I have come across--to no avail.

I bought the Olimexino 32U4 Leonard-like board (https://www.olimex.com/dev/olimexino-32u4.html) and I've been trying to use it as a ISP to bootload/program a couple of Attiny85s but I keep getting the dreaded out of sync error whenever i try to burn the bootloader/upload a sketch.  I've updated to the latest Tiny cores as well as the modified ArduinoISP.ino sketch but the error remains.

Code: [Select]
avrdude: Version 5.11, compiled on Sep  2 2011 at 19:38:36
        Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
        Copyright (c) 2007-2009 Joerg Wunsch

        System wide configuration file is "C:\arduino-1.0.1-windows\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf"

        Using Port                    : \\.\COM8
        Using Programmer              : stk500v1
        Overriding Baud Rate          : 19200
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: Recv:
avrdude: stk500_getsync(): not in sync: resp=0x00

avrdude done.  Thank you.

In addition, I've been unable to get any output on my serial monitor when using this sketch: http://www.gammon.com.au/forum/?id=11633

I've checked and rechecked my pins--MISO, MOSI, SCK all come from the dedicated pins and RESET is connected to D10 while 5V and GND are attached to the rails.  When I load the sketch, an LED i attached to the MOSI pin lights up but then I'm stuck after that.

I appreciate any help. I wish I'd gotten my first Arduino earlier :)


I get your same error trying to upload a sketch into an attiny2313 through an Arduino Leonardo...it's about a week that I'm trying to solve this problem!
Initially I tought that there was a problem with the attiny, wrongly configured/initialized, but yesterday I try the same procedure reported here http://blog.makezine.com/2011/10/10/how-to-shrinkify-your-arduino-projects/ on my friend Arduino Duemilanove and it worked smoothly.

Moreover I tried to bypass the IDE and use avrdude on shell with the following command:
Code: [Select]
avrdude -p attiny2313 -c arduino -P com17

Code: [Select]
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.03s

avrdude: Device signature = 0xffffff
avrdude: Yikes!  Invalid device signature.
         Double check connections and try again, or use -F to override
         this check.

avrdude done.  Thank you.

It is the same result obtained if the pins from the Arduino are not connected to the attiny, but they are!

So there is something wrong using the Leonardo, maybe some pin mapping is changed or there is a paritucular baudrate to use.
I tried also to change some values in the avrduce.conf file and use directly the icsp pins from the arduino obtaining always same error.

I hope that someone more expert can help us with this unsolved problem :-s

Best Regards



I have placed a wrap up of how to use ArduinoISP with arduino 1.0.1 on the Leonardo over here: http://petervanhoyweghen.wordpress.com/2012/09/16/arduinoisp-on-the-leonardo/.


thanks again peter! i just posted a reply in another thread -- was gonna link your site but you beat me to it!

it's great to see someone's lookin out  ;)


Thank you soooo much PeterVH!!!! In particular for code corrections! :D


Hi there,

not sure if this is the right place to post this. First I want to thank PeterHV for
posting his update of the arduino-1.0.1 code to make the Leonardo work as an ISP.
This got me started!

In the meantime I switched to IDE 1.0.3 and first everything worked fine using the
Leonardo as ISP. After uploading different sketches to check out serial communication
on the leonardo I couldn't get the Leonardo to work as an ISP again. avrdude always
returned 'Yikes!  Invalid device signature.'. After fiddling around for some time with the connections
I came again around this thread and checked the changes PeterHV suggested for 1.0.1 and
compared it to 1.0.3. Everything there besides the change in USBCore.cpp

if (USB_Available(CDC_RX)) --> while (USB_Available(CDC_RX))

So I changed this and: Voila! this made it work again!

Not sure if this change wasn't commited to version 1.0.3 by accident or deliberately.
But given the problems the old version could cause it may be worthwhile to change
it in the upcoming versions.



In what direction did you have to change the code to make it work?
In 1.0.3, it Should be if (USB_Available(CDC_RX)) or you have an infinite loop. I checked github, the change was comitted. I also just extracted arduino-1.0.3-linux32.tgz again and USBCore.cpp also contains  if (USB_Available(CDC_RX)).



  the change was the following: In my old version there was a "IF" which I changed to
"WHILE". This got me recovering from the problem that I couldn't read the device signature
of the ATtiny on the breadboard and for a while things worked perfect.

Now in the meantime I started to play around with an ATmega8 and subsequently I ran
in the problem that during uploading the error 'avrdude: stk500_recv(): programmer is
not responding' (and the yellow LED stayed 'on' which is consistent with being in an
infinite loop). Remembering that I did the above change I reverted back to 'IF' and
again things started to work fine. So the 'IF' seems to be the right thing.

My conclusion from this is:
(1) The 'IF' in the 1.0.3 IDE is correct!
(2) There my be instances where a 'WHILE' is needed to recover from a certain state
     because the whole thing started when I was playing around with the RX/TX interface and
     then reverted to the leonardo as an ISP programer.

Sorry for steering up some confusion here.

Thanks and Cheers!

Go Up