bugAVR Downloader/UploaDEr - Bugs: bug #60753, Patch #1436 breaks multiple...

 
 

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

bug #60753: Patch #1436 breaks multiple programmer/device combinations on MacOS BigSur

Submitter:  None
Submitted:  Wed 09 Jun 2021 03:26:22 PM UTC
   
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Fixed Privacy:  Public
Assigned to:  joerg_wunsch Originator Name:  Melanie Thielker
Originator Email:  -email is unavailable- Open/Closed:  Closed
Release:  SVN snapshot Programmer hardware:  Various
Device type:  Various

Sun 27 Jun 2021 08:26:31 PM UTC, comment #3: 

fixed in r1452

Joerg Wunsch <joerg_wunsch>
Group administrator
Fri 25 Jun 2021 04:51:21 AM UTC, comment #2: 

I suggest comparing against mem->page_size > 1 instead, since this is basically identical in behaviour to the pre-#1436 behaviour.

Also, there are more occasions than just line 364.

Please test the following patch.

+++
Index: avr.c
===================================================================
--- avr.c       (revision 1450)
+++ avr.c       (working copy)
@@ -330,7 +330,7 @@
   memset(mem->buf, 0xff, mem->size);
 
   /* supports "paged load" thru post-increment */
-  if ((p->flags & AVRPART_HAS_TPI) && mem->page_size != 0 &&
+  if ((p->flags & AVRPART_HAS_TPI) && mem->page_size > 1 &&
       pgm->cmd_tpi != NULL) {
 
     while (avr_tpi_poll_nvmbsy(pgm));
@@ -361,7 +361,7 @@
     return avr_mem_hiaddr(mem);
   }
 
-  if (pgm->paged_load != NULL && mem->page_size != 0) {
+  if (pgm->paged_load != NULL && mem->page_size > 1) {
     /*
      * the programmer supports a paged mode read
      */
@@ -863,7 +863,7 @@
   }
 
 
-  if ((p->flags & AVRPART_HAS_TPI) && m->page_size != 0 &&
+  if ((p->flags & AVRPART_HAS_TPI) && m->page_size > 1 &&
       pgm->cmd_tpi != NULL) {
 
     while (avr_tpi_poll_nvmbsy(pgm));
@@ -903,7 +903,7 @@
     return i;
   }
 
-  if (pgm->paged_write != NULL && m->page_size != 0) {
+  if (pgm->paged_write != NULL && m->page_size > 1) {
     /*
      * the programmer supports a paged mode write
      */
---

Joerg Wunsch <joerg_wunsch>
Group administrator
Thu 24 Jun 2021 11:36:36 AM UTC, comment #1: 

Some more observations are in this message: https://lists.nongnu.org/archive/html/avrdude-dev/2021-06/msg00004.html

I didn't see this bug report before I posted the message to the mailing list. The fix may be as simple as

--- avr.c       (revision 1436)
+++ avr.c       (working copy)
@@ -361,7 +361,7 @@
     return avr_mem_hiaddr(mem);
   }

-  if (pgm->paged_load != NULL && mem->page_size != 0) {
+  if (pgm->paged_load != NULL && mem->page_size != 0 && mem->paged) {
     /*
      * the programmer supports a paged mode read
      */

Sven <svenschwermer>
Wed 09 Jun 2021 03:26:22 PM UTC, original submission:  

Tested with stk500, avrispmkii, with ATMega328P, ATTiny861, ATTiny13

Programmer stops and waits forever after reporting the chip initialized and ready to receive data.

         Programmer Type : STK500V2
         Description     : Atmel STK500
         Programmer Model: AVRISP
         Hardware Version: 2
         Firmware Version Master : 2.20
         Vtarget         : 5.0 V
         SCK period      : 0.1 us

avrdude: AVR device initialized and ready to accept instructions

Reading |                                                    | 0% 0.00s

Removing avrpart.c:257, make it work again.

The line in question is this:

m->page_size = 1; // ensure not 0

With it removed, the result is as expected:

         Programmer Type : STK500V2
         Description     : Atmel STK500
         Programmer Model: AVRISP
         Hardware Version: 2
         Firmware Version Master : 2.20
         Vtarget         : 5.0 V
         SCK period      : 0.1 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.10s

avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: safemode: lfuse reads as C7
avrdude: safemode: hfuse reads as D9
avrdude: safemode: efuse reads as FC

avrdude: safemode: lfuse reads as C7
avrdude: safemode: hfuse reads as D9
avrdude: safemode: efuse reads as FC
avrdude: safemode: Fuses OK (E:FC, H:D9, L:C7)

avrdude done.  Thank you.

Strangely, changing it to:

if (!m->page_size)
  m->page_size = 1

also breaks it, suggesting that a page size of 0 is actually valid.

Anonymous

 

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

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by joerg_wunsch (Posted a comment)
  • -email is unavailable- added by svenschwermer (Posted a comment)
  • -email is unavailable- added by None (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 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-06-27 joerg_wunsch StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2021-06-25 joerg_wunsch StatusNone Confirmed
        Assigned toNone joerg_wunsch

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code