3.6.2.2. Getting Started with PRU Software Support Package

Overview

Note

This section covers the software aspects of getting started on the PRU-ICSS and the PRU_ICSSG. Hardware information, training material, software development resources, and more are in the Overview of PRU-ICSS and PRU_ICSSG

The PRU Software Support Package provides support for the PRU-ICSS Subsystem in AM335x, AM437x, AM57xx, AM64x, AM65x, and K2G devices. This package contains:

  • Support for ARM<->PRU interaction via remoteproc and rpmsg Linux drivers (only Processor SDK Linux 7.3 and earlier)

    • 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


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.

Linux

  1. 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.

  2. If your Processor SDK Linux has a top-level example-applications folder, the PRU Software Support Package is built into the SDK at ‘example-applications/pru-icss-x.y.z/’. Otherwise you can download the files from the public Git repository here.

  3. (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.


Windows

  1. 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.

  2. 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 v2.0.2.11 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.

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 PRU 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.


Special Considerations

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.

What Next?

For support please post questions on E2E Processor Support.