anilgkts / arduino

Automatically exported from code.google.com/p/arduino
Other
0 stars 0 forks source link

Unintentional autoreset after uploading a sketch to a leonardo #995

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
(For more details see thread http://arduino.cc/forum/index.php/topic,108270)
1.Upload the ArduinoISP to the leonardo
2.In the IDE change the board type to another arduino into which you want to 
burn a bootloader.
3.Use the leonardo to burn a bootloader into the other arduino.

What is the expected output? 
burning the bootloader should succeed.

What do you see instead?
avrdude: stk500_getsync(): not in sync: resp=0x00

What version of the Arduino software are you using?
arduino-1.0.1 

On what operating system?  
Linux Dell4550 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:50 UTC 2011 
i686 i686 i386 GNU/Linux

Which Arduino board are you using?
Leonardo

Please provide any additional information below.

This is because the leonardo is still at the magic baudrate of 1200bps when you 
burn a bootloader to the other arduino. The IDE make two subsequent calls to 
avrdude to to burn the bootloader. At the end of the first call, avrdude 
restores the baudrate to what it was before (1200bps). Then it closes the 
serial pert whic toggles DTR. This makes the leonardo reboot. The "not in sync" 
message appears when the ide makes the second call to avrdude which tries to 
communicate with the leonardo who is still rebooting.

More detailed explanation is in message:
http://arduino.cc/forum/index.php/topic,108270.msg838797.html#msg838797

The message also explains that there is a bug independent from this one that 
prevents the ArduinoISP sketch from working on the leonardo (serial buffer 
overrun)

A possible solution is provided by pull request:
https://github.com/arduino/Arduino/pull/103

Original issue reported on code.google.com by peter.va...@belgacom.net on 29 Jul 2012 at 9:27

GoogleCodeExporter commented 9 years ago
Federico, can you look into this?  And more generally, see about getting the 
ArduinoISP sketch to work with Leonardo?

Original comment by dmel...@gmail.com on 8 Aug 2012 at 9:00

GoogleCodeExporter commented 9 years ago

Original comment by dmel...@gmail.com on 5 Sep 2012 at 1:05

GoogleCodeExporter commented 9 years ago

Original comment by dmel...@gmail.com on 5 Sep 2012 at 2:17

GoogleCodeExporter commented 9 years ago
https://github.com/arduino/Arduino/commit/5fa8cd4130504b082372467ca9ff53172de883
12
https://github.com/arduino/Arduino/commit/e2b99206d8698472a078b678b88ec9ef9c95b7
9d

Original comment by dmel...@gmail.com on 13 Sep 2012 at 12:44