FB prussdrv Kit (BBB)

Headers, Bindings, Libraries for use with FreeBASIC, Please include example of use to help ensure they are tested and usable.
Post Reply
TJF
Posts: 3809
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

FB prussdrv Kit (BBB)

Post by TJF »

The library libprussdrv from the bundle am335x_pru_package is used to control the Programmable Realtime Unit SubSystem (= PRUSS) of ARM processors. It contains functions to load instruction, exchange data and execute programs. Find details, the source code and some examples in the original package.

Some ARM processors include (mostly two) PRUSS co-processors, which run on a clock cycle of (usually) 200 MHz and can be used to execute real-time tasks in an efficient manner.
Image

This package is designed to be used on Beaglebone Hardware under a Debian based operating system (ie Ubuntu 13.10). It's an (stand-alone) extension to the original bundle and enables using the library in FB code.

The download contains
  • the library binaries (bin/libprussdrv.*)
  • FB headers (include/pruss*.bi)
  • adapted source code of the PRU assemblers (in folder utils/pasm_source)
  • a pre-compiled binary of the PRU assemblers (bin/pasm)
  • a minimal-device-tree-overlay to activate the PRUSS (bin/PRUSSDRV-00A0.dtbo)
  • two examples (in folder examples)
The assembler is extended by a new option (-y) to export the instructions in form of a FB header file. This can be used to hard-code the instructions in FB source.

Installation instructions:

Execute in the base directory of the un-packed download
sudo su
cp bin/libprussdrv.* /usr/local/lib
ldconfig
mkdir /usr/local/include/freebasic/BBB
cp include/* /usr/local/include/freebasic/BBB
cp bin/pasm /usr/local/bin
exit
To compile your own software you'll need an ARM version of the fbc (ie BBB-FBC (fbc für Beaglebone Black)).

To execute the examples, you've to enable the PRUSS. Therefor you need an appropriate device tree overlay in the folder /lib/firmware. Prepare the included minimal-overlay by
sudo cp bin/PRUSSDRV-00A0.dtbo /lib/firmware
and active it by
sudo echo PRUSSDRV > /sys/devices/bone_capemgr.9/slots
(As an alternative you can use one of the pre-installed overlays, ie ... echo BB-BONE-PRU-01 > ....)

And you'll need read / write access to the interrupt /dev/uio0. So either execute the examples as user root. Or prepare your system for permanent access by adding a new user group (ie named pruss) and making all related users a member of this group. Then execute
sudo /bin/chgrp pruss /dev/uio0
sudo /bin/chmod g+rw /dev/uio0
Note:
Software running on a PRUSS can access each memory area and register of the system. The kernel software cannot protect the system. Therefor it's a kind of safety risk to enable the PRUSS.

And finaly a quotation from the original package
README.txt wrote:AM335x PRU PACKAGE

The hardware / software modules and descriptions referred
to in this package are *NOT SUPPORTED* by Texas Instruments
(http://www.ti.com / e2e.ti.com).

These materials are intended for do-it-yourself (DIY) users
who want to use the PRU at their own risk without TI support.
"Community" support is offered at BeagleBoard.org/discuss.
Find the download at
Post Reply