slaryn / optiboot

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

Optiboot on Duemilanove #21

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I upgraded my bootloader with Optiboot 0021. Bit really weird things happened.

I can use ArduinoISP program with my arduino to flash chips. But only If I use 
original Arduino bootloader. When I upgraded my arduino's MCU with optiboot 
bootloader, It cannot flash other chips with ArduinoISP.  Weird part is, my 
breadboard Atmega MCU could flash other chip while it has Optiboot 
bootloader.cross checked.

I also connected my breadboard MCU to arduino and connect arduino to this 
breadboard MCU (cross connected). Each MCU could flash other one via ArduinoISP.

Steps:
(Using different serial cable connection for BreadBoard MCU offcouse.)
1.Uploaded ArduinoISP to Arduino Duemilanove.
2. Arduino installs optiboot to BreadBoard MCU.
3. Uploaded ArduinoISP to BreadBoard MCU.
4. BreadBoard MCU installs optiboot to Arduino.
5. Uploaded ArduinoISP to Arduino Duemilanove.
6. Than Arduino couldn't flash anything with Arduino ISP (FAIL)
7. BreadBoard MCU installs original optiboot bootloader to Arduino.
8. Uploaded ArduinoISP to Arduino Duemilanove.
9. Arduino could installs any bootloader to BreadBoard MCU.

I wonder why... Really.

Original issue reported on code.google.com by erdem...@gmail.com on 10 Oct 2010 at 11:56

Attachments:

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Here the patch for the ArduinoISP sketch:

--- examples/ArduinoISP/ArduinoISP.pde  2010-12-24 23:12:25.000000000 +0100
+++ /home/bilibao/sketchbook/fixed/fixed.pde    2011-01-12 01:10:41.373212997 
+0100
@@ -54,7 +54,7 @@
   pinMode(9, OUTPUT);
   pulse(9, 2);
 }
-
+int initSent=0;
 int error=0;
 int pmode=0;
 // address for reading and writing, set by 'U' command
@@ -399,7 +399,8 @@
   uint8_t ch = getch();
   switch (ch) {
   case '0': // signon
-    empty_reply();
+    if(! initSent) empty_reply();
+    initSent = 1;
     break;
   case '1':
     if (getch() == CRC_EOP) {

Original comment by rizziand...@gmail.com on 12 Jan 2011 at 7:11

GoogleCodeExporter commented 9 years ago

Original comment by wes...@gmail.com on 29 Oct 2011 at 5:27

GoogleCodeExporter commented 9 years ago
So the theory is that ArduinoISP runs by virtue of having the bootloader 
"abort" when it sees commands at the wrong bitrate (and therefore 
illegal-looking.)  This happened with the old bootloader, but optiboot just 
ignores illegal commands (it doesn't have enough space to check for their 
"illegal-ness")
This was supposedly made better by the large code changes that went into v4.4, 
in particular:
https://github.com/WestfW/Arduino/commit/e81c1123b624b6cac7da018c9c786700f3152bc
9

But it still seems to work better if auto-reset is disabled via some hardware 
mechanism before using ArduinoISP.  The favorite seems to be a 10uF cap between 
reset and gnd of the ArduinoISP board.

Original comment by wes...@gmail.com on 4 Apr 2012 at 2:30