Thu 09 May 2013 03:32:48 PM UTC, comment #2:
Exactly the same bug as in butterfly (AVR109).
The 'A' command must send the address in word offset, it is currently sent in byte offset.
For instance with a 128 bytes buffer, avrdude send:
A 00 00
A 00 80
A 01 00
A 01 80
etc
each command followed by 128 bytes of data.
This is wrong, the correct offset is:
A 00 00
A 00 40
A 00 80
A 00 C0
etc
in butterfly.c in the butterfly_set_addr() function, I added a:
addr = addr >> 1;
and bam, it works (for flash)
You have not detected the problem before because of another bug:
Boot loader support auto-increment, so avrdude years ago was sending a simple "A 00 00" and the bootloader was auto-incrementing the address. Something has changed since revision 1007, the big "Mega-commit to bring in memory tagging."
I checked out revision 1006, bootstrap/configure/make/test everything works fine with AVR109
I checked out revision 1007, bootstrap/configure/make/test
AVR109 fails
The code also check for auto-incrementing command 'a' but does not care by after and always send an 'A' command, it should not, it's not efficient.
|