Sigrok-cli

From sigrok
Revision as of 20:01, 1 December 2010 by Rf (talk | contribs)
Jump to navigation Jump to search

The sigrok command-line frontend sigrok-cli cannot display graphical output, but is still sufficient to run through the whole process of hardware initialization, acquisition, protocol analysis and saving the session. It can display samples on standard output or save them in various file formats.

It is useful for running on remote or embedded systems, netbooks, PDAs, and for various other use-cases. It can display samples on standard output or save them in various file formats.

Usage

Usage:

$ sigrok-cli [Arguments]

Arguments

Informational

  • -H, --list-hw-plugins

Output a list of all available hardware plugins.

  • -D, --list-devices

List devices found on the system.

  • -A, --list-analyzer-plugins

Output a list of all available protocol analysis plugins.

  • -V, --version

Show version.

Session control

  • -L, --load-session-file <filename>

Session file to load previously acquired data from. Any devices or protocols listed in the file will be reused, unless overridden by other commandline arguments.

  • -S, --save-session-file <filename>

Save session to file.

  • --time <ms>

Sample for <ms> milliseconds, then quit. You can optionally follow the number by s to state the number of seconds to sample instead. For example, 2s will sample for two seconds.

  • --samples <num>

Acquire <num> samples, then quit. The number of samples may also be specified with a "k", "m" or "g" suffix, e.g. "1k" is equivalent to "1000".

  • -d, --device <string>

The device to use for acquisition, specified by ID as report by --list-devices.

  • -p --probes <string>

A comma-separated list of probes to be used in the session. The default is to use all the probes available on a device. You can name a probe, like this: 1=CLK. A range of probes can also be given, in the form 1-5. Thus a probe list given as 1=CLK,2-4,7 will give output like this:

CLK:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111
  2:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111
  3:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111
  4:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111
  7:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111
  • -t, --triggers <string>

A comma-separated list of triggers to use, of the form <probe>=<trigger>. You can use the name or number of the probe, and the trigger itself is a series of characters:

  • 0 or 1: A low or high value on the pin.
  • r or f: A rising or falling value on the pin. An r effectively corresponds to 01.
  • c: Any kind of change on a pin.

Not every device supports all of these trigger types. Use the -d <device-id> argument (with no other arguments) to see which triggers your device supports.

  • -a, --analyzers <string>

A string listing the sequence of protocol analysis plugins the signal should go through. Each element of the sequence consists of the plugin's name, with a pipe (|) symbol separating the elements.

Session options

  • -o, --device-option <option string>

Set a device-specific option. The argument takes the form of option=value. Currently the only option supported is samplerate, with the argument being the samplerate in Hz. You can also specify the sample rate in KHz, MHz or GHz. The following are all equivalent:

$ sigrok-cli --samples 100 -o samplerate=1000000
$ sigrok-cli --samples 100 -o samplerate=1m
$ sigrok-cli --samples 100 -o "samplerate=1 MHz"

The --device-option' argument can be used multiple times as needed.

  • -f, --format <format>

Set the output format to use. Supported formats currently include bits, hex, binary, vcd, and gnuplot. The bits or hex formats, for an ASCII bit display or hexadecimal display, optionally followed by a length argument specifying the number of samples (in bits). Thus hex128 would display 128 bits per line, in hexadecimal:

1:ffff ffff ffff ffff ffff ffff ffff ffff
2:ff00 ff00 ff00 ff00 ff00 ff00 ff00 ff00

The lines always start with the probe number (or name, if defined), followed by a colon. If no format is specified, it defaults to 'bits64', like this:

1:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111
2:11111111 00000000 11111111 00000000 11111111 00000000 11111111 00000000