Merge pull request #863 from MCUdude/jtag3-read-memory-alias

Add support for reading from more memory sections
This commit is contained in:
Jörg Wunsch 2022-02-10 20:35:06 +01:00 committed by GitHub
commit ba314f23e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 7 deletions

View File

@ -1968,6 +1968,18 @@ static int jtag3_read_byte(PROGRAMMER * pgm, AVRPART * p, AVRMEM * mem,
cmd[3] = MTYPE_USERSIG; cmd[3] = MTYPE_USERSIG;
} else if (strcmp(mem->desc, "prodsig") == 0) { } else if (strcmp(mem->desc, "prodsig") == 0) {
cmd[3] = MTYPE_PRODSIG; cmd[3] = MTYPE_PRODSIG;
} else if (strcmp(mem->desc, "sernum") == 0) {
cmd[3] = MTYPE_SIGN_JTAG;
} else if (strcmp(mem->desc, "osccal16") == 0) {
cmd[3] = MTYPE_SIGN_JTAG;
} else if (strcmp(mem->desc, "osccal20") == 0) {
cmd[3] = MTYPE_SIGN_JTAG;
} else if (strcmp(mem->desc, "tempsense") == 0) {
cmd[3] = MTYPE_SIGN_JTAG;
} else if (strcmp(mem->desc, "osc16err") == 0) {
cmd[3] = MTYPE_SIGN_JTAG;
} else if (strcmp(mem->desc, "osc20err") == 0) {
cmd[3] = MTYPE_SIGN_JTAG;
} else if (strcmp(mem->desc, "calibration") == 0) { } else if (strcmp(mem->desc, "calibration") == 0) {
cmd[3] = MTYPE_OSCCAL_BYTE; cmd[3] = MTYPE_OSCCAL_BYTE;
if (pgm->flag & PGM_FL_IS_DW) if (pgm->flag & PGM_FL_IS_DW)
@ -2440,13 +2452,10 @@ static unsigned int jtag3_memaddr(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m, uns
* Non-Xmega device. * Non-Xmega device.
*/ */
if (p->flags & AVRPART_HAS_UPDI) { if (p->flags & AVRPART_HAS_UPDI) {
if (strcmp(m->desc, "fuses") == 0) { if (m->size == 1) {
addr += m->offset;
}
else if (matches(m->desc, "fuse")) {
addr = m->offset; addr = m->offset;
} }
else if (strcmp(m->desc, "flash") != 0) { else if (m->size > 1) {
addr += m->offset; addr += m->offset;
} }
} }