avrdude-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avrdude-dev] avrdude 4.4.0 butterfly patch


From: Matthew Gream
Subject: [avrdude-dev] avrdude 4.4.0 butterfly patch
Date: Tue, 27 Jul 2004 12:38:56 +0100

Hello,

I found that avrdude 4.4.0 release under Windows XP Professional SP1 fails
to reliably connect to Butterfly. Bootloader is native Atmel (reported by
avrdude as id AVRBOOTw, type S, sw-ver 2.0, hw-ver n/a, dev code 0x75).

The following patch rectified the problem: caveat emptor.

Matthew


--- ../avrdude-4.4.0/butterfly.c        2004-07-19 06:16:15.000000000 +0100
+++ butterfly.c 2004-07-27 12:18:01.000000000 +0100
@@ -213,16 +213,23 @@
 
   no_show_func_info();
 
-  /* send some ESC to activate butterfly bootloader */
-  butterfly_send(pgm, "\033\033\033\033", 4);
-  butterfly_drain(pgm, 0);
-
-  /* Get the programmer identifier. Programmer returns exactly 7 chars
-     _without_ the null.*/
-
-  butterfly_send(pgm, "S", 1);
-  memset (id, 0, sizeof(id));
-  butterfly_recv(pgm, id, sizeof(id)-1);
+  /* send ESC to activate butterfly bootloader &&
+     get the programmer identifier. Programmer returns exactly 7 chars
+     _without_ the null. */
+
+  fprintf(stderr, "Connecting to programmer: ");
+  do {
+    fprintf(stderr, ".");
+    butterfly_send(pgm, "\033", 1);
+    butterfly_drain(pgm, 0);
+    butterfly_send(pgm, "S", 1);
+    butterfly_recv(pgm, &c, 1);
+    if (c != '?') {
+      id[0] = c;
+      butterfly_recv(pgm, &id[1], sizeof(id)-2);
+    }
+  } while (c == '?');
+  fprintf(stderr, "\n");
 
   /* Get the HW and SW versions to see if the programmer is present. */


 
regards,
Matthew Gream

London W2 4PS
+44 77 6969 0248
address@hidden
http://matthewgream.net







reply via email to

[Prev in Thread] Current Thread [Next in Thread]