[bug #55462] wrong programmer id check in jtag3_getsync() and jtag3_close()

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[bug #55462] wrong programmer id check in jtag3_getsync() and jtag3_close()

Georg-Johann Lay-3
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: [hidden email]
             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/


_______________________________________________
avrdude-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/avrdude-dev