diff --git a/ChangeLog b/ChangeLog index 50695fd6..aba06037 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2012-12-18 Joerg Wunsch + + bug #37942: Latest SVN can't program in dragon_jtag mode + * jtagmkII.c (jtagmkII_initialize): For Xmega devices, and + firmware >= 7.x, don't trigger a RESET, in order to work around a + firmware bug that appears to be present in at least firmware 7.24 + for the Dragon. + 2012-12-04 Joerg Wunsch * config_gram.y: Implement the "ocdrev" keyword diff --git a/NEWS b/NEWS index 9b9147da..f6bee577 100644 --- a/NEWS +++ b/NEWS @@ -68,6 +68,7 @@ Current: - bug #30756: When setting SUT to 64ms on XMEGA, avrdude doesn't read device signature - bug #37265: wrong page sizes for XMega64xx in avrdude.conf + - bug #37942: Latest SVN can't program in dragon_jtag mode * Keep track of input file contents diff --git a/jtagmkII.c b/jtagmkII.c index 12f61aba..f652de19 100644 --- a/jtagmkII.c +++ b/jtagmkII.c @@ -1435,8 +1435,22 @@ static int jtagmkII_initialize(PROGRAMMER * pgm, AVRPART * p) } PDATA(pgm)->flash_pageaddr = PDATA(pgm)->eeprom_pageaddr = (unsigned long)-1L; - if (jtagmkII_reset(pgm, 0x01) < 0) - return -1; + if (PDATA(pgm)->fwver >= 0x700 && (p->flags & AVRPART_HAS_PDI)) { + /* + * Work around for + * https://savannah.nongnu.org/bugs/index.php?37942 + * + * Firmware version 7.24 (at least) on the Dragon behaves very + * strange when it gets a RESET request here. All subsequent + * responses are completely off, so the emulator becomes unusable. + * This appears to be a firmware bug (earlier versions, at least + * 7.14, didn't experience this), but by omitting the RESET for + * Xmega devices, we can work around it. + */ + } else { + if (jtagmkII_reset(pgm, 0x01) < 0) + return -1; + } if ((pgm->flag & PGM_FL_IS_JTAG) && !(p->flags & AVRPART_HAS_PDI)) { strcpy(hfuse.desc, "hfuse");