Go Down

Topic: using leonardo to upload sketches to atmega168/328 (Read 2 times) previous topic - next topic

PeterVH

Quote
But even without the automatic reset, if I try it manually, it only shows me a bunch of sdk-failed errors.

My guess is that you have serial buffer overruns. Follow the link above and have look at the fixes proposed in "ArduinoISP on the Leonardo"

riyadhalnur

PeterVH, your other tutorial on modifying the leonardo helped a lot. i made a breadboard arduino and programmed it via the leonardo but i coduln't do it via the IDE. it kept giving me device signature failures. so i used avrdude from cmd with the -F command at the end to override the signature check and everything worked perfectly


PeterVH

Good to hear, but I find it very suspicious you had to use -F. What signature did avrdude report? Was it 0 (then you still have a problem in your wiring or setup) or just not the signature for your target.

simplex

#13
Nov 09, 2012, 11:12 pm Last Edit: Nov 09, 2012, 11:19 pm by simplex Reason: 1
Quote
I find it very suspicious you had to use -F

I read the post of riyadhalnur yesterday and did a test using an Uno not a Leonardo because I do not have one. I tried to check if using the -F option will change the error message thrown by avrdude in case a SPI connection is broken.
The reported error changes but it remains an evident error.
If I have good connections between Arduino and the target AVR no error is displayed.

My settings:
Arduino Uno + ArduinoISP as in ISP Programmer
Connections: Arduino Uno (SS, Miso, Mosi, SCK) -> taget on breadboard Atmegae328p (Reset, Miso, Mosi, SCK).

1) Good ISP connections:
Code: [Select]
c:\>avrdude -P COM3 -b 19200 -c avrisp -p m328p -n
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.17s
avrdude: Device signature = 0x1e950f
avrdude: safemode: Fuses OK
avrdude done.  Thank you.


2) SS->RESET connection broken
Code: [Select]
c:\>avrdude -P COM3 -b 19200 -c avrisp -p m328p -n
avrdude: stk500_program_enable(): protocol error, expect=0x14, resp=0x50
avrdude: initialization failed, rc=-1
        Double check connections and try again, or use -F to override
        this check.
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51
avrdude done.  Thank you.


3) SS->RESET connection broken but -F added
Code: [Select]
c:\>avrdude -P COM3 -b 19200 -c avrisp -p m328p -n -F
avrdude: stk500_program_enable(): protocol error, expect=0x14, resp=0x50
avrdude: initialization failed, rc=-1
avrdude: AVR device initialized and ready to accept instructions
avrdude: Device signature = 0x000000
avrdude: Yikes!  [b]Invalid device signature[/b].
avrdude: Expected signature for ATMEGA328P is 1E 95 0F
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51
avrdude done.  Thank you.


Conclusion: -F does not fix anything as long as you have wrong SPI wiring and you do not get the "use -F" error message if you have good connections, excepting the case when the AVR oscillator (external) does not work or the target AVR is not powered!

riyadhalnur

avrdude kept reporting the device signature to be 1E--0B when it says it expects the signature to be 1E--06

Go Up