bugAVR Downloader/UploaDEr - Bugs: bug #35261, avrftdi uses wrong interface in...

 
 

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

bug #35261: avrftdi uses wrong interface in avrftdi_paged_(write|load)

Submitter:  Rene Liebscher <rliebscher>
Submitted:  Sat 07 Jan 2012 10:21:55 AM UTC
   
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Fixed Privacy:  Public
Assigned to:  rliebscher Originator Name:  RenĂ© Liebscher
Open/Closed:  Closed Release:  None
Programmer hardware:  Device type: 

Tue 10 Jan 2012 06:21:43 PM UTC, comment #3: 

Integrated in svn revision 1039

Rene Liebscher <rliebscher>
Group Member
Tue 10 Jan 2012 08:09:07 AM UTC, comment #2: 

I think the patch is fine, please go ahead, and commit it.

I've been testing it on an ATmega2560 as well, and I think
all is fine with that.

Joerg Wunsch <joerg_wunsch>
Group administrator
Sun 08 Jan 2012 08:18:30 PM UTC, comment #1: 

There was a wrong length in a memcpy which was the reason for the segmentation fault. This is now changed in the updated patch.

But as I still do not own devices >128KB flash I can not test all of the patch.

I also added a "ftdi_list_free(&devlist);" statement to avoid a memory leak.

(file #24767)

Rene Liebscher <rliebscher>
Group Member
Sat 07 Jan 2012 10:21:55 AM UTC, original submission:  

The avrftdi uses the old interface without the base address.

This results at reading in not reading the last page and extreme read times. (1000s for 32KByte flash)

It used the old interface.

 static int avrftdi_paged_write(PROGRAMMER pgm, AVRPART p, AVRMEM * m, int page_size, int n_bytes)

But it should use:
 
 static int avrftdi_paged_write(PROGRAMMER pgm, AVRPART p, AVRMEM * m, unsigned int page_size, unsigned int addr, unsigned int n_bytes)

So it interprets the addr as length. As the pages are read sequentially, the address is incremented with page_size and the current implementation always read all already read pages again (as it see incrementing n_bytes values)

For m pages it reads here the first page (m-1) times, the second (m-2) times, and so on. The last page is not read at all.

The attached patch tries to fix this. It reads now all memory and with the original speed (3s for 32 KByte).

But on my Windows XP I get now a segmentation fault at exit (in avrftdi_close at ftdi_deinit). I'm not sure if this comes from the patch. So better someone else have a look at it.

Rene Liebscher <rliebscher>
Group Member

 

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

Attached Files
file #24767:  avrftdi.diff added by rliebscher (5KiB - 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 joerg_wunsch (Posted a comment)
  • -email is unavailable- added by rliebscher (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 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-01-10 rliebscher StatusIn Progress Fixed
        Open/ClosedOpen Closed
    2012-01-10 joerg_wunsch StatusNone In Progress
        Assigned toNone rliebscher
    2012-01-08 rliebscher Attached File#24757 Removed
    2012-01-08 rliebscher Attached File- Added avrftdi.diff, #24767
    2012-01-07 rliebscher Attached File- Added avrftdi.diff, #24757

    Back to the top

    Powered by Savane 3.13-bb6a.
    Corresponding source code