abhishek-kakkar/BeagleLogic

Building sigrok?

Closed this issue · 24 comments

Hi, I got some problem with building sigrok.
Description of what I did, on an Ubuntu 12.04 LTS System:

Install add-apt-repository

sudo apt-get install python-software-properties

Add repositorys

sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) main universe restricted multiverse"

Update package lists

sudo apt-get update

Get Sigrok and Build Dependencies

sudo apt-get install gcc-arm-linux-gnueabihf autotools-dev
git-core gcc g++ make autoconf autoconf-archive
automake libtool pkg-config libglib2.0-dev libglibmm-2.4-dev libzip-dev
libusb-1.0-0-dev libftdi-dev check doxygen
python-dev python-gi-dev python-setuptools swig default-jdk
python3-dev

Get BeagleLogic

cd ~
git clone https://github.com/abhishek-kakkar/BeagleLogic/

Get Arm Dependencies

cd ~/BeagleLogic/
wget https://d8a0b5d606f320db2dca525de17833da935fbbb0.googledrive.com/host/0B7U2bJEjkNeZSVVBMFU4WVBkS2c/sigrok-arm-libraries.tar.gz
tar -xvzf sigrok-arm-libraries.tar.gz

Get Sigrok

cd ~/BeagleLogic/
git clone git://sigrok.org/libserialport
git clone git://sigrok.org/libsigrok
git clone git://sigrok.org/libsigrokdecode
git clone git://sigrok.org/sigrok-cli

Build sigrok

cd ~/BeagleLogic/
sudo ./sigrok-build-beaglebone

After I start building, I get following erroR:

CC src/hardware/tondaj-sl-814/protocol.lo
CC src/hardware/tondaj-sl-814/api.lo
CC src/hardware/yokogawa-dlm/protocol.lo
CC src/hardware/yokogawa-dlm/protocol_wrappers.lo
CC src/hardware/yokogawa-dlm/api.lo
CCLD libsigrok.la
libtool: link: warning: library /home/pi/BeagleLogic/usr/lib/libserialport.la' was moved. /usr/lib/gcc/arm-linux-gnueabihf/4.6/../../../../arm-linux-gnueabihf/bin/ld: /home/pi/BeagleLogic/usr/lib/arm-linux-gnueabihf/libglib-2.0.a(gbytes.o): relocation R_ARM_THM_MOVW_ABS_NC againstg_free' can not be used when making a shared object; recompile with -fPIC
/home/pi/BeagleLogic/usr/lib/arm-linux-gnueabihf/libglib-2.0.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[1]: *** [libsigrok.la] Error 1
make: *** [all] Error 2

Any idea how to fix that?

Thanks

Hi,

It seems that it's trying to link statically, this isn't expected behavior.
sigrok-build-beaglebone isn't meant to be run as root as it just cross-compiles. I suspect it might be the issue.

I just tested the script on a clean directory tree and libsigrok does compile for me. You might want to run and check the script as non-root.

OK, now I got this error:

libsigrok configuration summary:

  • Package version (major.minor.micro): 0.3.0
  • Library version (current:revision:age): 2:0:0
  • Prefix: /usr
  • Building on: i686-pc-linux-gnu
  • Building for: arm-unknown-linux-gnueabihf

Detected libraries:

  • (REQUIRED) glib-2.0 >= 2.34.0: no
  • (REQUIRED) libzip >= 0.10: yes (0.10.1)
  • (OPTIONAL) libserialport >= 0.2.0: yes (0.2.0)
  • (OPTIONAL) librevisa >= 0.0.20130812: no
  • (OPTIONAL) libusb-1.0 >= 1.0.16: no
  • (OPTIONAL) libftdi >= 0.16: no
  • (OPTIONAL) libftdi1 >= 1.0: no
  • (OPTIONAL) libgpib: no
  • (OPTIONAL) glibmm-2.4 >= 2.32.0: no
  • (OPTIONAL) pygobject-3.0 >= 3.0.0: no
  • (OPTIONAL) check >= 0.9.4: no

Enabled hardware drivers:

  • agilent-dmm..................... yes
  • appa-55ii....................... yes
  • asix-sigma...................... no
  • atten-pps3xxx................... yes
  • beaglelogic..................... yes
  • brymen-bm86x.................... no
  • brymen-dmm...................... yes
  • cem-dt-885x..................... yes
  • center-3xx...................... yes
  • chronovu-la..................... no
  • colead-slm...................... yes
  • conrad-digi-35-cpu.............. yes
  • demo............................ yes
  • fluke-dmm....................... yes
  • fx2lafw......................... no
  • gmc-mh-1x-2x.................... yes
  • hameg-hmo....................... yes
  • hantek-dso...................... no
  • ikalogic-scanalogic2............ no
  • ikalogic-scanaplus.............. no
  • kecheng-kc-330b................. no
  • lascar-el-usb................... no
  • manson-hcs-3xxx................. yes
  • mic-985xx....................... yes
  • motech-lps-30x.................. yes
  • norma-dmm....................... yes
  • openbench-logic-sniffer......... yes
  • pipistrello-ols................. no
  • rigol-ds........................ yes
  • saleae-logic16.................. no
  • scpi-pps........................ yes
  • serial-dmm...................... yes
  • sysclk-lwla..................... no
  • teleinfo........................ yes
  • testo........................... no
  • tondaj-sl-814................... yes
  • uni-t-dmm....................... no
  • uni-t-ut32x..................... no
  • victor-dmm...................... no
  • yokogawa-dlm.................... yes
  • zeroplus-logic-cube............. no

