PRU-SS Development

The Programmable Real-time Unit Subsystem (PRU-SS) consists of dual 32-bit RISC cores (the PRUs), shared data, instruction memories, internal peripheral modules, and an interrupt controller (INTC). The programmable nature of the PRU cores, along with their access to pins, events and all device resources, provides flexibility in implementing fast real-time responses, specialized data handling operations, custom peripheral interfaces, and in offloading tasks from the other processor cores of the device.

Reference Documents

TI provides a detailed description of using the PRU-SS for MitySOM-AM62x modules that include the PRU-SS subsystem.

Other TI PRU references include:

Note: Not all MitySOM-AM62x options include the PRU-SS subsystem. Check the SOM datasheet for more information.

Critical Link recommends reviewing this information prior to starting development of a PRU-SS application.

PRU Development Kit Examples

The PRU examples are fairly simple examples that may have little to no real utility in an actual application but they are included to demonstrate different debugging techniques. The debugging techniques would be useful for many applications.

If you are using version or earlier of the ti-processor-sdk, then all of the examples below will require the patches regarding the AM62x configuration files.

Overview of debugging with JTAG

When debugging a program through JTAG, there are two ways to connect to the target. The first is use the JTAG to download the program to the target. The second is to start the target from the ARM/Linux using remoteproc and then use JTAG to "attach" to the program.

Using JTAG to load a program

When working with a PRU, the steps needed to load and debug a program are similar to the M4 processor. When working with a JTAG connection, the sequence of steps is:

  • Launch a Target configuration. The JTAG connects to the target and determines which processors are on the JTAG chain and are available to be accessed.
  • Connect to target. Connects to a specific processor. The processor will be suspended.
  • Reset cpu
  • Load program
  • Now you are ready to plant breakpoints and debug the program.

Using JTAG to attach to an already loaded program

Some programs cannot be loaded through JTAG. Programs which have a resource table need to be loaded through the ARM/Linux since the ARM makes use of the resource table. In these cases, you will want to have the ARM start the program and then use the JTAG to "attach" to the already running program. You may need to add a loop at the start of the program to "wait for the debugger". This technique will be demonstrated in one of the examples: Hello World - remoteproc Load. In this situation, the sequence of steps is:

  • Start the program from ARM/Linux using the remoteproc driver.
  • In Code Composer, Launch a Target configuration.
  • Connect to the desired target processor. The processor will be suspended.
  • Load Symbols (instead of reset cpu and load program)
  • Now you are ready to plant breakpoints and debug the program.

List of examples

  • Hello world - Program loaded and run from Code Composer. This example demonstrates capturing printf-like output using Code Composer CIO and having the output appear in a Console View.
  • Hello world - Program loaded from ARM/Linux with remoteproc and using Code Composer to "attach" to the existing program. Attaching to a program loaded by the ARM will likely be more typical. The technique of adding a delay loop to wait for the debugger connection and using the debugger to break out of the loop is demonstrated.
  • RPMsg echo - This example demonstrates communication between the PRU and the ARM. This example from the TI processor SDK does not demonstrate any debugging techniques per se but it is a precursor for the multi-processor debugging example.
  • Multi-processor debugging - This example uses the RPMsg echo programs to demonstrate debugging a PRU program through the JTAG connection and simultaneously debugging a Linux user-level program with gdbserver.
PRU Examples
Hello World - CCS Load Hello world program demonstrating how to capture printf-like output from a PRU.
Hello World - remoteproc Load Hello world program loaded from ARM with remoteproc.
RPMsg echo Multiprocessor program with comunications between PRU and ARM.
Multi-processor debugging Debugging the RPMsg echo program on multiple processors

Go to top
Add picture from clipboard (Maximum size: 1 GB)