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

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

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

... and /usr/local/lib

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

Gerhard Hoffmann <ghf@hoffmann-hochfrequenz.de> escreveu no dia segunda, 22/10/2018 à(s) 22:28:

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 :confused: . When I do “pasm -b fileName.p” to generate the .bin file it retrieves an error.

Regards,

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