Enabled SCPI backends:

  • TCP............................. yes
  • RPC............................. yes
  • serial.......................... yes
  • VISA............................ no
  • GPIB............................ no
  • USBTMC.......................... no

Enabled language bindings:

  • C++............................. no (glibmm required)
  • Python.......................... no (C++ bindings required)
  • Java............................ no (C++ bindings required)

make all-am
CC src/serial.lo
src/serial.c:24:18: fatal error: glib.h: No such file or directory
compilation terminated.
CC src/backend.lo
CC src/device.lo
CC src/session.lo
CC src/session_file.lo
CC src/session_driver.lo
CC src/drivers.lo
CC src/hwdriver.lo
CC src/trigger.lo
CC src/soft-trigger.lo
CC src/strutil.lo
CC src/log.lo
make[1]: *** [src/serial.lo] Error 1
make[1]: *** Waiting for unfinished jobs....
CC src/version.lo
In file included from src/trigger.c:20:0:
include/libsigrok/libsigrok.h:27:18: fatal error: glib.h: No such file or directory
src/hwdriver.c:25:18: fatal error: glib.h: No such file or directory
compilation terminated.
compilation terminated.
src/session.c:24:18: fatal error: glib.h: No such file or directory
compilation terminated.
src/device.c:21:18: fatal error: glib.h: No such file or directory
compilation terminated.
src/session_file.c:27:18: fatal error: glib.h: No such file or directory
compilation terminated.
In file included from src/session_driver.c:26:0:
include/libsigrok/libsigrok.h:27:18: fatal error: glib.h: No such file or directory
compilation terminated.
In file included from src/soft-trigger.c:21:0:
include/libsigrok/libsigrok.h:27:18: fatal error: glib.h: No such file or directory
compilation terminated.
In file included from src/version.c:21:0:
include/libsigrok/libsigrok.h:27:18: fatal error: glib.h: No such file or directory
compilation terminated.
In file included from src/log.c:23:0:
include/libsigrok/libsigrok.h:27:18: fatal error: glib.h: No such file or directory
compilation terminated.
src/backend.c:21:18: fatal error: glib.h: No such file or directory
compilation terminated.
In file included from src/strutil.c:25:0:
include/libsigrok/libsigrok.h:27:18: fatal error: glib.h: No such file or directory
compilation terminated.
In file included from src/drivers.c:20:0:
include/libsigrok/libsigrok.h:27:18: fatal error: glib.h: No such file or directory
compilation terminated.
make[1]: *** [src/device.lo] Error 1
make[1]: *** [src/trigger.lo] Error 1
make[1]: *** [src/log.lo] Error 1
make[1]: *** [src/hwdriver.lo] Error 1
make[1]: *** [src/backend.lo] Error 1
make[1]: *** [src/session.lo] Error 1
make[1]: *** [src/session_driver.lo] Error 1
make[1]: *** [src/version.lo] Error 1
make[1]: *** [src/session_file.lo] Error 1
make[1]: *** [src/strutil.lo] Error 1
make[1]: *** [src/drivers.lo] Error 1
make[1]: *** [src/soft-trigger.lo] Error 1
make: *** [all] Error 2

However, I have libglib-2.0-dev and glib-2.0 installed...
Which Linux Version do you use as build system?

Thanks a lot

I use Ubuntu 14.04 LTS to build and debug.

It seems that the GLib version I bundle in the library package (the tar.gz file) is now outdated as the minimum required version of GLib is 2.34 while the GLib version bundled with Debian Wheezy is just 2.32. You might need to build glib-2.0 from source now.

It does not matter the version of libglib2.0-dev and glib-2.0 you have on your system as you are merely cross-compiling and it is the version of the arch:arm libraries that matter. So you could get the arch:arm libraries using apt-get and extract the newer version of glib libraries and place them in ~/BeagleLogic/usr/lib ; ~/BeagleLogic/usr/include ; ~/BeagleLogic/usr/include/glib-2.0

There are some environment variables that need to be set before the make and that is why it is recommended only to use the ./sigrok-build-beaglebone command to build the library, otherwise build would fail. You can see the script to check which env vars are set.

