avrdude-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avrdude-dev] [bug #55462] wrong programmer id check in jtag3_getsync()


From: anonyme
Subject: [avrdude-dev] [bug #55462] wrong programmer id check in jtag3_getsync() and jtag3_close()
Date: Sun, 13 Jan 2019 02:27:47 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:64.0) Gecko/20100101 Firefox/64.0

URL:
  <https://savannah.nongnu.org/bugs/?55462>

                 Summary: wrong programmer id check in jtag3_getsync() and
jtag3_close()
                 Project: AVR Downloader/UploaDEr
            Submitted by: None
            Submitted on: dim. 13 janv. 2019 07:27:46 UTC
                Category: None
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
         Originator Name: Albert ARIBAUD
        Originator Email: address@hidden
             Open/Closed: Open
                 Release: SVN snapshot
         Discussion Lock: Any
     Programmer hardware: xplainedmini_updi
             Device type: attiny416

    _______________________________________________________

Details:

As described in

    http://lists.nongnu.org/archive/html/avrdude-dev/2018-01/msg00007.html

xplainedmini_updi should skip calling jtag3_edbg_prepare() and
jtag3_edbg_signoff().

There is code to this effect in jtag3_getsync() and jtag3_close().

However both jtag3_getsync() and jtag3_close() directly compare pgm->id to
"xplainedmini_updi", which fails on Ubuntu (and, I suspect, on (m)any x86_64
Linux systems as well) because pgm->id does not actually point to the
programmer's name, and must be accessed through ldata() and lfirst() as it is
in other parts of avrdude.

This lack of ldata() and lfirst() causes jtag3_edbg_prepare() to actually be
called, making avrdude unable to use the attiny xplained nano, which uses the
xplainedmini_updi programmer.

Fix:

In both jtag3_getsync() and jtag3_close(), the line

    if (strcmp(pgm->id, "xplainedmini_updi") != 0) {

should be rewritten as 

    if (strcmp(ldata(lfirst(pgm->id)), "xplainedmini_updi") != 0) {

This fix was tested on Xubuntu 18.04 with trunk.




    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?55462>

_______________________________________________
  Message posté via Savannah
  https://savannah.nongnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]