Fix error reporting by avr_write_byte().

Fix setting of status LEDs under various write-fail conditions.

Add a flag to indicate that a memory type requires the device to
possibly be powered off and back on after a write to it.  This is due
to a hardware problem on some Atmel devices, see:

	http://www.atmel.com/atmel/acrobat/doc1280.pdf

Add greater verbosity to the part-display code when verbose>1 to
display avrprog's encoding of the defined programming instructions.
This is primarily for debugging purposes.


Part updates:

  * add the AT90S4414 part

  * add fuse and lock bit access instructions for the AT90S1200,
    AT90S4434, and AT90S8515.

  * add the pwroff_after_write flag to the fuse bits for the AT90S2333
    and AT90S4433 parts


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@123 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
Brian S. Dean
2002-02-14 02:48:07 +00:00
parent 253015fb41
commit fa956af92c
7 changed files with 273 additions and 23 deletions

18
term.c
View File

@@ -303,7 +303,8 @@ int cmd_write(int fd, struct avrpart * p, int argc, char * argv[])
int len, maxsize;
char * memtype;
unsigned long addr, i;
char * buf;
unsigned char * buf;
unsigned char b;
int rc;
int werror;
AVRMEM * mem;
@@ -371,14 +372,23 @@ int cmd_write(int fd, struct avrpart * p, int argc, char * argv[])
rc = avr_write_byte(fd, p, mem, addr+i, buf[i]);
if (rc) {
fprintf(stderr, "%s (write): error writing 0x%02x at 0x%05lx\n",
progname, buf[i], addr+i);
fprintf(stderr, "%s (write): error writing 0x%02x at 0x%05lx, rc=%d\n",
progname, buf[i], addr+i, rc);
if (rc == -1)
fprintf(stderr,
"write operation not supported on memory type \"%s\"\n",
mem->desc);
werror = 1;
}
rc = avr_read_byte(fd, p, mem, addr+i, &b);
if (b != buf[i]) {
fprintf(stderr,
"%s (write): error writing 0x%02x at 0x%05lx cell=0x%02x\n",
progname, buf[i], addr+i, b);
werror = 1;
}
if (werror) {
LED_ON(fd, pgm->pinno[PIN_LED_ERR]);
}
@@ -446,7 +456,7 @@ int cmd_erase(int fd, struct avrpart * p, int argc, char * argv[])
int cmd_part(int fd, struct avrpart * p, int argc, char * argv[])
{
fprintf(stdout, "\n");
avr_display(stdout, p, "");
avr_display(stdout, p, "", 0);
fprintf(stdout, "\n");
return 0;