Merge pull request #895 from janegilruud/bugfix/fix-cnano-updi-flash-read

For UPDI devices do not add offset when accessing flash.
This commit is contained in:
Jörg Wunsch 2022-03-01 23:26:11 +01:00 committed by GitHub
commit ebb1849724
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -1265,7 +1265,7 @@ static int jtag3_initialize(PROGRAMMER * pgm, AVRPART * p)
"xd->flash_page_size=%x\n\t"
"xd->eeprom_page_size=%x\n\t"
"xd->nvmctrl=%x %x\n\t"
"xd->ocd=%x %x\n\t",
"xd->ocd=%x %x\n\t"
"xd->address_mode=%x\n",
xd.prog_base_msb,
xd.prog_base[0], xd.prog_base[1],
@ -2465,7 +2465,10 @@ static unsigned int jtag3_memaddr(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m, uns
* Non-Xmega device.
*/
if (p->flags & AVRPART_HAS_UPDI) {
if (m->size == 1) {
if (strcmp(m->desc, "flash") == 0) {
return addr;
}
else if (m->size == 1) {
addr = m->offset;
}
else if (m->size > 1) {