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


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

patch #7437: modifications to Bus Pirate module

Submitter:  Tim Vaughan <tgvaughan>
Submitted:  Sun 16 Jan 2011 04:25:02 AM UTC
Category:  None Priority:  5 - Normal
Status:  Ready For Test Privacy:  Public
Assigned to:  rliebscher Open/Closed:  Closed

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

Implemented in svn revision 1052

Rene Liebscher <rliebscher>
Group Member
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'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!


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>


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

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


Depends on the following items: None found

Items that depend on this one: None found


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

    Date Changed by Updated Field Previous Value => Replaced by
    2013-09-03 rliebscher Open/ClosedOpen Closed
    2012-01-31 rliebscher StatusNone Ready For Test
    2011-12-18 rliebscher Assigned tomludvig rliebscher
    2011-08-17 joerg_wunsch Assigned toNone mludvig
    2011-01-16 tgvaughan Attached File- Added avrdude_buspirate.patch, #22418

    Back to the top

    Powered by Savane 3.12