Processor SDK RTOS PRUSS

From Texas Instruments Wiki
Jump to: navigation, search


RTOS Software Developer Guide PRUSS



Overview

User Interface

Application

Debug

Introduction

The PRUSS (Programmable Real-Time Unit Subsystem) provides a well-defined API layer which allows applications to use the PRUSS low level driver to control  sub system.

Firmware

The PRUSS (Programmable Real-Time Unit Subsystem) is firmware programmable and can take on various personalities. Examples include an ethernet MAC, ethernet Switch, Industrial protocol switch. For a good example, please refer to Simple Open Real Time Ethernet Protocol (SORTE) http://processors.wiki.ti.com/index.php/Processor_SDK_RTOS_PRUSS_SORTE

Driver Features

  • PRU control features i.e enable/disable/reset a PRU
  • Helper functions i.e. load and execute firmware in PRU
  • Memory mapping of PRU/L3/External memories
  • PRU and Host event management (i.e. map sys_evt/channel/hosts in PRU INTC generate interrupts, wait for occurrence of an event, and acknowledge interrupts
  • Interrupt management for A15/C66x CPU targets

Driver Configuration

Board Specific Configuration
All the board specific configurations like enabling the clock and pin-mux of UART/GPIO/PRUSS ICSS pins should be performed before calling any of the driver APIs.


PRUSS Configuration Structure
The pruicss_device.c file contains the declaration of the PRUICSS config structure. This structure must be provided to the driver at the time when PRUICSS_create() API is called to creat the PRUICSS_Handle. This handle is subsequently required to make any PRUSS LLD API call.

APIs
Reference API header file:

#include <ti/drv/pruss/pruicss.h>

API Call Flow

Below sequence indicates calling sequence of PRUSS driver APIs for a use case of sending INTC event to the PRU. Refer example code within module for additional details

 ...
 /* Initialize Board */
 Board_init(boardCfg);
 
 /* Creates handle for PRUICSS instance */
 handle = PRUICSS_create(pruss_config,instance);
 
 /* Disable PRUICSS instance */
 PRUICSS_pruDisable(handle,instance );
 
 /* Register an Interrupt Handler for an event */
 PRUICSS_registerIrqHandler(handle,pruEvtoutNum,intrNum,eventNum,waitEnable,irqHandler);
 
 /* Sets the buffer pointer for PRU */
 PRUICSS_setPRUBuffer(..);
 
 /* API to do Interrupt-Channel-host mapping */
 PRUICSS_pruIntcInit(handle,&pruss_intc_initdata);
 
 /* Execute program on PRU */
 PRUICSS_pruExecProgram(handle,0);
 
  /* Enable PRU */
 PRUICSS_pruEnable(handle,0);
 
 /* Generates INTC event */
 PRUICSS_pruSendEvent(handle,ARM_PRU0_EVENT);
  

Examples

Name
Description
Expected Results
PRUSS_TestApplication

Test application is designed to ping pong an event between CPU target(A15/C66x) and PRU for a fixed count.Application is to test PRU’s load, control and Interrupt controller functionalities.

Following prints expected on console based on pass/fail criteria:

Pass criteria:

Prints related to sending and receiving  event from PRU will be printed on  console. Test program at the end expected to output: "All tests have passed"

Additional Reference

Document Location
API Reference Manual $(TI_PDK_INSTALL_DIR)\packages\ti\drv\pruss\docs\doxygen\html\index.html
Release Notes $(TI_PDK_INSTALL_DIR)\packages\ti\drv\pruss\docs\ReleaseNotes_PRUSS_LLD.pdf