PRU-ICSS Getting Started Guide
The PRU Software Support Package provides support for the PRU-ICSS Subsystem in AM335x, AM437x, AM57xx, and K2G devices. This package contains:
- Support for ARM<->PRU interaction via remoteproc and rpmsg Linux drivers
- Remoteproc supports basic control functions such as firmware load, start/halt, simple debug, and interrupt managing
- Rpmsg supports message passing
- Basic firmware examples showing simple functionality
- Register header files for easy register programming
- Library/API for controlling vrings (used for rpmsg)
Things to Obtain
- PRU Code Generation Tools (you can also get these tools through the CCS App Center)
- ARM running Linux
- ARM running RTOS
Installation of Tools
Tools installation paths are generally fairly arbitrary, but we do have a few requirements once you have installed to your preferred directory.
- Install Processor SDK to the directory of your choosing
- Follow the installation instructions found here.
- Location does not matter, but the default installation directory is strongly suggested and makes using the SDK's scripts much easier.
- Install the PRU Software Support Package into the SDK you chose above
- Starting with Linux Processor SDK v126.96.36.199 the support package is built into the SDK at the 'examples-applications/pru-icss-x.y.z/' folder
- (Optional) Install CCS to the directory of your choosing
- CCS installation instruction for Linux can be found here.
- Makefiles are provided (in addition to CCS projects for most projects) in order to build all examples in the PRU Software Support Package. The ability to build the PRU projects using the Makefiles makes CCS completely optional in a Linux environment.
- There is no longer a standalone installer for the PRU Software Support Package
- You must now download the files from the public Git repository here.
- Install CCS to the directory of your choosing
- Installers can be found here.
How to Enable PRU Support in Kernel
This step is used to enable the remoteproc driver in the Linux kernel. Windows users that are loading the PRU through CCS can safely skip this step during the development phase.
Beginning with Linux Processor SDK v188.8.131.52 the remoteproc and rpmsg modules are enabled by default and included out of the box in the Linux Processor SDK. Therefore, you do not need to make any menuconfig changes in order to load firmwares in the PRU cores. If you are using an older Linux Processor SDK please see the archive links at the bottom of this page.
How to Begin Programming
Programming the PRU core is not terribly different from programming any other core. Because we now have a C compiler we are able to write regular C code and have it perform tasks on the PRU cores. A great place to start development is to take a look at the Hands-on Labs that are provided in the PRU Software Support Package.
Register Header Files
Several register header files were created to help facilitate quick and easy configuration. In Linux, these are located in the <SDK_install_dir>/example-applications/pru-icss-x.y.z/include directory by default. In the Git repository these are located in the include folder. See the header files page for more information.
There are a couple of special CPU registers available with different functionality.
- Writes to R30 control the General Purpose Output pins, and reads allow the user to determine the current state of those pins
- R31 is used to read General Purpose Input pins as well as the status of the two PRU host interrupts (bits 30 and 31)
- Writes to R31 are used to generate interrupts - see the device-specific TRM for more information on how these work.
For support please post questions on the TI E2E forum for Sitara devices.