mirror of
https://github.com/mariusgreuel/avrdude.git
synced 2025-12-16 18:44:17 +00:00
Submitted by Mark Litwack:
patch #6261: avrdude won't use dragon/debugwire to write a file to eeprom * jtagmkII.c (jtagmkII_paged_write): when in debugWire mode, implement a paged write to EEPROM as a series of byte writes. git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@792 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
20
jtagmkII.c
20
jtagmkII.c
@@ -1534,13 +1534,25 @@ static int jtagmkII_paged_write(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
|
||||
PDATA(pgm)->flash_pageaddr = (unsigned long)-1L;
|
||||
page_size = PDATA(pgm)->flash_pagesize;
|
||||
} else if (strcmp(m->desc, "eeprom") == 0) {
|
||||
if (pgm->flag & PGM_FL_IS_DW) {
|
||||
/*
|
||||
* jtagmkII_paged_write() to EEPROM attempted while in
|
||||
* DW mode. Use jtagmkII_write_byte() instead.
|
||||
*/
|
||||
for (addr = 0; addr < n_bytes; addr++) {
|
||||
status = jtagmkII_write_byte(pgm, p, m, addr, m->buf[addr]);
|
||||
report_progress(addr, n_bytes, NULL);
|
||||
if (status < 0) {
|
||||
free(cmd);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
free(cmd);
|
||||
return n_bytes;
|
||||
}
|
||||
cmd[1] = MTYPE_EEPROM_PAGE;
|
||||
PDATA(pgm)->eeprom_pageaddr = (unsigned long)-1L;
|
||||
page_size = PDATA(pgm)->eeprom_pagesize;
|
||||
if (pgm->flag & PGM_FL_IS_DW) {
|
||||
free(cmd);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
serial_recv_timeout = 100;
|
||||
|
||||
Reference in New Issue
Block a user