Using BeagleLogic: Post processing
Clone this wiki locally
There are two ways of analyzing raw data using BeagleLogic and sigrok:
- Using /dev/beaglelogic
- Using sigrok-cli with the 'beaglelogic' driver
1. /dev/beaglelogic (processing on the host PC)
In this approach, data is directly from the BeagleLogic kernel driver. This is recommended when using BeagleLogic to sample at the highest possible sample rate i.e. 100MHz, 16-bit samples. There is no hardware triggering, capture begins as soon as a read() is requested from /dev/beaglelogic [Soft-triggering is realized when using BeagleLogic from within sigrok].
The output file contains raw samples (no metadata) in Little-Endian format. For 8-bit samples it is (obviously) one byte per sample and if 16-bit samples then it is first 8 bits of sample 1, higher 8 bits (out of which only 6 available) of sample 1, next sample byte and so on.
To process the data, the samplerate and bit depth need to be known as well.
Once the sample rate and capture size (8-bit or 16-bit) have been configured using the sysfs attributes:
The recommended command lines are:
dd if=/dev/beaglelogic bs=262144 count=1 of=capture.raw dd if=/dev/beaglelogic bs=262144 count=1 | lzop > capture.lzo
Adjust count and bs as required. LZO and LZ4 work well and have been tested.
The raw file is copied to the PC using scp/SFTP for further processing.
The sigrok-cli command line to be used to process these samples is as follows:
sigrok-cli -I binary:numchannels=[8 or 16]:samplerate=[samplerate] -i <input binary file> -o <outputfile>.sr
The sr file so generated is a compressed version of the original binary file and can then be visualized on PulseView or further processed.
Note that it is not necessary that the data need be converted to the sr format for processing. Protocol decoders can directly be executed on the raw binary data as well. Data can also be exported in other formats like VCD using `-O vcd'
2. sigrok (processing on the Bone)
The sigrok driver 'beaglelogic' is used to interface with sigrok running on the BeagleBone Black.
In this use case, sigrok interacts with /dev/beaglelogic directly. One of the advantages is that software triggering is possible using the sigrok API, and is really a nice feature to have.
This is how sigrok-cli is used to sample from the BeagleBone. This is really a very simple use case, for examples on protocol decoding, stacking and channel selection you can refer to the sigrok documentation.
sigrok-cli -d beaglelogic -c samplerate=<samplerate> -o outputfile.sr
Now, the file can be copied to the PC and viewed in PulseView or processed.