Always use paged access for programmers that serve bootloaders

This commit is contained in:
Stefan Rueger 2022-10-21 00:56:43 +01:00
parent b864d7e73a
commit b9396bcd02
No known key found for this signature in database
GPG Key ID: B0B4F1FD86B1EC55
1 changed files with 6 additions and 3 deletions

View File

@ -377,8 +377,9 @@ int avr_read_mem(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *mem, con
return avr_mem_hiaddr(mem);
}
if (pgm->paged_load != NULL && mem->page_size > 1 &&
mem->size % mem->page_size == 0) {
// HW programmers need a page size > 1, bootloader typ only offer paged r/w
if ((pgm->paged_load && mem->page_size > 1 && mem->size % mem->page_size == 0) ||
((pgm->prog_modes & PM_SPM) && avr_has_paged_access(pgm, mem))) {
/*
* the programmer supports a paged mode read
*/
@ -894,7 +895,9 @@ int avr_write_mem(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *m, int
return i;
}
if (pgm->paged_write != NULL && m->page_size > 1) {
// HW programmers need a page size > 1, bootloader typ only offer paged r/w
if ((pgm->paged_load && m->page_size > 1 && m->size % m->page_size == 0) ||
((pgm->prog_modes & PM_SPM) && avr_has_paged_access(pgm, m))) {
/*
* the programmer supports a paged mode write
*/