Go Down

Topic: Leonardo as ISP (Read 899 times) previous topic - next topic

G4suleg

Hello,
I broke my Leonardo card :'( I have actually one Leonardo with the original bootloader and an other one without. I tryed to fix the problem by using arduino as isp.
I build the arduinoISP program in the first one
I connect the pins reset at 10, MOSI:11, MISO:12, SCK:13 like in this picture (https://cdn.sparkfun.com/assets/3/b/d/8/1/523b53bb757b7f01268b456a.jpg)
Unfortunately this technic didn't work. I have an error message of trouble shooting.
Sorry for my English and thank you in advance for your help.

madmattd

#1
Jun 25, 2015, 09:26 pm Last Edit: Jun 25, 2015, 09:28 pm by madmattd
Include the error message please... we're all going to be guessing at the problem otherwise.


https://www.arduino.cc/en/Tutorial/ArduinoISP

Connect the grounds between the 2 Arduinos! (I see this is so in the picture, if you wired to that you are OK.)

Also, after loading the ISP sketch onto the working Leonardo, add a 10uF cap across reset and ground on the working Leonardo before burning the bootloader. (actually, I'm not sure this is needed on the Leonardo?)


Why do you think the bootloader is junk on the one Leonardo?

G4suleg

#2
Jun 25, 2015, 10:16 pm Last Edit: Jun 25, 2015, 10:18 pm by G4suleg
"Arduino : 1.6.3 (Windows 7), Carte : "Arduino Leonardo"

C:\Users\ogregoire\Documents\Arduino IDE 1.6.3\arduino-1.6.3\hardware\tools\avr/bin/avrdude -CC:\Users\ogregoire\Documents\Arduino IDE 1.6.3\arduino-1.6.3\hardware\tools\avr/etc/avrdude.conf -v -patmega32u4 -cstk500v1 -PCOM6 -b19200 -e -Ulock:w:0x3F:m -Uefuse:w:0xcb:m -Uhfuse:w:0xd8:m -Ulfuse:w:0xff:m



avrdude: Version 6.0.1, compiled on Mar 30 2015 at 14:56:06

        Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/

        Copyright (c) 2007-2009 Joerg Wunsch



        System wide configuration file is "C:\Users\ogregoire\Documents\Arduino IDE 1.6.3\arduino-1.6.3\hardware\tools\avr/etc/avrdude.conf"



        Using Port                    : COM6

        Using Programmer              : stk500v1

        Overriding Baud Rate          : 19200

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x03

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x03

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x03

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x03

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x03

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x03

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x03

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x03

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x03

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x03



avrdude done.  Thank you.



Problème de téléversement vers la carte. Voir http://www.arduino.cc/en/
Guide/Troubleshooting#upload pour suggestions."

This is the error message

They are no cap in the shematic: https://www.arduino.cc/en/uploads/Main/arduino-leonardo-schematic_3b.pdf .I don't know if i need to do that.

i think the bootloader is drunk cause i used jtagice 3 to program them and now the arduino IDE don't know him

dmjlambert

#3
Jun 26, 2015, 05:36 am Last Edit: Jun 27, 2015, 10:30 pm by dmjlambert Reason: upload better Fritzing diagram
Hi,
On some of the other Arduinos the ICSP pins are available on the ICSP header and they are duplicated on the main header pins as pins 11, 12, and 13.  This is the case with the UNO and other ATmega328-based boards.  But on the Leonardo and other ATmega32U4-based boards, the ICSP pins are ONLY on the ICSP header and they are not duplicated on the main header.  So pins 11, 12, and 13 on the Leonardo do not have anything to do with ISP programming.  

The picture you gave the link to in your first post above would be valid for using the UNO as the ISP programmer.   You need to use the ICSP headers on the programmer and target boards.    I have googled for a while and I don't really see any good diagrams showing ISP programming a Leonardo from another Leonardo, so I can understand you having this trouble.   I am uploading pictures of the wiring to this post.

You don't need to disable automatic reset on serial connection with a capacitor when using a Leonardo as ISP programmer, because it does not reset upon serial connection like ATmega328-based Arduinos do.

Open the Examples, ArduinoISP sketch in the IDE, and change this line:

#define RESET SS

to:

#define RESET 10

Upload the sketch to the programmer Leonardo (left side in the pictures).  Disconnect the Leonardo from computer.  Hook up the wiring and double check it.   Re-connect the programmer Leonardo to computer.  Make sure on the menu Tools that the board Leonardo is still selected and the port is still selected.

(edit to add) On the Tools menu for Programmer select "Arduino As ISP"

Click Tools, Burn Bootloader, and it will burn the bootloader on target Leonardo (right side of pictures).

G4suleg

#4
Jun 26, 2015, 03:25 pm Last Edit: Jun 26, 2015, 03:39 pm by G4suleg
WOW thank you for your help. It was awesome what you do for me.
But i have a probleme, it's not working for me. Have you trying to programm with this wiring? Because i had change the reset line, i upload the programm and when i try to upload the bootloader i have the same error.

If that not working i can try to do an other thing. I have an jtagice3, so i can program a new bootloader but i don't know the name of the bootloader for leonardo

dmjlambert

When I wired this and took the picture, I successfully burned the boot loader on it.  Did you successfully open, modify, and upload the ArduinoISP sketch onto the Leonardo you want to use as programmer?  On the Tools menu what do you have selected for Programmer?  Is it "Arduino As ISP" ?

The bootloader hex file is in the Arduino app files in a directory called bootloaders/Catarina.  If you look at the boards.txt file you will see a variety of info and settings the IDE uses to communicate with and compile for the Leonardo, and the exact name of the bootloader file is in there.

G4suleg

Strange, i do all what you tell me.

I tryed your second purpose and it's working. So if an other person have the same problem he just need to read the boards.txt file.

THANK YOU dmjlambert

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy