Skip to content

Commit

Permalink
small fix for prodsig retrieval
Browse files Browse the repository at this point in the history
  • Loading branch information
MX682X committed Nov 29, 2024
1 parent f916ba3 commit e09370f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/pickit5.c
Original file line number Diff line number Diff line change
Expand Up @@ -523,12 +523,17 @@ static void pickit5_enable(PROGRAMMER *pgm, const AVRPART *p) {
mem->readsize = mem->size < 1024? mem->size : 1024;
}
if((mem = avr_locate_eeprom(p))) {
if (mem->mode == 0x04) {
if (mem->mode == 0x04) { // Increasing minimal write/read length so that the old AVRs work with PK5
mem->page_size = 0x04;
mem->readsize = 0x04;
mem->blocksize = 0x04;
}
}
if((mem = avr_locate_calibration(p))) {
if(mem->size == 1) { // any 1 byte wide calibration is also in prodsig
mem->offset = 1; // add an offset to profit of the prodsig buffering
}
}
}
if(both_xmegajtag(pgm, p) || both_pdi(pgm, p)) {
if((mem = avr_locate_flash(p))) {
Expand Down Expand Up @@ -908,7 +913,7 @@ static int pickit5_read_byte(const PROGRAMMER *pgm, const AVRPART *p,
} else if(is_updi(pgm)) {
rc = pickit5_updi_read_byte(pgm, p, mem, addr, value);
}
} else if(mem_is_in_sigrow(mem)) {
} else if(mem_is_in_sigrow(mem) || mem_is_calibration(mem)) { // For some weird reason this OR is needed?
rc = pickit5_read_prodsig(pgm, p, mem, addr, 1, value);
}
if(rc == 0) {
Expand Down

0 comments on commit e09370f

Please sign in to comment.