Skip to main content

SUMP Logic Analyzer

Sigrok/PulseView is a popular open source logic analyzer GUI that runs on Windows, Linux, and Mac. The Bus Pirate supports Sigrok/PulseView through a SUMP protocol interface.

The Bus Pirate can be used as a logic analyzer in multiple ways. This page documents the SUMP compatible interface.

Other software also supports the SUMP protocol, but many haven't been updated in years and don't operate on modern operating systems.

Capabilities

  • 62.5MSPS (or more if overclocked)
  • 131K samples
  • 8 channels
  • Trigger: single pin, high or low
  • Base pin can be set to an internal pin for debugging the Bus Pirate itself

Bus Pirate Setup

Configure the Bus Pirate for SUMP logic analyzer mode.

Change to HiZ mode

Bus Pirate [/dev/ttyS0]
SPI> m 1
Mode: HiZ
HiZ>

For general purpose logic analyzer use, change to HiZ mode with the m 1 command. This will make all the pins inputs and disable pull-up resistors.

danger

There is no restriction on using the logic analyzer while the Bus Pirate is not in HiZ mode. However, prior to Bus Pirate hardware 6, all pins are measured behind the IO buffer. This means the logic capture may not match the actual output of the IO buffer on pins configured as outputs. This is not a problem when the Bus Pirate is used as a logic analyzer in HiZ mode and all pins are inputs.

Enable SUMP Interface

Bus Pirate [/dev/ttyS0]
HiZ> binmode

Select binary mode
1. SUMP logic analyzer
2. Binmode test framework
3. Arduino CH32V003 SWIO
4. Follow along logic analyzer
x. Exit
> 1
Binmode selected: SUMP logic analyzer

HiZ>

Enable the SUMP binary interface with the binmode command. A SUMP-compatible logic analyzer interface will now respond to the Bus Pirate's second serial port.

Sigrok/PulseView

Download and install Sigrok/PulseView for your operating system. There is currently a bug in the USB drivers used in the official Sigrok/PulseView Windows release. Use the patched version for Windows until a fix is accepted to the official project.

Setup

Open PulseView. From the device drop down select Connect to Device.

  • Choose Openbench Logic Sniffer & SUMP compatables (ols) as the device driver
  • Choose Serial Port as the interface and select the Bus Pirate secondary (binmode) serial port from the list
  • Click Scan for devices using driver above

The Bus Pirate device should be detected. Click OK to connect.

Power Supply in SUMP mode

The IO buffers need a power supply, or we won't be able to see any signals. A 3.3volt power supply is automatically enabled when the SUMP serial port is opened in the following circumstances:

  • If the Bus Pirate terminal is not open
  • If the Bus Pirate terminal is open and in HiZ mode The power supply is disabled when the SUMP serial port is closed.

Configure

Select the sampling speed and number of samples to capture using the two drop down menus.

To configure a trigger, click the channel label and choose none, high, or low. The trigger type will be displayed on the graph.

Capture

With or without a trigger, click the run button to start the capture. When complete, the captured data will be displayed in the graph.

Capture During Use

The terminal can be used while the SUMP logic analyzer is running. You can set triggers and capture while sending or receiving data from the Bus Pirate terminal.

To test capture during use:

  • m 8 - Select any mode, we'll use DIO mode because all the pins are free
  • G - Use the G command to start pulse-width modulation output on more or more pins
  • W 5 - Make sure the buffers are powered
danger

All Bus Pirates support logic capture while the hardware is in use, however only Bus Pirate 6 has a second buffer to capture pins directly. In earlier hardware all output pins are captured behind the IO buffer. This means the logic capture may not match the actual output of the IO buffer. This is not a problem when the Bus Pirate is used as a logic analyzer only and all pins are inputs.

Logic Analyzer System

info

The logic command and the follow along binmode interface can be run at the same time. However, the capture buffer is shared with SUMP logic analyzer mode. SUMP and follow along logic analyzer modes cannot be used at the same time and will result in a memory error warning.

SUMP protocol

Metadata command

A extended command byte is added to the SUMP protocol: 0x04 - get metadata. In response, the device sends a series of 1-byte keys, followed by data pertaining to that key. The series ends with the key 0x00. The system can be extended with new keys as more data needs to be reported.

Metadata Format

The keys are split up into two fields: the upper 3 bits denote the type, and the lower 5 bits denote the token. The token is unique within the type. Thus a 0x01 null-terminated string token is not the same as a 0x01 integer token.

This way a client need only know about the keys it can deal with, while still having a way to skip over the ones it doesn't know -- since the type field denotes a length (or null-terminated field). If more metadata keys get added in the future, clients will just ignore them until support for those keys is added to the application.

This means a client parsing metadata MUST always ignore keys it doesn't know, never give an error message for them.

TypeTokenKeyDescription
0null-terminated string, UTF-8 encoded
00x00not used, key means end of metadata
10x01device name (e.g. "Openbench Logic Sniffer v1.0", "Bus Pirate v3b")
20x02Version of the FPGA firmware
30x03Ancillary version (PIC firmware)
132-bit unsigned integer
00x20Number of usable probes
10x21Amount of sample memory available (bytes)
20x22Amount of dynamic memory available (bytes)
30x23Maximum sample rate (hz)
40x24Protocol version (see below)
28-bit unsigned integer
00x40Number of usable probes (short)
10x41Protocol version (short)
3-7unused

The protocol version key holds a 4-stage version, one per byte, where the MSB holds the major version number. As of the first release to support this metadata command, the protocol version should be 2. This would be encoded as 0x00000002.

Short commands

The 8-bit short commands are an alternative to the 32-bit commands for the number of probes and version. This saves space on small systems. Most systems are unlikely to sport more than 256 probes, so there's no reason to store 3 null bytes. A client should support both.