mirror of
https://github.com/avrdudes/avrdude.git
synced 2026-09-21 08:36:29 +03:00
Invalidate cache in stk500v2_paged_write()
Bytewise access uses a cache, but paged access doesn't so must invalidate the cache when writing a page - otherwise mixing bytewise and paged access is bound to fail.
This commit is contained in:
@@ -2724,6 +2724,7 @@ static int stk500v2_paged_write(const PROGRAMMER *pgm, const AVRPART *p, const A
|
||||
// determine which command is to be used
|
||||
if (strcmp(m->desc, "flash") == 0) {
|
||||
addrshift = 1;
|
||||
PDATA(pgm)->flash_pageaddr = -1UL; // Invalidate cache
|
||||
commandbuf[0] = CMD_PROGRAM_FLASH_ISP;
|
||||
/*
|
||||
* If bit 31 is set, this indicates that the following read/write
|
||||
@@ -2735,6 +2736,7 @@ static int stk500v2_paged_write(const PROGRAMMER *pgm, const AVRPART *p, const A
|
||||
use_ext_addr = (1U << 31);
|
||||
}
|
||||
} else if (strcmp(m->desc, "eeprom") == 0) {
|
||||
PDATA(pgm)->eeprom_pageaddr = -1UL; // Invalidate cache
|
||||
commandbuf[0] = CMD_PROGRAM_EEPROM_ISP;
|
||||
}
|
||||
commandbuf[4] = m->delay;
|
||||
|
||||
Reference in New Issue
Block a user