Skip to content

Commit

Permalink
Try to run ChipErase on UPDI even if return code is -67
Browse files Browse the repository at this point in the history
More details in arduino/ArduinoCore-megaavr#33 (comment)


Co-authored-by: Martino Facchin <[email protected]>
  • Loading branch information
umbynos and facchinm committed May 31, 2022
1 parent 0972185 commit f0eadba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1118,7 +1118,7 @@ int main(int argc, char * argv [])
rc = avr_signature(pgm, p);
if (rc != 0) {
// -68 == -(0x44) == -(RSP3_FAIL_OCD_LOCKED)
if ((rc == -68) && (p->flags & AVRPART_HAS_UPDI) && (attempt < 1)) {
if ((rc == -68 || rc == -67) && (p->flags & AVRPART_HAS_UPDI) && (attempt < 1)) {
attempt++;
if (pgm->read_sib) {
// Read SIB and compare FamilyID
Expand Down

0 comments on commit f0eadba

Please sign in to comment.