Add support for reading from more memory sections
It's now possible to read the following memories if present: osccal16, osccal20, tempsense, osc16err, osc20err
This commit is contained in:
parent
7e7c4e630e
commit
a43f220ef9
23
src/jtag3.c
23
src/jtag3.c
|
@ -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,14 +2452,11 @@ 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;
|
addr = m->offset;
|
||||||
}
|
}
|
||||||
else if (matches(m->desc, "fuse")) {
|
else if (m->size > 1) {
|
||||||
addr = m->offset;
|
addr += m->offset;
|
||||||
}
|
|
||||||
else if (strcmp(m->desc, "flash") != 0) {
|
|
||||||
addr += m->offset;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return addr;
|
return addr;
|
||||||
|
|
Loading…
Reference in New Issue