avrdude-dev
[Top][All Lists]
Advanced

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

[avrdude-dev] [bug #43137] Writing and reading incorrect pages when usin


From: anonymous
Subject: [avrdude-dev] [bug #43137] Writing and reading incorrect pages when using jtagicemkI
Date: Wed, 03 Sep 2014 20:57:50 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0

URL:
  <http://savannah.nongnu.org/bugs/?43137>

                 Summary: Writing and reading incorrect pages when using
jtagicemkI
                 Project: AVR Downloader/UploaDEr
            Submitted by: None
            Submitted on: Wed 03 Sep 2014 08:57:49 PM UTC
                Category: None
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
         Originator Name: Joris Putcuyps
        Originator Email: address@hidden
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

When using Olimex jtagicemkI clone writing and reading fails. 

Reading |                                                    | 0%
0.00savrdude: jtagmkI_paged_load(): timeout/error communicating with
programmer (resp �)
avrdude: jtagmkI_paged_load(): timeout/error communicating with programmer
(resp �)
avrdude: jtagmkI_paged_load(): timeout/error communicating with programmer
(resp �)
avrdude: jtagmkI_paged_load(): timeout/error communicating with programmer
(resp �)
avrdude: jtagmkI_read_byte(): timeout/error communicating with programmer
(resp a)

Using r1333 from svn and gdb I managed to find the problem:
Both reading and writing is done using wrong calculation of pages and bytes in
jtagmkI_paged_load() and jtagmkI_paged_write().

Patch:

===================================================================
--- jtagmkI.c   (revision 1333)
+++ jtagmkI.c   (working copy)
@@ -766,7 +766,7 @@
       return -1;
     }
 
-    if ((n_bytes-addr) < page_size)
+    if (n_bytes < page_size)
       block_size = n_bytes - addr;
     else
       block_size = page_size;
@@ -886,8 +886,8 @@
       return -1;
     }
 
-    if ((n_bytes-addr) < page_size)
-      block_size = n_bytes - addr;
+    if (n_bytes < page_size)
+      block_size = n_bytes;
     else
       block_size = page_size;
     avrdude_message(MSG_DEBUG, "%s: jtagmkI_paged_load(): "







    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?43137>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/




reply via email to

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