The build breaks for me as well for the moment, and I would be looking into the issue. But for the moment you could try getting hold of a newer version of arch:arm libglib-2.0-dev package and get the files from there.

well, i'm in the same hot place at the moment and found out that some way I ended up having a arm-linux-gnueabihf directory in my Beaglelogic dir containing softlinks from for example libexpat.so to a non existant dir: /home/abhishek/BeagleLogic/usr/lib/arm-linux-gnueabihf/libexpat.so.1.6.0

there is no user abhishek on my system. :-)

are there compiled binaries around to download? github? somewhere?

The library folder is due for updates, and I haven't been able to get around this lately, though a more permanent solution is to get the sigrok package in the Debian repository updated.

I have uploaded my last built sigrok binaries here. Inside the deploy folder there's a /usr folder which will be have to merged with the corresponding folder in the BB rootfs.

Please let me know if it works for you.

Hey thanks!this is a really great project. unfortunately also the
beginning of my cross-compiling skills. :-( we will be using the
beaglelogic to fix old computers in out museum at hack42.nl

https://hack42.nl/wiki/Museum

my idea is to put the bbb wifi in a box and use our phone as a display.
I'm working on the hw side now to make the inputs a little more robust.

simon

On 31-10-14 13:36, Kumar Abhishek wrote:

The library folder is due for updates, and I haven't been able to get
around this lately, though a more permanent solution is to get the
sigrok package in the Debian repository updated.

I have uploaded my last built sigrok binaries here
https://drive.google.com/file/d/0B7U2bJEjkNeZRkxsZ2thWXRHbUk/view?usp=sharing.
Inside the deploy folder there's a /usr folder which will be have to
merged with the corresponding folder in the BB rootfs.


Reply to this email directly or view it on GitHub
#3 (comment).

Met vriendelijke Groet,

Simon Claessen
drukknop.nl

I did deploy your prebuild libs (which worked) - but I can't use sigrok.
After some debugging, I tried to use sigrok-cli "by hand" and got this error:
sigrok-cli: error while loading shared libraries: libzip.so.2: cannot open shared object file: No such file or directory
Seems like not all depencies had been copied to the BB / been in the deploy.tar.bz2...

OK the needed files can be installed by executing
sudo apt-get install libzip2 libpython3.2

I can now capture data - however, there is no way to get them back to the pc via the webserver. Save Capture or Dump Raw Data don't do anything... Any idea? :)

The deploy tarball only includes the libraries built using sigrok. Dependencies like glib-2.0, python and libzip have to be installed separately as you correctly did. This works because this set binaries are compatible with glib version 2.24 which is present on the Debian system image while the newer versions of sigrok have bumped this requirement to glib v2.28 IIRC.

Currently you can save the page using Save Page as... once you capture your data and you can view the capture by opening the saved page.

To get reusable data as of now, sigrok-cli will have to be run on the BBB to collect data in the .sr format and then the files will have to be copied to your pc where you could process them further or view them with PulseView.

This issue will be finally closed in December when BeagleLogic will be available as a ready-to-install Debian package, and I will have also implemented properly the save and raw data functionality in the web interface by that time. For now, there is only a temporary workaround in the attachment that I have posted here.

For everyone, to get the last pre-built sigrok binaries with BeagleLogic support until this issue is closed:

  • Please obtain deploy.tar.gz using this link.
  • Merge the /usr folder inside the deploy folder with the rootfs of your BBB.

Hello Abhishek,

thanks. my effords were on hold the last week due to a very busy
shedule. hopefully i can take on the project again this week.

simon

On 08-11-14 09:02, Kumar Abhishek wrote:

For everyone, to get the last pre-built sigrok binaries with BeagleLogic
support until this issue is closed:


Reply to this email directly or view it on GitHub
#3 (comment).

Met vriendelijke Groet,

Simon Claessen
drukknop.nl

Hello Abhishek,

its working! Finally I had time to do a complete reinstall on a sd card
and merging this deploy and doing the steps outlined on your github site.

one thing I noticed is that if I use the webinterface on port 4000 i can
only sucessful do a probe with ports 8.39 to 8.46. every other port
results in a 0 byte capture and a exit 1 from sigrok-cli. manually
changing the sampleunit did not change the problem:

sudo echo 1 > /sys/devices/virtual/misc/beaglelogic/sampleunit

I think I have disabled both hdmi and emmc virtual capes in
/boot/uboot/uEnv.txt:
##BeagleBone Black:
##Disable HDMI/eMMC
cape_disable=capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN,BB-BONE-EMMC-2G

but have not find out how to check that.

my system:

BBB rev A5C running RCN-ee debian 3.8.13-bone68 from a 16Gb sd card.

question:
if invoking beaglelogic from the cli, how do i pass the pins to sample?

I am building a input buffercape based on two 74lvc245 buffer chips.
they convert 5v logic to 3.3 for the BBB and there will be a switch to
float the pins going to the bbb for reboot purouses. In a later stadium
i want to control that via a extra gpio so software will enable the
inputs to Beaglelogic. and I was thinking in configuring a extra pin to
initiate a next probe-session. then i can make a small box with just 15
pins (one ground) and a pushbutton to grab data and use a phone as a
screen. I could design a cape in kicad afterwards containing all the
ports, leds and switches

simon from The Netherlands

anyway, Thanks for the efforts to build this beautiful setup

On 08-11-14 09:02, Kumar Abhishek wrote:

For everyone, to get the last pre-built sigrok binaries with BeagleLogic
support until this issue is closed:


Reply to this email directly or view it on GitHub
#3 (comment).

Met vriendelijke Groet,

Simon Claessen
drukknop.nl

You're right, both the capes need to be disabled for you in order to be able to use the pins physically but it is possible to sample those pins right away.

I just checked the Node.JS app, it needs a minor fix in order to use all the 14 channels. I'll fix it this weekend.

P.S. I've been working on a official cape design for BeagleLogic :) More details on my blog very soon.

Cool! i'm very curious.

another thing i noticed was that although i changed the index.html to
include low sampling rates as 10khz, 1khz, 100Hz, they dont seem to work.

I need the low sampling rates to capture mechanical generated parallel
pulses in a Olivetti Programma 101 and for the corememory in a Digital
PDP8/f, both in our museum at hack42.nl and both 12bit data (although
the 101 has a serial magnetorestrictive memory, the input is 12bit)

thanks

On 25-11-14 17:19, Kumar Abhishek wrote:

You're right, both the capes need to be disabled for you in order to be
able to use the pins physically but it is possible to sample those pins
right away.

I just checked the Node.JS app, it needs a minor fix in order to use all
the 14 channels. I'll fix it this weekend.

P.S. I've been working on a official cape design for BeagleLogic :) More
details on my blog very soon.


Reply to this email directly or view it on GitHub
#3 (comment).

Met vriendelijke Groet,

Simon Claessen
drukknop.nl

It does, although you would need to wait quite a while in order to use them, as it returns 4 MB of samples at a time, so for example at 10 kHz, 4194304/10000 = 420 seconds i.e. it will return the samples after 7 minutes. At higher sample rates this delay isn't perceptible, but will be a lot of time in case of lower sampling rates.

At the moment, it is recommended to use a sample rate high enough to reduce this time delay, while still keeping reasonable storage space.

as on taking samples:

if i use dd if=/dev/beaglelogic etc.

how do i specify the pins to use, or is this a catch-all system and
filtering is in post?

i decided to use pulseview on my local machine to analize the data,
although i really like the idea of a webbased interface on the beagle

On 25-11-14 18:25, Kumar Abhishek wrote:

It does, although you would need to wait quite a while in order to use
them, as it returns 4 MB of samples at a time, so for example at 10 kHz,
4194304/10000 = 420 seconds i.e. it will return the samples after 7
minutes. At higher sample rates this delay isn't perceptible, but will
be a lot of time in case of lower sampling rates.

At the moment, it is recommended to use a sample rate high enough to
reduce this time delay, while still keeping reasonable storage space.


Reply to this email directly or view it on GitHub
#3 (comment).

Met vriendelijke Groet,

Simon Claessen
drukknop.nl

and as a follow up on the previous question: how do i postprocess with sigrok-cli and pulseview. what do i fill in after the sigrok-cli -d option. sigrok will be running on my desktop machine.

I'm doing a wiki page on this one. Should be up shortly, but in the meantime, try with something like this:

sigrok-cli -I binary -i file.raw -o file.sr

Ah, binary. thats the one! i will feed the sr to pulseview

This issue is up for fixing now. Comments are closed.

Please open a new issue if needed, or, for general questions, please use the BeagleBoard discussion forum (http://beagleboard.org/Community/Forums) and put me in CC [ abhishek at theembeddedkitchen dot net ].

It's been a long time since I replied here. For all those monitoring this issue, I'll be testing BeagleLogic on Debian Jessie soon. Since it has updated version of the core libraries so once I am able to package and move everything, you can compile the latest version of libsigrok on the BeagleBone Black, and then I can close this long standing issue.

Also, I plan to get a "BeagleLogic edition" Debian Jessie system image released soon, so you can run BeagleLogic out-of-the box by flashing the image onto the eMMC/SD Card.

The newer version of sigrok libraries compile fine on the Debian Jessie on the BeagleBone Black, this issue is fixed as they have the latest libraries now.

I've also released the BeagleLogic System Image, which can be flashed to a microSD card and used to run BeagleLogic. Download and read more about it here

This issue is now closed.