bug #30451: Accessing some Xmega memory sections gives not

supported error
* stk500v2.c: Handle all Xmega memory sections (except
"prodsig" which is not documented in AVR079)
* fileio.c: Treat the "boot", "application", and "apptable"
regions (which are actually subregions of "flash") all as
being flash, i.e. suppress trailing 0xFF bytes when reading
them
* avr.c: (Dito.)



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1075 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
Joerg Wunsch 2012-03-29 14:32:18 +00:00
parent 3fdeef1f16
commit 0025747234
5 changed files with 42 additions and 11 deletions

View File

@ -1,3 +1,15 @@
2012-03-29 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
bug #30451: Accessing some Xmega memory sections gives not
supported error
* stk500v2.c: Handle all Xmega memory sections (except
"prodsig" which is not documented in AVR079)
* fileio.c: Treat the "boot", "application", and "apptable"
regions (which are actually subregions of "flash") all as
being flash, i.e. suppress trailing 0xFF bytes when reading
them
* avr.c: (Dito.)
2012-03-20 Joerg Wunsch <j.gnu@uriah.heep.sax.de> 2012-03-20 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
* jtagmkII.c (jtagmkII_close): The GO command before signing off * jtagmkII.c (jtagmkII_close): The GO command before signing off

2
NEWS
View File

@ -55,6 +55,8 @@ Current:
- bug #34518: loading intel hex files > 64k using record-type 4 - bug #34518: loading intel hex files > 64k using record-type 4
(Extended Linear Address Record) (Extended Linear Address Record)
- bug #34027: avrdude AT90S1200 Problem - bug #34027: avrdude AT90S1200 Problem
- bug #30451: Accessing some Xmega memory sections gives not
supported error
* Keep track of input file contents * Keep track of input file contents

10
avr.c
View File

