Submitted by Martin Thierer:
bug #60863: avrftdi programming error probably caused by multiple, consecutive empty pages * avrftdi.c (avrftdi_flash_write): Skip empty pages git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1462 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
parent
9cf4edf76f
commit
eb461f706f
|
@ -1,3 +1,9 @@
|
|||
2021-11-07 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Martin Thierer:
|
||||
bug #60863: avrftdi programming error probably caused by multiple, consecutive empty pages
|
||||
* avrftdi.c (avrftdi_flash_write): Skip empty pages
|
||||
|
||||
2021-11-07 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||
|
||||
Submitted by Matwey V. Kornilov:
|
||||
|
|
1
NEWS
1
NEWS
|
@ -63,6 +63,7 @@ Current:
|
|||
bug #55009: no efuses for m164a/pa
|
||||
bug #55734: USBtiny programming of ATmega328p broken by Patch #9278
|
||||
bug #58495: Add atmega324pb support to avrdude.conf.in
|
||||
bug #60863: avrftdi programming error probably caused by multiple, consecutive empty pages
|
||||
|
||||
* Patches:
|
||||
patch #9482: Add support for UPDI and AVR8X
|
||||
|
|
21
avrftdi.c
21
avrftdi.c
|
@ -1045,6 +1045,15 @@ static int avrftdi_flash_write(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
|
|||
bufptr += 4;
|
||||
}
|
||||
|
||||
/* find a poll byte. we cannot poll a value of 0xff, so look
|
||||
* for a value != 0xff
|
||||
*/
|
||||
for(poll_index = addr+len-1; poll_index > addr-1; poll_index--)
|
||||
if(m->buf[poll_index] != 0xff)
|
||||
break;
|
||||
|
||||
if((poll_index < addr + len) && m->buf[poll_index] != 0xff)
|
||||
{
|
||||
buf_size = bufptr - buf;
|
||||
|
||||
if(verbose > TRACE)
|
||||
|
@ -1055,15 +1064,7 @@ static int avrftdi_flash_write(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
|
|||
return -1;
|
||||
|
||||
bufptr = buf;
|
||||
/* find a poll byte. we cannot poll a value of 0xff, so look
|
||||
* for a value != 0xff
|
||||
*/
|
||||
for(poll_index = addr+len-1; poll_index > addr-1; poll_index--)
|
||||
if(m->buf[poll_index] != 0xff)
|
||||
break;
|
||||
|
||||
if((poll_index < addr + len) && m->buf[poll_index] != 0xff)
|
||||
{
|
||||
log_info("Using m->buf[%d] = 0x%02x as polling value ", poll_index,
|
||||
m->buf[poll_index]);
|
||||
/* poll page write ready */
|
||||
|
@ -1077,9 +1078,7 @@ static int avrftdi_flash_write(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
|
|||
}
|
||||
else
|
||||
{
|
||||
log_warn("No suitable byte (!=0xff) for polling found.\n");
|
||||
log_warn("Trying to sleep instead, but programming errors may occur.\n");
|
||||
log_warn("Be sure to verify programmed memory (no -V option)\n");
|
||||
log_warn("Skipping empty page (containing only 0xff bytes)\n");
|
||||
/* TODO sync write */
|
||||
/* sleep */
|
||||
usleep((m->max_write_delay));
|
||||
|
|
Loading…
Reference in New Issue