patchAVR Downloader/UploaDEr - Patches: patch #9757, Fix ATtiny817 Xplained Mini...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #9757: Fix ATtiny817 Xplained Mini programmer

Submitter:  Sven <svenschwermer>
Submitted:  Fri 22 Feb 2019 04:55:14 PM UTC
   
 
Category:  None Priority:  5 - Normal
Status:  Works For Me Privacy:  Public
Assigned to:  joerg_wunsch Open/Closed:  Closed

Jump to the original submission

Tue 23 Nov 2021 10:30:30 AM UTC, comment #12: 

Just tested this:


% ./avrdude -p t817 -c xplainedmini_updi -q -C avrdude.conf -v -v

avrdude: Version 6.3-20171130
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "avrdude.conf"
         User configuration file is "/home/joerg/.avrduderc"

         Using Port                    : usb
         Using Programmer              : xplainedmini_updi
avrdude: jtag3_open_updi()
avrdude: Found CMSIS-DAP compliant device, using EDBG protocol
avrdude: Sending sign-on command: 0x80 (3 bytes msg)
         AVR Part                      : ATtiny817
         Chip Erase delay              : 0 us
         PAGEL                         : P00
         BS2                           : P00
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 0
         StabDelay                     : 0
         CmdexeDelay                   : 0
         SyncLoops                     : 0
         ByteDelay                     : 0
         PollIndex                     : 0
         PollValue                     : 0x00
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           signature      0     0     0    0 no          3    1      0     0     0 0x00 0x00
           prodsig        0     0     0    0 no         61   61      0     0     0 0x00 0x00
           fuses          0     0     0    0 no          9   10      0     0     0 0x00 0x00
           fuse0          0     0     0    0 no          1    1      0     0     0 0x00 0x00
           fuse1          0     0     0    0 no          1    1      0     0     0 0x00 0x00
           fuse2          0     0     0    0 no          1    1      0     0     0 0x00 0x00
           fuse4          0     0     0    0 no          1    1      0     0     0 0x00 0x00
           fuse5          0     0     0    0 no          1    1      0     0     0 0x00 0x00
           fuse6          0     0     0    0 no          1    1      0     0     0 0x00 0x00
           fuse7          0     0     0    0 no          1    1      0     0     0 0x00 0x00
           fuse8          0     0     0    0 no          1    1      0     0     0 0x00 0x00
           lock           0     0     0    0 no          1    1      0     0     0 0x00 0x00
           data           0     0     0    0 no          0    1      0     0     0 0x00 0x00
           usersig        0     0     0    0 no         32   32      0     0     0 0x00 0x00
           flash          0     0     0    0 no       8192   64      0     0     0 0x00 0x00
           eeprom         0     0     0    0 no        128   32      0     0     0 0x00 0x00

         Programmer Type : JTAGICE3_UPDI
         Description     : Atmel AVR XplainedMini in UPDI mode
avrdude: jtag3_getparm()
avrdude: Sending get parameter (scope 0x01, section 0, parm 0) command: 0x84 (9 bytes msg)
avrdude: Sending get info (serial number) command: 0x81 (23 bytes msg)
         ICE hardware version: 0
         ICE firmware version: 1.13 (rel. 43)
         Serial number   : ATML2658061800008969
avrdude: jtag3_getparm()
avrdude: Sending get parameter (scope 0x01, section 1, parm 0) command: 0x84 (6 bytes msg)
         Vtarget         : 5.00 V
avrdude: jtag3_getparm()
avrdude: Sending get parameter (scope 0x12, section 1, parm 32) command: 0x84 (6 bytes msg)
         JTAG clock megaAVR/program: 0 kHz
avrdude: jtag3_getparm()
avrdude: Sending get parameter (scope 0x12, section 1, parm 33) command: 0x84 (6 bytes msg)
         JTAG clock megaAVR/debug:   0 kHz
avrdude: jtag3_getparm()
avrdude: Sending get parameter (scope 0x12, section 1, parm 48) command: 0x84 (6 bytes msg)
         JTAG clock Xmega: 0 kHz
avrdude: jtag3_getparm()
avrdude: Sending get parameter (scope 0x12, section 1, parm 49) command: 0x84 (6 bytes msg)
         PDI clock Xmega : 0 kHz