@ -302,7 +302,10 @@ int avr_read(PROGRAMMER * pgm, AVRPART * p, char * memtype,
report_progress(pageaddr, mem->size, NULL); report_progress(pageaddr, mem->size, NULL);
} }
if (!failure) { if (!failure) {
if (strcasecmp(mem->desc, "flash") == 0) if (strcasecmp(mem->desc, "flash") == 0 ||
strcasecmp(mem->desc, "application") == 0 ||
strcasecmp(mem->desc, "apptable") == 0 ||
strcasecmp(mem->desc, "boot") == 0)
return avr_mem_hiaddr(mem); return avr_mem_hiaddr(mem);
else else
return mem->size; return mem->size;
@ -333,7 +336,10 @@ int avr_read(PROGRAMMER * pgm, AVRPART * p, char * memtype,
report_progress(i, mem->size, NULL); report_progress(i, mem->size, NULL);
} }
if (strcasecmp(mem->desc, "flash") == 0) if (strcasecmp(mem->desc, "flash") == 0 ||
strcasecmp(mem->desc, "application") == 0 ||
strcasecmp(mem->desc, "apptable") == 0 ||
strcasecmp(mem->desc, "boot") == 0)
return avr_mem_hiaddr(mem); return avr_mem_hiaddr(mem);
else else
return i; return i;

View File

@ -1539,7 +1539,10 @@ int fileio(int op, char * filename, FILEFMT format,
} }
if (rc > 0) { if (rc > 0) {
if ((op == FIO_READ) && (strcasecmp(mem->desc, "flash") == 0)) { if ((op == FIO_READ) && (strcasecmp(mem->desc, "flash") == 0 ||
strcasecmp(mem->desc, "application") == 0 ||
strcasecmp(mem->desc, "apptable") == 0 ||
strcasecmp(mem->desc, "boot") == 0)) {
/* /*
* if we are reading flash, just mark the size as being the * if we are reading flash, just mark the size as being the
* highest non-0xff byte * highest non-0xff byte

View File

@ -3166,13 +3166,15 @@ static int stk600_xprog_write_byte(PROGRAMMER * pgm, AVRPART * p, AVRMEM * mem,
memset(b, 0, sizeof(b)); memset(b, 0, sizeof(b));
if (strcmp(mem->desc, "flash") == 0) { if (strcmp(mem->desc, "flash") == 0 ||
strcmp(mem->desc, "application") == 0 ||
strcmp(mem->desc, "apptable") == 0) {
memcode = XPRG_MEM_TYPE_APPL; memcode = XPRG_MEM_TYPE_APPL;
} else if (strcmp(mem->desc, "boot") == 0) { } else if (strcmp(mem->desc, "boot") == 0) {
memcode = XPRG_MEM_TYPE_BOOT; memcode = XPRG_MEM_TYPE_BOOT;
} else if (strcmp(mem->desc, "eeprom") == 0) { } else if (strcmp(mem->desc, "eeprom") == 0) {
memcode = XPRG_MEM_TYPE_EEPROM; memcode = XPRG_MEM_TYPE_EEPROM;
} else if (strcmp(mem->desc, "lockbits") == 0) { } else if (strncmp(mem->desc, "lock", strlen("lock")) == 0) {
memcode = XPRG_MEM_TYPE_LOCKBITS; memcode = XPRG_MEM_TYPE_LOCKBITS;
} else if (strncmp(mem->desc, "fuse", strlen("fuse")) == 0) { } else if (strncmp(mem->desc, "fuse", strlen("fuse")) == 0) {
memcode = XPRG_MEM_TYPE_FUSE; memcode = XPRG_MEM_TYPE_FUSE;
@ -3242,7 +3244,9 @@ static int stk600_xprog_read_byte(PROGRAMMER * pgm, AVRPART * p, AVRMEM * mem,
{ {
unsigned char b[8]; unsigned char b[8];
if (strcmp(mem->desc, "flash") == 0) { if (strcmp(mem->desc, "flash") == 0 ||
strcmp(mem->desc, "application") == 0 ||
strcmp(mem->desc, "apptable") == 0) {
b[1] = XPRG_MEM_TYPE_APPL; b[1] = XPRG_MEM_TYPE_APPL;
} else if (strcmp(mem->desc, "boot") == 0) { } else if (strcmp(mem->desc, "boot") == 0) {
b[1] = XPRG_MEM_TYPE_BOOT; b[1] = XPRG_MEM_TYPE_BOOT;
@ -3252,7 +3256,7 @@ static int stk600_xprog_read_byte(PROGRAMMER * pgm, AVRPART * p, AVRMEM * mem,
b[1] = XPRG_MEM_TYPE_APPL; b[1] = XPRG_MEM_TYPE_APPL;
} else if (strncmp(mem->desc, "fuse", strlen("fuse")) == 0) { } else if (strncmp(mem->desc, "fuse", strlen("fuse")) == 0) {
b[1] = XPRG_MEM_TYPE_FUSE; b[1] = XPRG_MEM_TYPE_FUSE;
} else if (strcmp(mem->desc, "lockbits") == 0) { } else if (strncmp(mem->desc, "lock", strlen("lock")) == 0) {
b[1] = XPRG_MEM_TYPE_LOCKBITS; b[1] = XPRG_MEM_TYPE_LOCKBITS;
} else if (strcmp(mem->desc, "calibration") == 0) { } else if (strcmp(mem->desc, "calibration") == 0) {
b[1] = XPRG_MEM_TYPE_FACTORY_CALIBRATION; b[1] = XPRG_MEM_TYPE_FACTORY_CALIBRATION;
@ -3306,7 +3310,9 @@ static int stk600_xprog_paged_load(PROGRAMMER * pgm, AVRPART * p, AVRMEM * mem,
* This is probably what AVR079 means when writing about the * This is probably what AVR079 means when writing about the
* "TIF address space". * "TIF address space".
*/ */
if (strcmp(mem->desc, "flash") == 0) { if (strcmp(mem->desc, "flash") == 0 ||
strcmp(mem->desc, "application") == 0 ||
strcmp(mem->desc, "apptable") == 0) {
memtype = XPRG_MEM_TYPE_APPL; memtype = XPRG_MEM_TYPE_APPL;
if (mem->size > 64 * 1024) if (mem->size > 64 * 1024)
use_ext_addr = (1UL << 31); use_ext_addr = (1UL << 31);
@ -3322,7 +3328,7 @@ static int stk600_xprog_paged_load(PROGRAMMER * pgm, AVRPART * p, AVRMEM * mem,
memtype = XPRG_MEM_TYPE_APPL; memtype = XPRG_MEM_TYPE_APPL;
} else if (strncmp(mem->desc, "fuse", strlen("fuse")) == 0) { } else if (strncmp(mem->desc, "fuse", strlen("fuse")) == 0) {
memtype = XPRG_MEM_TYPE_FUSE; memtype = XPRG_MEM_TYPE_FUSE;
} else if (strcmp(mem->desc, "lockbits") == 0) { } else if (strncmp(mem->desc, "lock", strlen("lock")) == 0) {
memtype = XPRG_MEM_TYPE_LOCKBITS; memtype = XPRG_MEM_TYPE_LOCKBITS;
} else if (strcmp(mem->desc, "calibration") == 0) { } else if (strcmp(mem->desc, "calibration") == 0) {
memtype = XPRG_MEM_TYPE_FACTORY_CALIBRATION; memtype = XPRG_MEM_TYPE_FACTORY_CALIBRATION;
@ -3406,7 +3412,9 @@ static int stk600_xprog_paged_write(PROGRAMMER * pgm, AVRPART * p, AVRMEM * mem,
* This is probably what AVR079 means when writing about the * This is probably what AVR079 means when writing about the
* "TIF address space". * "TIF address space".
*/ */
if (strcmp(mem->desc, "flash") == 0) { if (strcmp(mem->desc, "flash") == 0 ||
strcmp(mem->desc, "application") == 0 ||
strcmp(mem->desc, "apptable") == 0) {
memtype = XPRG_MEM_TYPE_APPL; memtype = XPRG_MEM_TYPE_APPL;
writemode = (1 << XPRG_MEM_WRITE_WRITE); writemode = (1 << XPRG_MEM_WRITE_WRITE);
if (mem->size > 64 * 1024) if (mem->size > 64 * 1024)
@ -3427,7 +3435,7 @@ static int stk600_xprog_paged_write(PROGRAMMER * pgm, AVRPART * p, AVRMEM * mem,
} else if (strncmp(mem->desc, "fuse", strlen("fuse")) == 0) { } else if (strncmp(mem->desc, "fuse", strlen("fuse")) == 0) {
memtype = XPRG_MEM_TYPE_FUSE; memtype = XPRG_MEM_TYPE_FUSE;
writemode = (1 << XPRG_MEM_WRITE_WRITE); writemode = (1 << XPRG_MEM_WRITE_WRITE);
} else if (strcmp(mem->desc, "lockbits") == 0) { } else if (strncmp(mem->desc, "lock", strlen("lock")) == 0) {
memtype = XPRG_MEM_TYPE_LOCKBITS; memtype = XPRG_MEM_TYPE_LOCKBITS;
writemode = (1 << XPRG_MEM_WRITE_WRITE); writemode = (1 << XPRG_MEM_WRITE_WRITE);
} else if (strcmp(mem->desc, "calibration") == 0) { } else if (strcmp(mem->desc, "calibration") == 0) {