This is patch #3277 which appears to fix a number of issues with the

avr910 programmer.

Original Submission: The attached patch against avrdude 4.4.0 fixes
the following problems with paged writes in avr910.c:

  - failure to re-set address after page writes;
  - no polling or delay after page writes;
  - no page writes when not using auto-increment;
  - an extraneous page write when data ends on page boundary.

Submitted by: "Nic" <avrdude@schraudolph.org>


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@510 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
bdean 2005-09-18 00:28:19 +00:00
parent 204bdeb080
commit 5fb877f403
1 changed files with 11 additions and 5 deletions

View File

@ -358,7 +358,7 @@ static int avr910_read_byte_flash(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
if ((addr & 0x01) == 0) {
*value = buf[1];
cached = 1;
// cached = 1;
cvalue = buf[0];
caddr = addr;
}
@ -421,21 +421,25 @@ static int avr910_paged_write_flash(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
addr++;
page_bytes--;
if ((has_auto_incr_addr != 'Y') && ((addr & 0x01) == 0)) {
avr910_set_addr(pgm, addr>>1);
}
else if (m->paged && (page_bytes == 0)) {
if (m->paged && (page_bytes == 0)) {
/* Send the "Issue Page Write" if we have sent a whole page. */
avr910_set_addr(pgm, page_addr>>1);
avr910_send(pgm, "m", 1);
avr910_vfy_cmd_sent(pgm, "flush page");
page_wr_cmd_pending = 0;
usleep(m->max_write_delay);
avr910_set_addr(pgm, addr>>1);
/* Set page address for next page. */
page_addr = addr;
page_bytes = page_size;
}
else if ((has_auto_incr_addr != 'Y') && ((addr & 0x01) == 0)) {
avr910_set_addr(pgm, addr>>1);
}
report_progress (addr, max_addr, NULL);
}
@ -447,6 +451,7 @@ static int avr910_paged_write_flash(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
avr910_set_addr(pgm, page_addr>>1);
avr910_send(pgm, "m", 1);
avr910_vfy_cmd_sent(pgm, "flush final page");
usleep(m->max_write_delay);
}
return addr;
@ -468,6 +473,7 @@ static int avr910_paged_write_eeprom(PROGRAMMER * pgm, AVRPART * p,
cmd[1] = m->buf[addr];
avr910_send(pgm, cmd, sizeof(cmd));
avr910_vfy_cmd_sent(pgm, "write byte");
usleep(m->max_write_delay);
addr++;