This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM4376: PRU examples using TI-RTOS or no-OS

Part Number: AM4376
Other Parts Discussed in Thread: ADS8688

We are using AM4376 with CCS and processor SDK. I'm looking for code samples and methods to use the 4 PRU cores to offload some processing from the main ARM A9. Are there any examples for this? I see examples for the AM3X Beaglebones, none for the AM437X. Any help appreciated. 

  • Hello Arun,

    Let's break down your question into parts. Note that we keep our generic PRU programming examples in the  PRU Software Support Package (PSSP). I assume you have already found our PRUSS RTOS driver for loading and initializing PRU, documented here

    1) AM437x specific examples?
    There are slight differences between AM335x and AM437x PRU-ICSS, as detailed in the PRU Feature Comparison Across Devices. However, in general concepts that work on AM335x will work on AM437x. So most of our examples are created to run without modification on AM335x (you can get a known good state using a cheap board like the BeagleBone Black), and then you can use the PRU Migration guide to adjust examples as needed.

    2) Does TI provide a framework for IPC (Inter-processor communication, i.e., sending interrupts and data) between an RTOS core and the PRU?
    We do not provide a complete framework for RTOS. (Linux has RPMsg as an option). However, we provide basic PRU examples in the PSSP. In particular, take a look at

    examples/am335x/PRU_PRUtoARM_Interrupt and examples/am335x/PRU_ARMtoPRU_Interrupt
    The companion ARM code does not exist any more, but these provide examples for setting up the PRU's INTC to send and receive interrupts. See the Technical Reference Manual for more information on INTC.

    Lab 2 of the PRU Hands-on Labs
    More examples of using the INTC.

    You may also be interested in these more complex Linux <-> PRU examples:

    examples/am335x/PRU_ADC_onChip
    This demonstrates using RPMsg framework to send small data packets between ARM and PRU. Not directly applicable, but it may give you some ideas.

    Flexible Interface (PRU-ICSS) Reference Design for Simultaneous, Coherent DAQ Using Multiple ADCs
    Here is the git repo with the code
    This is a more complex example, but it provides the best example for creating a custom IPC setup between PRU and ARM. Ignore the PRU_ADS8688_Interface code (This PRU is in charge of implementing SPI with an external ADC). Focus on the PRU_ADS8688_Interface (this PRU takes data collected by the other PRU, performs some simple math, and then uses a ping-pong buffer to pass it to the Linux ARM core).

    Regards,

    Nick