mirror of
https://github.com/mariusgreuel/avrdude.git
synced 2025-12-13 17:34:56 +00:00
Submitted by Jan Egil Ruud <janegil.ruud@microchip.com>
patch #9507: Fix UPDI chip erase * lexer.l (family_id): New keyword. * config_gram.y: (Ditto) * doc/avrdude.texi: Document new keyword * avrdude.conf.in: Add family_id for avr8x devices * avr.c: Pass error code up. * jtag3.c: Pass error code from memory read up; implement jtag3_read_sib() * libavrdude.h: Add new items. * main.c: Implement different chip erase handling required for UPDI devices. Submitted by Jan Egil Ruud <janegil.ruud@microchip.com> patch #9506: Script to create device configuration stub from Atmel ATDF files * avrdude.conf.in (ATtiny202, ATtiny204, ATtiny402, ATtiny404) (ATtiny406, ATtiny804, ATtiny806, ATtiny807, ATtiny1604) (ATtiny1606, ATtiny1607, ATtiny212, ATtiny214, ATtiny412) (ATTiny414, ATtiny416, ATtiny417, ATtiny814, ATtiny816) (ATtiny1614, ATtiny1616, ATtiny3214, ATtiny3216, ATtiny3217) (ATmega3208, ATmega3209, ATmega4808, ATmega4809): New devices git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1405 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
38
main.c
38
main.c
@@ -1045,6 +1045,44 @@ int main(int argc, char * argv [])
|
||||
if (init_ok) {
|
||||
rc = avr_signature(pgm, p);
|
||||
if (rc != 0) {
|
||||
// -68 == -(0x44) == -(RSP3_FAIL_OCD_LOCKED)
|
||||
if ((rc == -68) && (p->flags & AVRPART_HAS_UPDI) && (attempt < 1)) {
|
||||
attempt++;
|
||||
if (pgm->read_sib) {
|
||||
// Read SIB and compare FamilyID
|
||||
char sib[AVR_SIBLEN + 1];
|
||||
pgm->read_sib(pgm, p, sib);
|
||||
avrdude_message(MSG_NOTICE, "%s: System Information Block: \"%s\"\n",
|
||||
progname, sib);
|
||||
if (quell_progress < 2) {
|
||||
avrdude_message(MSG_INFO, "%s: Received FamilyID: \"%.*s\"\n", progname, AVR_FAMILYIDLEN, sib);
|
||||
}
|
||||
if (strncmp(p->family_id, sib, AVR_FAMILYIDLEN)) {
|
||||
avrdude_message(MSG_INFO, "%s: Expected FamilyID: \"%s\"\n", progname, p->family_id);
|
||||
if (!ovsigck) {
|
||||
avrdude_message(MSG_INFO, "%sDouble check chip, "
|
||||
"or use -F to override this check.\n",
|
||||
progbuf);
|
||||
exitrc = 1;
|
||||
goto main_exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(erase) {
|
||||
erase = 0;
|
||||
if (uflags & UF_NOWRITE) {
|
||||
avrdude_message(MSG_INFO, "%s: conflicting -e and -n options specified, NOT erasing chip\n",
|
||||
progname);
|
||||
} else {
|
||||
if (quell_progress < 2) {
|
||||
avrdude_message(MSG_INFO, "%s: erasing chip\n", progname);
|
||||
}
|
||||
exitrc = avr_chip_erase(pgm, p);
|
||||
if(exitrc) goto main_exit;
|
||||
goto sig_again;
|
||||
}
|
||||
}
|
||||
}
|
||||
avrdude_message(MSG_INFO, "%s: error reading signature data, rc=%d\n",
|
||||
progname, rc);
|
||||
exitrc = 1;
|
||||
|
||||
Reference in New Issue
Block a user