Python Scripts for the BusPirate (intended for Linux)


The BusPirate is a small USB-attached hardware debugging interface using a USB-serial attachment. While it can be used interactively with a terminal program, e.g. with minicom, that gets tedious fast. For this reason I wrote a set of Python 3.x scripts to automatize things. I have tried for reasonable in-code documentation so the scripts can also serve as templates for other tools.

Remarks:

BusPirate finder

This is a script that finds the interface a BusPirate is attached to. It first tests interfaces from a list whether they are active and then sends a BusPirate reset, i.e. "#" + CR and evaluates the response. Note that this may confuse other devices attached via USB-serial. Also note that BP response is inconsiostend across firmware versions, including v6.1 that does not manage to answer "RESET" as first line, but instead writes "RE", whith an occasional 0xff added.
This version here should work at least for firmware 5.10 and 6.1

SPI: Reading and writing 4Mbit (and maybe other) FLASH memories

Tools for SPI Flash memories. The 4Mbit variants are popular and widely used, because they are fast and very cheap. These tools are tested with a Microchip 25x40 and an AMIC 25L040. They should work with others as well, but may need adjustment. Do not use pull-up mode, it is unreliable.
Last update: November, 2013 Arno Wagner