[BBB, PRU, libpruio] Segmentation fault during debug

Hi everybody!

I have a Beaglebone Black running the last Debian image and for my current project I need to cross-compile it with Eclipse from my WIndows OS.
In oiorder to get ‘acquainted’ with the PRUs I’m trying to run the 1.c example included in the libruio library.

I’ve followed the instructions posted here by Rafael Vega and I’m able to build the project but when debugging I get first this errors:

No source available for “0x0”
gdbserver: Unexpected missing PT_PHDR

Scrolling through the gdb traces I’ve found:

*stopped,reason=“signal-received”,signal-name=“SIGSEGV”,signal-meaning=“Segmentation fault”,
frame={addr=“0x00000000”,func="??",args=[]},thread-id=“1”,stopped-threads=“all”,core=“0”

Does someone have any idea what I’m missing or what kind of mistake I’m doing?

Regards
Valeria

I have a Beaglebone Black running the last Debian image and for my current project I need to cross-compile it with Eclipse from my WIndows OS.
In oiorder to get ‘acquainted’ with the PRUs I’m trying to run the 1.c example included in the libruio library.

First of all, you cannot compile anything with eclipse. It is an IDE, not a compiler. Let alone cross compile.

But . . . cross compile WHAT ?

Ok, I use Eclipse with the gnu arm toolchain. For crosscompiling I'll use cross GCC.
For my C/C++ project I will need to control the ADC sampling vusig the PRUs, so right now I'm still trying to understand how PRUs can be programmed and used using the example in libpruio called 1.c

Ok, I use Eclipse with the gnu arm toolchain. For crosscompiling I’ll use cross GCC.
For my C/C++ project I will need to control the ADC sampling vusig the PRUs, so right now I’m still trying to understand how PRUs can be programmed and used using the example in libpruio called 1.c

Ok. So as far as I know there is no Windows cross toolchain for the PRU.

You might be able to use the Linux compiler on Windows using cygwin - But surely that would be asking for trouble on multiple levels. However, even if it were possible, you may as well use Linux anyhow. Your options:

  • Use Linux on dedicated hardware.
  • Use Linux on virtualized hardware ( virtual machine ).
  • Attempt to use cygwin on Windows.

Personally, I use both dedicated hardware, and virtualized hardware. Both have their attractions. In fact, right now I’m using both, but developing software on an i386 debian virtual machine. Simply because compiling on an i386 Debian virtual machine is faster, and more convenient than dedicated hardware - for the moment.

I still write my code in an editor running in Windows 8.1, and I use samba - So I can treat the files I work with as local files. Except they’re not local, they’re remote :slight_smile:

Anyway - No doubt this has created more questions than it answered ?

Actually, I’m not even sure there is a cross toolchain / compiler for the PRU’s. Honestly I never looked into that. But if you mean for the Linux side of things there are multiple options. Those that I mentioned above- And I believe Linaro has a Windows gcc port. I’ve set that up myself a couple years ago as a proof of concept. But never perused it passed compiling your basic hello world executable.

Sorry, I keep of thinking more to add, after I’ve already posted . . . I’ve got code on the brain, and sometimes to think outside of my own little world . . .

For the Linux side of things. The easiest, and possibly best route would be to use a flavor of Ubuntu 14.x. The reasoning is simple. Ubuntu has precompiled toolchains for just about many ARM envoirnment - That “just work”

Derrek Molloy even has a few videos of setting up cross toolchains, using eclipse on Debian, and Ubuntu. Using armhf, and armel ABI’s. armhf by the way is the ABI you’re going to want.

What about PRU C compiler? From what I gathered it should be able to be used from a Windows environment as well, the only assle is that is for bare metal application.
I think the easiest way to proceed would be using a VM… all the example and tutorial I’ve found online are mostly for a Linux OS D:

look back there is a working program that I posted; blinks the user LEDS
the way i have it working

  1. cross compile the GCC(eclipse) program from windows → bbb
  2. PRU compile the asm on the BBB via terminal.

Debug does work through eclipse.

If anyone gets the PRU to cross compile would be great, re the PRU-C find it more complicated than the asm, but thats my opinion from looking at the source codes.

make the the BBB has the cross compiled program and the pru in the same directory (watch yours paths).