Beagle Bone Black - trouble in setting-up the PRU (C++)

49 views
Skip to first unread message

fred.p....@gmail.com

unread,
Oct 22, 2018, 5:13:05 PM10/22/18
to BeagleBoard
Hi guys,

I need your help, the situation is the follows:

I need to set up the beagle bone as  SPI slave for reading data of a sensor, and since the kernel GPIO functions do not support very high frequencies I need to do that using the PRU. I am developing my application in C++ and I found this link which seems to be what I want: https://github.com/giuliomoro/bb-pru-spi-duplex


However, I got stuck from the very beginning;  for what I've read, I have to install the prussdrv library by hand, I download it here:  https://github.com/beagleboard/am335x_pru_package and follow the steps mentioned here: http://mythopoeic.org/bbb-pru-minimal/ (section "Development tools"). After getting the library at "/usr/include" the C++ application can't still find it.

Anyone can give me a tip about what am I doing wrong?

Best regards,
Fred Gomes

Gerhard Hoffmann

unread,
Oct 22, 2018, 5:28:15 PM10/22/18
to beagl...@googlegroups.com

Hi,

I have no experience with c++ on the bbb, but for C, I had to

put the fftw libraries into /usr/local/include so that they could be found.


BTW I have also tried to connect  a LTC2500-32 ADC to a BBB SPI master

and I lost so much time over it that I programmed the existing Xilinx

Coolrunner2 to receive the SPI at 100 MHz and now I read them via

R30/31 of PRU1 bytewise. Getting all 32 bits takes 110 ns including

shifting & rebuilding the int32.

regards, Gerhard




Am 22.10.18 um 19:52 schrieb fred.p....@gmail.com:
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/bdd34b98-e00a-4574-8689-9a51f45efb00%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Gerhard Hoffmann

unread,
Oct 22, 2018, 5:42:37 PM10/22/18
to beagl...@googlegroups.com
... and /usr/local/lib

Am 22.10.18 um 23:28 schrieb Gerhard Hoffmann:
>

Fred Gomes

unread,
Oct 23, 2018, 4:35:02 AM10/23/18
to beagl...@googlegroups.com
Good morning Gerhard,

Thank you very much for your response, 

I did that but surprisingly when I try to include the library in my C++ application it can't find the libraries, although they are in the correct folders (namely "usr/lib" and "usr/include"). O followed the steps mentioned here: https://www.npmjs.com/package/pru#driver-library-and-assembler in the  "Driver and assembler" section this time, but it still kept not working. 

Did you find any different from what you've done there? Or rather have any inkling for what I may be doing wrong?

Thank you very much,
--Fred Gomes


Fred Gomes

unread,
Oct 23, 2018, 6:25:34 AM10/23/18
to beagl...@googlegroups.com
I already could solve the errors of the libraries. I didn't catch on very well what was happening, but after doing it again and reboot the Visual Studio it started to work. 

Can you show me your SPI assembly file to run in the PRU, please? The one I am using from here:  https://github.com/giuliomoro/bb-pru-spi-duplex seems to not being compiling :/  . When I do "pasm -b fileName.p"  to generate the .bin file it retrieves an error. 

Regards,


Gerhard Hoffmann <g...@hoffmann-hochfrequenz.de> escreveu no dia segunda, 22/10/2018 à(s) 22:42:
... and /usr/local/lib

Am 22.10.18 um 23:28 schrieb Gerhard Hoffmann:
>

--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages