3.7.2.2. Lab 1: How to Create a PRU Project

Introduction

This lab shows how to create a PRU project in CCS, or in the Linux terminal. The CCS section and the Linux section are totally independent.

PRU projects that are developed in CCS require a computer with a screen (i.e., CCS development requires a graphical user interface, or GUI). These projects can be developed on any computer that can run CCS (both Windows and Linux). CCS provides additional tools for debugging PRU code like breakpoints, memory browsers, etc.

PRU projects that are developed through the Linux terminal do not require a display, so they can be run on a traditional Linux computer, through an SSH connection to a remote server, etc. These PRU projects use Linux makefiles. The steps for the Linux terminal sections will ONLY use the terminal (e.g., instead of opening a folder by clicking on it, use $ cd to change directories).

In order to create a PRU project in CCS, follow section Creating a CCS PRU Project.

In order to create a PRU project using the Linux terminal, follow section Creating a Linux PRU Project.

3.7.2.2.1. Creating a CCS PRU Project

3.7.2.2.1.1. Install and Set up CCS

If the processor has a Processor MCU+ SDK:

  1. Reference the Processor MCU+ SDK documentation, section “Getting Started” > “Download, Install and Setup CCS”.

  2. Follow the steps to ensure that CCS has been properly installed and set up.

    Note

    AM62x support for PRU development is added in Sitara device support version 1.6.1. To check the version number of the currently installed Sitara device support, go Help > About Code Composer Studio > Installation Details > Installed Software > Sitara device support. The package can be updated from that menu, or from Help > Check for Updates.

  3. If section “Create Target Configuration” says to “Bypass not used CPUs”, do not bypass the ICSS / ICSS_G cores. The CCS debugger cannot connect to a PRU core if it has been bypassed.

  4. Jump to section Create the PRU Project

For AM65x:

  1. Reference the Processor SDK RTOS documentation, section “CCS Setup for AM65XX”.

    Note

    These labs do not document initializing or debugging the PRU cores from AM65x cores running TI-RTOS. However, the “CCS Setup” section provides steps to prepare CCS to initialize the PRU cores.

  2. Jump to section Create the PRU Project

For other processors:

3.7.2.2.1.2. Create the PRU Project

  1. Launch CCS and select the default Workspace.

  2. Create a new PRU project.

    1. Select File -> New -> Project -> Code Composer Studio -> CCS Project. Click Next.

    2. In the upper left dropdown next to “Target”, select the target processor family. In the upper right dropdown, select the desired board.

      • AM335x example: Select AM33xx - Cortex A8 in the upper left dropdown. Select BeagleBone_Black in the upper right dropdown.

      • AM62x & AM64x example: If a target processor family does not show up in the upper left dropdown, it may be hiding under Unclassified Devices. At the time of writing, after Unclassified Devices is selected in the left dropdown, boards like AM64x_GP_EVM can be selected in the right dropdown.

      • If your board is not defined, select the processor you are using in the second dropdown.

      Note

      AM62x: At the time of writing, the PRU tab populates for AM62, but not for AM62_SK_EVM. It is suggested to first select the AM62x board that the PRU code will run on. If a PRU tab does not show up below, then select AM62 instead.

    3. Select the PRU tab. Specify a Project Name (such as “pru_add”).

    4. Verify that a Compiler version is listed (e.g., TI v2.3.3).

      Note

      If the PRU compiler is not currently installed, select the Cancel button. Go to View->CCS App Center. Select the PRU Compiler. Download the PRU compiler by selecting the Install Software button. Then redo the previous steps.

    5. Select an “Empty Projects” template. Select Empty Project.

    6. Select Finish

Go to Lab 2: How to Write PRU Firmware to start writing the PRU firmware.

3.7.2.2.2. Creating a Linux PRU Project

  1. Navigate to the PSSP examples directory for your specific processor.

    • AM335x example:

      $ cd <PSSP_PATH>/examples/am335x
      
    • AM62x example:

      $ cd <PSSP_PATH>/examples/am62x
      
  2. The PSSP is a git repo. Create a new development branch. Switch over to the new branch (i.e., “checkout” the new branch).

    $ git branch getting_started_labs
    $ git checkout getting_started_labs
    
  3. Create a new project by copying one of the existing project folders.

    • Will the project use RPMsg to communicate with the Linux ARM core on the processor?

      • If yes, copy the RPMsg_Echo project for whichever core you are programming.

      • If no, copy the Halt project. The PRU Getting Started Labs do not use RPMsg.

    • Example: AM62x with RPMsg on PRU0, project name PRU_Add:

      $ cp -r PRU_RPMsg_Echo_Interrupt0 PRU_Add
      
    • Example: AM64x on RTU1, no RPMsg, project name RTU_Add:

      $ cp -r RTU_Halt RTU_Add
      
  4. Check that the files were copied over properly:

    $ ls <source project>
    $ ls <destination project>
    

Go to Lab 2: How to Write PRU Firmware to start writing the PRU firmware.