Try jtag page erase for classic part usersig memory

This commit is contained in:
Stefan Rueger
2023-07-13 21:14:28 +01:00
parent 7967c2f808
commit 4e2f704c62
2 changed files with 9 additions and 7 deletions

View File

@@ -1474,8 +1474,9 @@ static void jtag3_disable(const PROGRAMMER *pgm) {
}
static void jtag3_enable(PROGRAMMER *pgm, const AVRPART *p) {
if(!(p->prog_modes & (PM_PDI | PM_UPDI)))
pgm->page_erase = NULL;
// pgm->erase might be useful for usersig
// if(!(p->prog_modes & (PM_PDI | PM_UPDI)))
// pgm->page_erase = NULL;
return;
}
@@ -1833,7 +1834,7 @@ static int jtag3_page_erase(const PROGRAMMER *pgm, const AVRPART *p, const AVRME
pmsg_notice2("jtag3_page_erase(.., %s, 0x%x)\n", m->desc, addr);
if (!(p->prog_modes & (PM_PDI | PM_UPDI))) {
if(!(p->prog_modes & (PM_PDI | PM_UPDI)) && !str_eq(m->desc, "usersig")) {
pmsg_error("page erase not supported\n");
return -1;
}

View File

@@ -1373,8 +1373,9 @@ static void jtagmkII_disable(const PROGRAMMER *pgm) {
static void jtagmkII_enable(PROGRAMMER *pgm, const AVRPART *p) {
// Unset page_erase when part or programmer not capable of it
if(!(p->prog_modes & (PM_PDI | PM_UPDI)))
pgm->page_erase = NULL;
// BUT might be useful for classic part usersig memory
// if(!(p->prog_modes & (PM_PDI | PM_UPDI)))
// pgm->page_erase = NULL;
if(pgm->flag & PGM_FL_IS_DW)
pgm->page_erase = NULL;
@@ -1835,8 +1836,8 @@ static int jtagmkII_page_erase(const PROGRAMMER *pgm, const AVRPART *p, const AV
pmsg_notice2("jtagmkII_page_erase(.., %s, 0x%x)\n", m->desc, addr);
if (!(p->prog_modes & (PM_PDI | PM_UPDI))) {
pmsg_error("not an Xmega nor a UPDI device\n");
if (!(p->prog_modes & (PM_PDI | PM_UPDI)) && !str_eq(m->desc, "usersig")) {
pmsg_error("not an Xmega nor a UPDI device nor classic part usersig memory\n");
return -1;
}
if ((pgm->flag & PGM_FL_IS_DW)) {