PRU Cross compile with libpruio


I just find out a wonderful library: libpruio. So I have tried to use it on the BBB, which works well.
So I have, decided to do new example, nevertheless, I choose to try to develop them from my VM Linux and then send it into the board.
However, I didn’t succeed to compiled.

So I have, tried to compile example provided in the library: the button.c.
First, I want to do it on Eclipse, which is nicer to develop application.
I also tried to do it manually to see if the error came from the configuration.

However, in both cases I’ve got the same error:

collect2: fatal error: ld terminated with signal 11 [Segmentation fault]

But, when I try to do the same on the BBB it works.

So I assumed, that it’s maybe link with my VM architecture, in fact:

$ uname -a Linux mppdev 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt20-1+deb8u4 (2016-02-29) x86_64 GNU/Linux

So it is an 64 bit one. In addition,

$file libpruio ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, stripped

So it means that it is a 32 library.

So my questions are:
Is there a way to re-build the libpruio for use it on a 64 architecture or something else which will make me cross compile a program with the libpruio from my VM
to the BBB which has the following configuration:

root@beagle01:~# uname -a Linux beagle01 4.1.21-bone-rt-r20 #1 Wed Apr 6 19:53:34 UTC 2016 armv7l GNU/Linux

Or is it impossible to do such thing?
Or is my Segmentation fault link to something else?

I give you in attachment the full description of the building message

Remark :

$ lsb_release -da No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux 8.3 (jessie) Release: 8.3 Codename: jessie
I have already succeed to cross compiled programs on my VM into the BB ( but without the libpruio).
libpruio presentation and download:

Thanks by advance

“Enjoy life no matter what !”

compiling messages.txt (14.6 KB)


Even if you find a way to cross compile, you cannot test on your VM since there’s no PRU. So why not compile where you (have to) test?

BTW: libpruio-0.2 has some limitations on kernel versions > 3.8 (due to sysfs changes).



I know that I can not test is on the VM but with Eclipse I can send it through ssh directly on the BBB,
it will help me to use GDB do debug if I need to.
Moreover, personally I find it more convenient to use IDE to develop code than do it with vim or nano on the board.
That’s why I want to cross compile.

Can you tell me a little bit more about the limitation ? Or a link where I can find some detail please.

With Geany you can edit the code on your PC, load and save it over ethernet to the BBB. Then compile and test (and GDB for the ARM code) on the BBB via SSH.

The kernel 4.x limitation is that the run-time pinmuxing does not work (since the paths in the sysfs changed). You can set the pins before you start any application (ie. example stepper), but it’s additional effort.


Thanks for your information.

Just to informed you, I have succeed to cross-compiled with libpruio-0.2 library, to do so, I have :

  1. Install a 32bit linux (Debian 3.16.7-ckt25-2 (2016-04-08) i686 GNU/Linux)
  2. I have install Eclipse version mars 2 for linux 32 bits.
  3. I have download the gcc-linaro-arm-linux-gnueabihf-4.8-2014.04_linux
  4. I had to add et respectivy found in the am335x_pru_package and armhf deb
  5. Then normally configure Eclipse to make it work as a C/C++ Remote Application


Fine, thanks for the info!

But you cannot test nor debug on the PC, right?

If I only use C, I can test and Debug on the PC.
Just to be clear, it’s not a real test on the PC in the way that’s I’m using the functionality “Remote application” in Eclipse, so the code is compiled and linked in Eclipse on your PC,
then, it’s send into the board. After that, the program can be launch on the board with and without the debug (with gdb of the gcc-linaro) mode from your eclipse window, in your PC.

So, everything can be done form your PC without manually launching or debugging it on the board.
Does that sound clear ?