Remove 'in sigrow' attribute from some signature/calibration memories

This commit is contained in:
Stefan Rueger
2024-06-16 15:38:59 +01:00
parent 26d1753c9e
commit 0e61f33739
2 changed files with 13 additions and 2 deletions

View File

@@ -1569,8 +1569,8 @@ Memtable avr_mem_order[100] = {
{"lockbits", MEM_LOCK},
{"prodsig", MEM_SIGROW | MEM_IN_SIGROW | MEM_READONLY},
{"sigrow", MEM_SIGROW | MEM_IN_SIGROW | MEM_READONLY},
{"signature", MEM_SIGNATURE | MEM_IN_SIGROW | MEM_READONLY},
{"calibration", MEM_CALIBRATION | MEM_IN_SIGROW | MEM_READONLY},
{"signature", MEM_SIGNATURE | MEM_IN_SIGROW | MEM_READONLY}, // Not in SIGROW in Classic/XMEGA parts
{"calibration", MEM_CALIBRATION | MEM_IN_SIGROW | MEM_READONLY}, // Not in SIGROW in Classic parts
{"tempsense", MEM_TEMPSENSE | MEM_IN_SIGROW | MEM_READONLY},
{"sernum", MEM_SERNUM | MEM_IN_SIGROW | MEM_READONLY},
{"osccal16", MEM_OSCCAL16 | MEM_IN_SIGROW | MEM_READONLY},

View File

@@ -367,8 +367,19 @@ part_def :
m->num_pages = m->size / m->page_size;
}
// Remove MEM_IN_SIGROW attribute from classic calibration and classic/XMEGA signature mem
if(!(current_part->prog_modes & (PM_PDI|PM_UPDI))) {
if(mem_is_signature(m))
m->type &= ~MEM_IN_SIGROW;
if(mem_is_calibration(m))
m->type &= ~MEM_IN_SIGROW;
} else if(current_part->prog_modes & PM_PDI) {
if(mem_is_signature(m))
m->type &= ~MEM_IN_SIGROW;
}
if(fileio_mem_offset(current_part, m) == -1U)
yywarning("revise fileio_mem_offset(), avrdude.conf entry or memory type assignment");
}
existing_part = locate_part(part_list, current_part->id);