avrdude: jtag3_getparm()
avrdude: Sending get parameter (scope 0x01, section 0, parm 1) command: 0x84 (6 bytes msg)
avrdude: jtag3_setparm()
avrdude: Sending set parameter (scope 0x12, section 0, parm 0) command: 0x80 (3 bytes msg)
avrdude: jtag3_setparm()
avrdude: Sending set parameter (scope 0x12, section 0, parm 1) command: 0x80 (3 bytes msg)
avrdude: jtag3_setparm()
avrdude: Sending set parameter (scope 0x12, section 1, parm 0) command: 0x80 (3 bytes msg)
UPDI SET:
        xd->prog_base_msb=47fc87
        xd->prog_base=0 0
        xd->flash_page_size_msb=80
        xd->flash_page_size=0
        xd->eeprom_page_size=40
        xd->nvmctrl=20 0
        xd->ocd=10 80
        avrdude: jtag3_setparm()
avrdude: Sending set parameter (scope 0x12, section 2, parm 0) command: 0x80 (3 bytes msg)
avrdude: Sending AVR sign-on command: 0x84 (8 bytes msg)
avrdude: Partial Family_ID returned: "tiny"
avrdude: AVR device initialized and ready to accept instructions
avrdude: jtag3_read_byte(.., signature, 0x0, ...)
          mapped to address: 0x1100
avrdude: Sending enter progmode command: 0x80 (3 bytes msg)
avrdude: Sending read memory command: 0x84 (7 bytes msg)
avrdude: jtag3_read_byte(.., signature, 0x1, ...)
          mapped to address: 0x1101
avrdude: jtag3_read_byte(.., signature, 0x2, ...)
          mapped to address: 0x1102
avrdude: Device signature = 0x1e9320 (probably t817)

avrdude: safemode: Fuses OK (E:FF, H:FF, L:FF)
avrdude: Sending leave progmode command: 0x80 (3 bytes msg)
avrdude: jtag3_close()
avrdude: Sending AVR sign-off command: 0x80 (3 bytes msg)
avrdude: Sending sign-off command: 0x80 (3 bytes msg)

avrdude done.  Thank you.
---verbose---

Joerg Wunsch <joerg_wunsch>
Group administrator
Tue 23 Nov 2021 09:43:30 AM UTC, comment #11: 

OK, I added something similar to the patch below.

Will look into the other issue before closing the item.

Joerg Wunsch <joerg_wunsch>
Group administrator
Tue 23 Nov 2021 06:20:07 AM UTC, comment #10: 

Well, my Xplained Mini with the ATtiny817 arrived.

It's got a completely different issue: most of the time, it doesn't accept the sign-on command, returning a response with fragment info 0x00. This triggers an "inconsistent fragment number" complaint, according to the Atmel docs, it means there is no response available.

On an Xplained Mini with the ATmega328PB, that never happens ...

Strange.

Joerg Wunsch <joerg_wunsch>
Group administrator
Wed 08 Sep 2021 08:36:27 PM UTC, comment #9: 

