Wiki / Hardware

Bus Pirate

A pocket, USB-driven multi-protocol interface. Speaks SPI, I2C, UART, 1-Wire and more from a serial terminal, so one board can probe, sniff, and dump unknown chips.

Bus Pirate

The Bus Pirate is a small open-hardware USB adapter that talks a dozen low-level protocols from a single serial terminal. Instead of carrying a separate dongle for SPI, another for I2C, and a third for UART, you plug in one board, pick the mode you need, and start poking at pins. It was created by Dangerous Prototypes and has become a staple of the hardware-hacking bench for fast, throwaway interrogation of unknown chips.

What it is

Physically it is a tiny PCB (the classic v3 pictured is a red board) with a USB port on one end and a labelled probe header on the other. Onboard is a PIC microcontroller running the Bus Pirate firmware and a USB-to-serial bridge, so from the host it appears as an ordinary serial port (/dev/ttyUSBx). The probe header breaks out the signal pins (MOSI, MISO, CLK, CS, plus AUX, ADC), a switchable on-board power supply (3.3V and 5V), and the pull-up bus, Vpu. You drive the whole thing by typing single-letter commands into a 115200-baud terminal.

Why it matters

The Bus Pirate turns a pile of adapter-specific tooling into one cheap, scriptable device. On the recon bench that is exactly what you want: you found four unlabelled pads on a board, you suspect I2C, and in under a minute you can put the Bus Pirate in I2C mode, run an address scan, and confirm there is a chip answering at 0x50. It is not the fastest or highest-voltage tool for any single job, but its breadth and immediacy make it the first thing many people reach for.

How you use it

Open the terminal and pick a mode with m:

HiZ>m            # menu: 1.HiZ 2.1-WIRE 3.UART 4.I2C 5.SPI 6.2WIRE ...
(1)>4            # choose I2C
(1)>3            # 100 kHz
I2C>W            # power on (big W = enable Vout), P = enable pull-ups
I2C>(1)          # macro (1) = 7-bit address search
Searching I2C address space.
  0xA0(0x50 W) 0xA1(0x50 R)   # an EEPROM answering at 0x50

For SPI flash the fastest path is to let flashrom drive the Bus Pirate directly:

flashrom -p buspirate_spi:dev=/dev/ttyUSB0,spispeed=1M -r dump.bin

Other everyday uses: bridge a device's UART console (m then UART), read a 1-Wire iButton or temperature sensor, or sit in HiZ mode to safely probe voltages without driving any line.

Pitfalls

  • Speed. The Bus Pirate is convenient, not fast. Dumping a large SPI flash over it is slow; for anything beyond a few megabits a dedicated ch341a programmer or an FT2232-based adapter is far quicker.
  • Voltage. The I/O is not 5V-tolerant on every revision, and its drive strength is modest. Confirm the target rail with a multimeter first and match Vpu/Vout before you connect.
  • Pull-ups. In I2C and other open-drain modes nothing works until you enable the on-board pull-ups (P) and feed Vpu. A silent bus is usually a missing pull-up, not a dead chip.
  • HiZ default. The board boots in HiZ (high-impedance) so it cannot damage a target by accident. Remember to leave HiZ and power the bus before expecting traffic.

Further reading