bug #37441: lockbits in ATxmega + avrdude = problem

* fileio.c: replace strmcp(..., "lock") by strncmp(..., "lock", 4)
where applicable



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1338 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
Joerg Wunsch 2014-10-15 20:01:12 +00:00
parent 3d5beb40df
commit 83ff6d306d
4 changed files with 15 additions and 7 deletions

View File

@ -1,3 +1,11 @@
2014-10-15 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
bug #37441: lockbits in ATxmega + avrdude = problem
* fileio.c: replace strmcp(..., "lock") by strncmp(..., "lock", 4)
where applicable
* jtag3.c: (Dito.)
* jtagmkII.c: (Dito.)
2014-10-07 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
bug #42267: jtag3isp fails to read lock and fuse bytes directly

View File

@ -796,7 +796,7 @@ static int elf_mem_limits(AVRMEM *mem, struct avrpart * p,
*lowbound = 0x820000;
*highbound = 0x82ffff;
*fileoff = mem->desc[4] - '0';
} else if (strcmp(mem->desc, "lock") == 0) {
} else if (strncmp(mem->desc, "lock", 4) == 0) {
*lowbound = 0x830000;
*highbound = 0x83ffff;
*fileoff = 0;

View File

@ -1034,7 +1034,7 @@ static int jtag3_initialize(PROGRAMMER * pgm, AVRPART * p)
u32_to_b4(xd.nvm_boot_offset, m->offset);
} else if (strcmp(m->desc, "fuse1") == 0) {
u32_to_b4(xd.nvm_fuse_offset, m->offset & ~7);
} else if (strcmp(m->desc, "lock") == 0) {
} else if (strncmp(m->desc, "lock", 4) == 0) {
u32_to_b4(xd.nvm_lock_offset, m->offset);
} else if (strcmp(m->desc, "usersig") == 0) {
u32_to_b4(xd.nvm_user_sig_offset, m->offset);
@ -1644,7 +1644,7 @@ static int jtag3_read_byte(PROGRAMMER * pgm, AVRPART * p, AVRMEM * mem,
addr = 2;
if (pgm->flag & PGM_FL_IS_DW)
unsupp = 1;
} else if (strcmp(mem->desc, "lock") == 0) {
} else if (strncmp(mem->desc, "lock", 4) == 0) {
cmd[3] = MTYPE_LOCK_BITS;
if (pgm->flag & PGM_FL_IS_DW)
unsupp = 1;
@ -1797,7 +1797,7 @@ static int jtag3_write_byte(PROGRAMMER * pgm, AVRPART * p, AVRMEM * mem,
cmd[3] = MTYPE_USERSIG;
} else if (strcmp(mem->desc, "prodsig") == 0) {
cmd[3] = MTYPE_PRODSIG;
} else if (strcmp(mem->desc, "lock") == 0) {
} else if (strncmp(mem->desc, "lock", 4) == 0) {
cmd[3] = MTYPE_LOCK_BITS;
if (pgm->flag & PGM_FL_IS_DW)
unsupp = 1;

View File

@ -1053,7 +1053,7 @@ static void jtagmkII_set_xmega_params(PROGRAMMER * pgm, AVRPART * p)
u32_to_b4(sendbuf.dd.nvm_boot_offset, m->offset);
} else if (strcmp(m->desc, "fuse1") == 0) {
u32_to_b4(sendbuf.dd.nvm_fuse_offset, m->offset & ~7);
} else if (strcmp(m->desc, "lock") == 0) {
} else if (strncmp(m->desc, "lock", 4) == 0) {
u32_to_b4(sendbuf.dd.nvm_lock_offset, m->offset);
} else if (strcmp(m->desc, "usersig") == 0) {
u32_to_b4(sendbuf.dd.nvm_user_sig_offset, m->offset);
@ -2250,7 +2250,7 @@ static int jtagmkII_read_byte(PROGRAMMER * pgm, AVRPART * p, AVRMEM * mem,
addr = 2;
if (pgm->flag & PGM_FL_IS_DW)
unsupp = 1;
} else if (strcmp(mem->desc, "lock") == 0) {
} else if (strncmp(mem->desc, "lock", 4) == 0) {
cmd[1] = MTYPE_LOCK_BITS;
if (pgm->flag & PGM_FL_IS_DW)
unsupp = 1;
@ -2429,7 +2429,7 @@ static int jtagmkII_write_byte(PROGRAMMER * pgm, AVRPART * p, AVRMEM * mem,
cmd[1] = MTYPE_USERSIG;
} else if (strcmp(mem->desc, "prodsig") == 0) {
cmd[1] = MTYPE_PRODSIG;
} else if (strcmp(mem->desc, "lock") == 0) {
} else if (strncmp(mem->desc, "lock", 4) == 0) {
cmd[1] = MTYPE_LOCK_BITS;
if (pgm->flag & PGM_FL_IS_DW)
unsupp = 1;