patchAVR Downloader/UploaDEr - Patches: patch #7437, modifications to Bus Pirate module

 
 

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

patch #7437: modifications to Bus Pirate module

Submitted by:  Tim Vaughan <tgvaughan>
Submitted on:  Sun 16 Jan 2011 04:25:02 AM UTC  
 
Category: NonePriority: 5 - Normal
Status: Ready For TestPrivacy: Public
Assigned to: Rene Liebscher <rliebscher>Open/Closed: Closed

Tue 31 Jan 2012 07:05:02 PM UTC, comment #1:

Implemented in svn revision 1052

Rene Liebscher <rliebscher>
Project MemberIn charge of this item.
Sun 16 Jan 2011 04:25:02 AM UTC, original submission:

Dear AVRDude dudes,

First off, thanks for writing such an awesome tool - if it weren't for you, I wouldn't be able to tinker with AVRs. (What a sad and miserable life that would be! :-) )

In case you're interested, I've made a couple of changes/improvements I've made to the support for dangerousprototypes.com's Bus Pirate.

The first change is structural. During initialization, the previous buspirate.c (specifically, buspirate_enable() ) sent a reset command to the BP and parsed the resulting serial output to determine the versions of the BP hardware and firmware. This was then used to determine whether the binary SPI mode could be used for communication with the MCU. Unfortunately, this approach has been a source of ongoing compatibility issues due to small changes made to the BP user interface over the last few firmware revisions. Furthermore, the initial reset command will cause havoc with the next version of the BP hardware (v4), as it will cause the USB connection to the BP to disappear and reattach.

Following the suggestion of Ian Lesnet, the lead BP developer, I've therefore removed the initial reset, as well as any attempt to detect the BP hardware or firmware versions via the BP user interface. Instead, I've implemented a try-then-fallback approach that attempts to enter the binary SPI mode, then falls back to the original ascii mode in the event that this fails. Entering binary mode implicitly causes the BP to reset its internal mode settings, which is why the explicit reset is unnecessary, but a reset is still performed in the event that ascii mode is used. This change fixes all of the recent compatibility issues as all but the earliest firmware versions support the binary mode. (The extended option "ascii" can still be used to force the use of the legacy ascii SPI mode, if desired. However, ascii mode is likely to fail on BPs using recent firmware versions due again to small changes in the ascii user interface.)

The second change is a feature addition. Ian has added a new bulk SPI write command to the latest BP firmware version. The presence of this new command is determined during initialization (again by trial and error, this time in buspirate_start_spi_mode_bin() ) and, if found, a new buspirate_pagedwrite() function is enabled which makes use of this command which speeds up writes to AVR flash memory by about a factor of 4. I've created an additional extended option "nopagedwrite" which disables detection and use of this function in case it's not wanted, and added an appropriate entry to the manpage documenting this new option.

The attached patch includes these changes and is against the current svn trunk. If you're happy with the modifications, please let me know if there's anything I can do to make them appropriate for inclusion in the avrdude code base. I've done my best to keep the changes/additions in line with the existing style, but no-doubt there's plenty that could be done better.

Thanks again for all the hard work you guys have put in to opening up AVR programming to *nix users!

Tim

p.s. I posted this to the list a few weeks ago, but didn't actually assign a patch number - hence the double post.

Tim Vaughan <tgvaughan>

 

Attached Files
file #22418:  avrdude_buspirate.patch added by tgvaughan (11kB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rliebscher (Updated the item)
  • -unavailable- added by joerg_wunsch (Updated the item)
  • -unavailable- added by tgvaughan (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 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 03 Sep 2013 08:03:08 PM UTCrliebscherOpen/ClosedOpen=>Closed
    Tue 31 Jan 2012 07:05:02 PM UTCrliebscherStatusNone=>Ready For Test
    Sun 18 Dec 2011 10:34:38 PM UTCrliebscherAssigned tomludvig=>rliebscher
    Wed 17 Aug 2011 02:14:05 PM UTCjoerg_wunschAssigned toNone=>mludvig
    Sun 16 Jan 2011 04:25:02 AM UTCtgvaughanAttached File-=>Added avrdude_buspirate.patch, #22418

    Back to the top


    Powered by Savane 3.1-cleanup