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)

Submitted by:  Rene Liebscher <rliebscher>
Submitted on:  Sat 07 Jan 2012 10:21:55 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalItem Group: None
Status: FixedPrivacy: Public
Assigned to: Rene Liebscher <rliebscher>Originator Name: RenĂ© Liebscher
Open/Closed: ClosedRelease: None
Programmer hardware: Device type: 

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

Integrated in svn revision 1039

Rene Liebscher <rliebscher>
Project MemberIn charge of this item.
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>
Project 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>
Project MemberIn charge of this item.
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>
Project MemberIn charge of this item.

 

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
  • -unavailable- added by joerg_wunsch (Posted a comment)
  • -unavailable- added by rliebscher (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 10 Jan 2012 06:21:43 PM UTCrliebscherStatusIn Progress=>Fixed
      Open/ClosedOpen=>Closed
    Tue 10 Jan 2012 08:09:07 AM UTCjoerg_wunschStatusNone=>In Progress
      Assigned toNone=>rliebscher
    Sun 08 Jan 2012 08:18:38 PM UTCrliebscherAttached File#24757=>Removed
    Sun 08 Jan 2012 08:18:30 PM UTCrliebscherAttached File-=>Added avrftdi.diff, #24767
    Sat 07 Jan 2012 10:21:55 AM UTCrliebscherAttached File-=>Added avrftdi.diff, #24757

    Back to the top


    Powered by Savane 3.1-cleanup1