* butterfly.c (butterfly_initialize): when sending the 'T'

command (which is ignored by current AVR109 bootloaders),
send the first reply from the list of supported device
codes back rather than using avrdude.conf's idea about
an AVR910 device code.  Apparently, this solves disagreements
between different versions of at least the ATmega8 AVR910
device code.

Closes bug #18727: Writing flash failed


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@718 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
Joerg Wunsch 2007-01-11 20:20:25 +00:00
parent 3ae427df7b
commit 02c2030a64
2 changed files with 24 additions and 3 deletions

View File

@ -1,3 +1,14 @@
2007-01-11 Joerg Wunsch <j@uriah.heep.sax.de>
* butterfly.c (butterfly_initialize): when sending the 'T'
command (which is ignored by current AVR109 bootloaders),
send the first reply from the list of supported device
codes back rather than using avrdude.conf's idea about
an AVR910 device code. Apparently, this solves disagreements
between different versions of at least the ATmega8 AVR910
device code.
Closes bug #18727: Writing flash failed
2007-01-07 Joerg Wunsch <j@uriah.heep.sax.de>
Reported by Till Harbaum:

View File

@ -226,7 +226,7 @@ static int butterfly_initialize(PROGRAMMER * pgm, AVRPART * p)
char hw[2];
char buf[10];
char type;
char c;
char c, devtype_1st;
no_show_func_info();
@ -307,18 +307,28 @@ static int butterfly_initialize(PROGRAMMER * pgm, AVRPART * p)
butterfly_send(pgm, "t", 1);
fprintf(stderr, "\nProgrammer supports the following devices:\n");
devtype_1st = 0;
while (1) {
butterfly_recv(pgm, &c, 1);
if (devtype_1st == 0)
devtype_1st = c;
if (c == 0)
break;
fprintf(stderr, " Device code: 0x%02x\n", (unsigned int)(unsigned char)c);
};
fprintf(stderr,"\n");
/* Tell the programmer which part we selected. */
/* Tell the programmer which part we selected.
According to the AVR109 code, this is ignored by the bootloader. As
some early versions might not properly ignore it, rather pick up the
first device type as reported above than anything out of avrdude.conf,
so to avoid a potential conflict. There appears to be no general
agreement on AVR910 device IDs beyond the ones from the original
appnote 910. */
buf[0] = 'T';
buf[1] = p->avr910_devcode;
buf[1] = devtype_1st;
butterfly_send(pgm, buf, 2);
butterfly_vfy_cmd_sent(pgm, "select device");