From 0c8b42524ee0b79475bb86249ae9a8a20f751be8 Mon Sep 17 00:00:00 2001 From: Jan Egil Ruud Date: Tue, 1 Mar 2022 14:24:33 +0100 Subject: [PATCH] For UPDI devices do not add offset when accessing flash. --- src/jtag3.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/jtag3.c b/src/jtag3.c index d61f2417..5b341a1e 100644 --- a/src/jtag3.c +++ b/src/jtag3.c @@ -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) {