A lot of people are suffering with this issue on new Atmel devices. (For example: https://github.com/facchinm/avrdude/issues/3). I myself just wasted an afternoon trying to figure out why avrdude couldn't talk to my ATtiny416 Xplained Nano.

Please can we have this patch applied, and a new avrdude release? I think this bug is causing a lot of people problems.

Joel Holdsworth <jhol>
Mon 22 Feb 2021 05:04:57 AM UTC, comment #8: 

Hello,

I am using svn trunk on osx with an Atmel Ice. I am running into the exact same problem (endless "avrdude: Sending read memory command: 0x84 (4 bytes msg)") and I am wondering if you've found anything which addresses this regression?

Andrew Kohlsmith <akohlsmith>
Mon 28 Sep 2020 08:47:28 PM UTC, comment #7: 

Thanks for the confirmation, Sven!

Joerg Wunsch <joerg_wunsch>
Group administrator
Mon 28 Sep 2020 06:21:00 PM UTC, comment #6: 

Hi Jörg,

it took me some time to verify this because between me proposing this patch and your comment, a regression has been introduced: The last revision that my patch works on is r1435. r1436 breaks this programmer again—even with my patch applied. See the extra verbose output for r1436 with my originally suggested patch attached at the end of this post.

On r1435, I tried your patch. It works just as well as my proposed patch. I agree that your patch is cleaner if it's safe to assume that programmers have only up to one ID.

Sven

===

Patched (my original patch) r1436:

./avrdude -p t817 -c xplainedmini_updi -C avrdude.conf -v -v

avrdude: Version 6.3-20171130
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "avrdude.conf"
         User configuration file is "/home/sven/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : usb
         Using Programmer              : xplainedmini_updi
avrdude: jtag3_open_updi()
avrdude: Found CMSIS-DAP compliant device, using EDBG protocol
avrdude: Sending sign-on command: 0x80 (3 bytes msg)
         AVR Part                      : ATtiny817
         Chip Erase delay              : 0 us
         PAGEL                         : P00
         BS2                           : P00
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 0
         StabDelay                     : 0
         CmdexeDelay                   : 0
         SyncLoops                     : 0
         ByteDelay                     : 0
         PollIndex                     : 0
         PollValue                     : 0x00
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           signature      0     0     0    0 no          3    1      0     0     0 0x00 0x00
           prodsig        0     0     0    0 no         61   61      0     0     0 0x00 0x00
           fuses          0     0     0    0 no          9    1      0     0     0 0x00 0x00
           fuse0          0     0     0    0 no          1    1      0     0     0 0x00 0x00
           fuse1          0     0     0    0 no          1    1      0     0     0 0x00 0x00
           fuse2          0     0     0    0 no          1    1      0     0     0 0x00 0x00
           fuse4          0     0     0    0 no          1    1      0     0     0 0x00 0x00
           fuse5          0     0     0    0 no          1    1      0     0     0 0x00 0x00
           fuse6          0     0     0    0 no          1    1      0     0     0 0x00 0x00
           fuse7          0     0     0    0 no          1    1      0     0     0 0x00 0x00
           fuse8          0     0     0    0 no          1    1      0     0     0 0x00 0x00
           lock           0     0     0    0 no          1    1      0     0     0 0x00 0x00
           data           0     0     0    0 no          0    1      0     0     0 0x00 0x00
           usersig        0     0     0    0 no         32   32      0     0     0 0x00 0x00
           flash          0     0     0    0 no       8192   64      0     0     0 0x00 0x00
           eeprom         0     0     0    0 no        128   32      0     0     0 0x00 0x00

         Programmer Type : JTAGICE3_UPDI
         Description     : Atmel AVR XplainedMini in UPDI mode
avrdude: jtag3_getparm()
avrdude: Sending get parameter (scope 0x01, section 0, parm 0) command: 0x84 (9 bytes msg)
avrdude: Sending get info (serial number) command: 0x81 (23 bytes msg)
         ICE hardware version: 0
         ICE firmware version: 1.13 (rel. 43)
         Serial number   : ATML2658061800003615
avrdude: jtag3_getparm()
avrdude: Sending get parameter (scope 0x01, section 1, parm 0) command: 0x84 (6 bytes msg)
         Vtarget         : 5.00 V
avrdude: jtag3_getparm()
avrdude: Sending get parameter (scope 0x12, section 1, parm 32) command: 0x84 (6 bytes msg)
         JTAG clock megaAVR/program: 0 kHz
avrdude: jtag3_getparm()
avrdude: Sending get parameter (scope 0x12, section 1, parm 33) command: 0x84 (6 bytes msg)
         JTAG clock megaAVR/debug:   0 kHz
avrdude: jtag3_getparm()
avrdude: Sending get parameter (scope 0x12, section 1, parm 48) command: 0x84 (6 bytes msg)
         JTAG clock Xmega: 0 kHz
avrdude: jtag3_getparm()
avrdude: Sending get parameter (scope 0x12, section 1, parm 49) command: 0x84 (6 bytes msg)
         PDI clock Xmega : 0 kHz

avrdude: jtag3_getparm()
avrdude: Sending get parameter (scope 0x01, section 0, parm 1) command: 0x84 (6 bytes msg)
avrdude: jtag3_setparm()
avrdude: Sending set parameter (scope 0x12, section 0, parm 0) command: 0x80 (3 bytes msg)
avrdude: jtag3_setparm()
avrdude: Sending set parameter (scope 0x12, section 0, parm 1) command: 0x80 (3 bytes msg)
avrdude: jtag3_setparm()
avrdude: Sending set parameter (scope 0x12, section 1, parm 0) command: 0x80 (3 bytes msg)
UPDI SET:
xd->prog_base=0 80
xd->flash_page_size=40
xd->eeprom_page_size=20
xd->nvmctrl=0 10
xd->ocd=80 f
avrdude: jtag3_setparm()
avrdude: Sending set parameter (scope 0x12, section 2, parm 0) command: 0x80 (3 bytes msg)
avrdude: Sending AVR sign-on command: 0x84 (8 bytes msg)
avrdude: Partial Family_ID returned: "tiny"
avrdude: AVR device initialized and ready to accept instructions

Reading |                                                    | 0% 0.00savrdude: jtag3_paged_load(.., signature, 1, 0x0, 1)
          mapped to address: 0x1100
avrdude: Sending enter progmode command: 0x80 (3 bytes msg)
avrdude: Sending read memory command: 0x84 (4 bytes msg)
avrdude: Sending read memory command: 0x84 (4 bytes msg)
avrdude: Sending read memory command: 0x84 (4 bytes msg)
[... the last lines repeat indefinitely ...]

Sven <svenschwermer>
Sun 20 Sep 2020 08:03:34 PM UTC, comment #5: 

Well, I don't think programmers usually have multiple IDs. However, the avrdude.conf syntax (see config_gram.y) allows for a string_list in that place.

I guess we don't really need to care for more than one ID, but we need to take into account that pgm->id points to the list rather than the list's datum.

IMHO, the following patch ought to fix it as well, can you verify?


Index: jtag3.c
===================================================================
--- jtag3.c     (revision 1448)
+++ jtag3.c     (working copy)
@@ -867,7 +867,7 @@
   /* XplainedMini boards do not need this, and early revisions had a
    * firmware bug where they complained about it. */
   if (pgm->flag & PGM_FL_IS_EDBG) {
-    if (strcmp(pgm->id, "xplainedmini_updi") != 0) {
+    if (strcmp(ldata(lfirst(pgm->id)), "xplainedmini_updi") != 0) {
       if (jtag3_edbg_prepare(pgm) < 0) {
         return -1;
       }
@@ -1581,7 +1581,7 @@
   /* XplainedMini boards do not need this, and early revisions had a
    * firmware bug where they complained about it. */
   if (pgm->flag & PGM_FL_IS_EDBG) {
-    if (strcmp(pgm->id, "xplainedmini_updi") != 0) {
+    if (strcmp(ldata(lfirst(pgm->id)), "xplainedmini_updi") != 0) {
       jtag3_edbg_signoff(pgm);
     }
   }


Joerg Wunsch <joerg_wunsch>
Group administrator
  Spam posted by _145598
  Spam posted by _145598
  Spam posted by _145598
  Spam posted by _145598
Fri 22 Feb 2019 04:55:14 PM UTC, original submission:  

Hi,

I had already posted to the mailing list, but didn't get a response, so I'll try here as well. This was what I posted to the mailing list:
https://lists.nongnu.org/archive/html/avrdude-dev/2019-01/msg00005.html

I think the error is caused by the way the programmer ID is compared against "xplainedmini_updi". The attached patch seems to fix the issue. However, I don't quite understand why a programmer would need a list of IDs in the first place, so I'd appreciate it if some skeptical eyes looked over my patch.

Thanks,
Sven

Sven <svenschwermer>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #46335:  patch added by svenschwermer (2KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jhol (Posted a comment)
  • -email is unavailable- added by akohlsmith (Posted a comment)
  • -email is unavailable- added by joerg_wunsch (Posted a comment)
  • -email is unavailable- added by _145598 (Posted a comment)
  • -email is unavailable- added by svenschwermer (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-11-27 joerg_wunsch Open/ClosedOpen Closed
    2021-11-23 joerg_wunsch StatusIn Progress Works For Me
    2021-11-23 joerg_wunsch StatusNeed Info In Progress
    2020-09-20 joerg_wunsch StatusNone Need Info
        Assigned toNone joerg_wunsch
    2019-02-22 svenschwermer Attached File- Added patch, #46335

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code