I have testes several logic analyzers (both commercial and DIY) and software for them. I would like to see on this Open Source world is some kind of common format logic analyzer data presentation and maybe common API for accessing the information. In this way it would be easy to write all kinds of applications that decode data and hardware that captures the data independently. I would want something like what Wireshark did for network traffic analyzing – open source and easily expandable software.
Not I think I have found one software that seems to match those needs, and it is called sigrok.
When sigrok project started, the developers focused on logic analyzers because those devices used to be expensive. Nowadays heap FX2-based boards that work with sigrok can be had for as low as $15, and there is even hardware specifically sold for this software. The scope has expanded as Sigrok can also handle analog signals and the developer consider any kind of test and measurement equipment in scope of the project; “if it can be queried or controlled, we’ll take it on“. Nowadays sigrok is a software suite for extracting data collected by various types of analyzers and displaying them or analyzing them using protocol decoder plugins.
The sigrok project aims at creating a portable, cross-platform, Free/Libre/Open-Source signal analysis software suite that supports various device types. At the current state sigrok is a portable, cross-platform, free open source signal analysis software suite that supports various device types, such as logic analyzers, MSOs, oscilloscopes, multimeters, LCR meters, sound level meters, thermometers, hygrometers, anemometers, light meters, DAQs, data loggers, function generators, spectrum analyzers, power supplies, IEEE-488 (GPIB) interfaces, and more. It supports a wide variety of hardware and many protocol decoders (new decoders can be written in Python).
This suite consists of several sub-projects:
- libsigrok: a library written in C that standardizes access to different test and measurement devices. libsigrok is a shared library written in C, which provides the basic hardware access drivers for logic analyzers and other supported devices, as well as input/output file format support.
- libsigrokdecode: a C library that provides an API for protocol decoding. The decoders are written in Python 3 and later.The libsigrokdecode library ships with a collection of various protocol decoders out of the box (but you can write your own too, of course; see Protocol decoder HOWTO and Protocol decoder API for details).
- sigrok-cli: a command line interface to manipulate sigrok.
- PulseView: a Qt GUI to manipulate sigrok.
- Fx2lafw: sigrok also provides an open source implementation of the Cypress FX2 chip firmware, which is used — among others — by Saleae in all versions of its logic analyzers except the logic Pro 16. This firmware can program the embedded logic to function as a single logic analyzer hardware.
I write in this article mostly about PulseView and sigrok-cli. They at downloadable for Linux, Windows and OS X from http://sigrok.org/wiki/Downloads. This video introduces how to use sigrok PulseView: Cheap logic analyzer + Sigrok pulseview = timesaver (LHT00SU1)
I decided to test sigrog on Windows. Sigrok provides nightly Windows installers for sigrok-cli and PulseView. PulseView is a Qt based logic analyzer, oscilloscope and MSO GUI for sigrok. PulseView can record signals from suitable device and display then nicely on the screen. PulseView software provides also decoders for many popular types of communication protocols including UART, CAN bus, I2C, SPI, JTAG, PWM, etc.
For initial testing I used first the Demo device, that generates semi-random signal you can look at without need for any hardware. I did the first tests with this Demo signal.
To be able to record real world signals, I need some supported hardware that can capture signals. Luckily I had several hardware that should be suitable. First I tried PulseView Windows to work with 8 logic channel Saelae clone device. It worked pretty much “plug and play” when I just plugged it in and selected to use FX2-based boards driver fx2lafw: Sigrok found the device with the drivers I had in my computer.
Next I tried to do the same with with USBee AX clone, that should be compatible (I think), but did not work “plug and play” as PulseView failed to find it. It seems that it would need some more work with the drivers. At the moment I did not want to mess up with the drivers as described at How to use it with PulseView (I think I would risk compatibility with some other software doing that). Maybe some later time.
Next I tried RGB LED decoder with signal captured from my WS2812 addressable LEDs test circuit.
PulseView has a quite good list of supported protocol decoders (PDs) as the libsigrokdecode library ships with a collection of various protocol decoders out of the box. If that is not enough for your special needs, you can write your own too, of course; see Protocol decoder HOWTO and Protocol decoder API for details. Every protocol decoder is a Python module and has its own subdirectory in libsigrokdecode’s decoders directory. Protocol decoder HOWTO offers a minimalistic example of how a protocol decoder looks like.
Sigrok links:
https://sigrok.org/wiki/PulseView
https://sigrok.org/wiki/Supported_hardware
http://sigrok.org/wiki/Input_output_formats
https://en.wikipedia.org/wiki/Sigrok
https://www.sigrok.org/blog/blog
Related articles on signal analysis:
Signal analysis using Sigrok blog posting tells how to install Sigrok on Ubuntu and and capture signals with command-line utilities.
Rocking with sigrok article gives introduction to using sigrok commant line tools in Linux.
Logic analyzer: visualizing latency between two digital signals in real time with sigrok and matplotlib tells how to manipulate data extracted fromlogic analyzer with Python, to view the latency between two digital signals
High-Level Automated Hardware Debugging article shows how to use logic analyzers based on the FX2 chip with sigrok to debug hardware.
Collectd Wiki Plugin:sigrok page tells that sigrok plugin is a fully fledged libsigrok client, and can use any sigrok supported hardware to feed measurements to collectd and output data to RRDtool.
Sigrok: Using Logic to Debug Logic presentation slide set from Linux Foundation event gives introduction to usign sigrok
Information on logic analyzer hardware options:
fx2lafw is an open-source firmware for Cypress FX2 chips which makes them usable as simple logic analyzer hardware. The fx2lafw firmware is meant to work on any FX2-based hardware, including logic analyzers, FX2 eval boards, or other hardware which has this chip on-board.
How to use it with PulseView article tells how to use cheap “USBEE AX” logic analyzer with PulseView on Windows (tells the tricks how to configure Windows drivers).
Hobby Components low cost 8 channel logic analyser was first dedicated hardware for sigrok. Together with sigrok’s PulseView or sigrok-cli (command line version) software you can capture up to 8 digital logic channels at sample rates up to 24MHz.
Arduino logic analyser article tells how you can turn Arduino Uno R3 board to open logic sniffer compatible device (that should be supported with sigrok). You need code from .
USB-PD Sniffer article describes a USB-PD sniffing dongle with Type-C connectors.You can use the opensource Sigrok framework to acquire and decode USB Power Delivery traces with the USB-PD dongle.
Raspberry PI Logic Sniffer project turns the Raspberry PI into a logic sniffer that is compatible with sigrok. The logic sniffer runs on “bare metal”
A BeagleBone Logic Analyzer article tells that BeagleLogic realizes a logic analyzer on the BeagleBone Black using the Programmable Real-Time units and matching firmware and Linux kernel modules on the BeagleBone Black. BeagleLogic Turns your BeagleBoard into a 14-channel 100Msps Logic Analyzer page tells that with the sigrok project, BeagleLogic gets support for software triggering and decoding a large variety of digital communication protocols.
Related postings in this blog:
http://www.epanorama.net/newepa/2012/10/10/low-cost-logic-analyzers/
http://www.epanorama.net/newepa/2010/10/26/saelae-logic-analyzer/
http://www.epanorama.net/newepa/2013/01/28/debugging-rs-232-with-logic-analyzer/
http://www.epanorama.net/newepa/2013/02/11/open-logic-sniffer-software-and-hardware/
http://www.epanorama.net/newepa/2014/06/17/ht-usbee-axpro-review/
http://www.epanorama.net/newepa/2012/10/11/diy-logic-analyzers/
78 Comments
Tomi Engdahl says:
PulseView and FM/MFM Decoder
http://www.sardis-technologies.com/ufdr/pulseview.htm
Tomi Engdahl says:
http://sigrok.org/wiki/Protocol_decoder_HOWTO
Tomi Engdahl says:
DSView is a GUI program for supporting various instruments from DreamSourceLab, including logic analyzers, oscilloscopes, etc. DSView is based on the sigrok project.
https://github.com/DreamSourceLab/DSView
Tomi Engdahl says:
https://learn.sparkfun.com/tutorials/using-the-usb-logic-analyzer-with-sigrok-pulseview/all
https://sigrok.org/wiki/PulseView
Tomi Engdahl says:
https://github.com/pico-coder/sigrok-pico
https://www.hackster.io/markkomus/using-a-raspberry-pi-pico-as-a-logic-analyzer-with-pulseview-e12543
https://hackaday.com/2022/03/02/need-a-logic-analyzer-use-your-pico/
https://forums.raspberrypi.com/viewtopic.php?t=330316
Tomi Engdahl says:
https://www.sigrok.org/blog/new-pv-tabular-decoder-output-view
Tomi Engdahl says:
https://forum.buspirate.com/t/logic-analyzer-development/86
https://jpralves.net/post/2021/02/18/using-a-raspberry-pi-pico-as-a-logic-analyzer-with-pulseview.html
https://www.hackster.io/markkomus/using-a-raspberry-pi-pico-as-a-logic-analyzer-with-pulseview-e12543
https://hackaday.com/2022/03/02/need-a-logic-analyzer-use-your-pico/
https://hackaday.io/project/190583-la-micro-logic-analyzer-for-rp2040
Tomi Engdahl says:
https://github.com/pico-coder/sigrok-pico
Tomi Engdahl says:
https://sigrok.org/wiki/Supported_hardware
Tomi Engdahl says:
https://www.cnx-software.com/2022/07/12/using-raspberry-pi-pico-as-a-logic-analyzer/#amp_tf=L%C3%A4hde%3A%20%251%24s&aoh=17075188857106&referrer=https%3A%2F%2Fwww.google.com&share=https%3A%2F%2Fwww.cnx-software.com%2F2022%2F07%2F12%2Fusing-raspberry-pi-pico-as-a-logic-analyzer%2F
Tomi Engdahl says:
Use a raspberry pi pico (rp2040) as a logic analyzer and oscilloscope with sigrok
Sigrok
https://github.com/pico-coder/sigrok-pico
pico_pgen is a simple digital function generator useful for creating patterns to test.
pico_sdk_sigrok is the pico sdk C code for the PICO RP2040 device.
The latest libsigrok code exists as a fork at https://github.com/pico-coder/libsigrok
This is an unofficial Pulseview windows installer to use the raspberry pi pico on windows.
https://github.com/pico-coder/sigrok-pico/tree/main/pulseview
https://github.com/pico-coder/sigrok-pico/blob/main/PICOBuildNotes.md
Other project
https://www.cnx-software.com/2022/07/12/using-raspberry-pi-pico-as-a-logic-analyzer/
https://github.com/gusmanb/logicanalyzer
Tomi Engdahl says:
https://kentindell.github.io/2021/01/02/can2-wireshark/
Last year we published a blog post that described the new can2 CAN protocol decoder for many logic analyzers supported by Sigrok we have now updated it to include a new binary output where CAN frames (including error frames) are output in pcapng format. This is a packet capture format that the hugely popular network capture and analysis tool Wireshark uses.
There’s loads of support for Wireshark (including a set of tools from CSS Electronics that can take CAN DBC files and display decoded sensor values). And built into Wireshark is a protocol dissector for CAN frames that that have been captured using a Linux SocketCAN driver. Normally these CAN frames would come from a CAN controller interfaced via USB or SPI (e.g. the popular SKPang PiCAN2 for the Raspberry Pi). But with the can2 protocol decoder they can now come from a logic analyzer.
Tomi Engdahl says:
https://github.com/gillham/logic_analyzer
Tomi Engdahl says:
SUMP Compatible ESP32 Logic Analyzer with RLE
https://esp32.com/viewtopic.php?t=14135
Tomi Engdahl says:
https://www.pschatzmann.ch/home/2021/04/20/a-flexible-arduino-sump-logic-analyzer-library/
Tomi Engdahl says:
Pulse View : Exporting digital signal timing in text file | Pulse duration | Embedded System
https://www.youtube.com/watch?v=u5sBKwxFs-4
This tutorial demonstrates how to utilize PulseView software to visualize and export digital signal ON/OFF times in a text file format.
Tomi Engdahl says:
Logic Analyzer with Pulseview Linux
https://www.youtube.com/watch?v=BQ4RTsKtYHU
Using a cheap logic analyzer with a linux laptop and Pulseview software on a wireless thermostat.
Tomi Engdahl says:
Setting up a cheap Logic Analyser (CY7C68013A) in Windows
https://www.youtube.com/watch?v=c3HsBJWpB9Q
Tomi Engdahl says:
https://github.com/cbdevnet/libsigrokdecode
Decoders for sigrok & pulseview
Tomi Engdahl says:
https://www.sigrok.org/blog/even-more-pulseview-features-you-might-have-missed
Tomi Engdahl says:
[011] USB Debugging with sigrok
https://www.youtube.com/watch?v=4FOkJLp_PUw
Advanced USB packet capture with logic analyzers and sigrok.
Tomi Engdahl says:
PulseView and CAN decoder demo
https://www.youtube.com/watch?v=RvExJSDvhKo
Tomi Engdahl says:
How to import .csv file using Pulse View?
https://electronics.stackexchange.com/questions/585370/how-to-import-csv-file-using-pulse-view
Export logic analyzer data to protocol analyzer
https://reverseengineering.stackexchange.com/questions/22656/export-logic-analyzer-data-to-protocol-analyzer
Tomi Engdahl says:
test
Tomi Engdahl says:
https://hackaday.com/2024/04/15/logic-analyzers-decoding-and-monitoring/
Tomi Engdahl says:
Reverse Engineering Smart TV Remote with Logic Analyzer
https://www.youtube.com/watch?v=AwhF2enymhs
Tomi Engdahl says:
Extracting Firmware from Embedded Devices (SPI NOR Flash)
https://www.youtube.com/watch?v=nruUuDalNR0&t=472s
Tomi Engdahl says:
Intro to Hardware Reversing: Finding a UART and getting a shell
https://www.youtube.com/watch?v=ZmZuKA-Rst0