2017-05-28

Compiling Sigrok and Pulseview on a Beaglebone Black

One of my current projects is to use a BeagleBone Black as logic analyzer. The BeagleLocig project I’m using suggests to transfer the capture files to a PC and use the Pulseview application for viewing. But instead I would like to run Pulseview on the BBB itself, so I can using it directly for configuring the capture process and for viewing the results.

Since it took a while to get the compilation to run through, I want to document the the process.

Installation

You need a SD card with at leat 8GB, and it should be fairly fast.

  • Download the BeagleLogic image from the BeagleLogic page
  • extract using 7z
  • write to a SD card, using dd: sudo dd if=bone-debian-8.4-lxqt-4gb-armhf-2016-04-10-4gb.img of=/dev/sde bs=1M status=progress
    • make sure to replace ‘sde’ with the correct device for the SD card!
    • on Windows, use a similar tool to do that
  • insert the SD card in the BBB, press the ‘boot’ button and power it on (reset won’t work, the is only checked during power-on)
  • connect via SSH to the BBB

Preparation

First. follow the guide to resize the file system (but instead of the reboot, use the ‘partprobe’ command to reload the partition table)

Then create a swap file, since 512MB is not enough main memory for compiling the code (as root):

dd if=/dev/zero of=/swapfile bs=1M count=2028 status=progress
mkswap /swapfile
chown root:root /swapfile
chmod 0600 /swapfile 
swapon /swapfile
free -m

(The last command should show that there are 2GB swap space available)

Also, disable some services which are not needed and eat up memory (again, as root):

/etc/init.d/haveged stop
/etc/init.d/apache2 stop
/etc/init.d/avahi-daemon stop
killall jekyll nodejs

You can also remove them using the ‘apt’ package manager.

Compilation

For repeatability, I created a shell script to run the compilation process:

echo "retrieving needed packages"
apt install git-core gcc g++ make autoconf autoconf-archive automake libtool pkg-config libglib2.0-dev \
libglibmm-2.4-dev libzip-dev doxygen python3-dev cmake libqt4-dev libboost-test-dev libboost-thread-dev \
libboost-filesystem-dev libboost-system-dev libqt5svg5-dev qtbase5-dev

echo "retrieving sources"
cd /opt
mkdir bl
cd bl
git clone git://sigrok.org/libsigrok.git
git clone git://sigrok.org/libserialport.git
git clone git://sigrok.org/libsigrokdecode.git
git clone git://sigrok.org/sigrok-cli
git clone git://sigrok.org/pulseview.git

echo "build libserialport"
cd libserialport
./autogen.sh && ./configure --prefix=/usr && make && make install
cd ..

echo "build libsigrok"
cd libsigrok
./autogen.sh && ./configure --prefix=/usr && make && make install
cd ..

echo "build libsigrokdecode"
cd libsigrokdecode
./autogen.sh && ./configure --prefix=/usr && make && make install
cd ..

echo "build sigrok-cli"
cd sigrok-cli
./autogen.sh && ./configure --prefix=/usr && make && make install
cd ..

echo "building pulseview"
cd pulseview
cmake -DCMAKE_INSTALL_PREFIX=/usr .
make
make install
Posted by Hendrik Lipka at 2017-05-28 (Google)
Categories: electronics