PRU Cape: Building Demos

From Texas Instruments Wiki
Jump to: navigation, search

Introduction

The PRU Cape is a test, development, and evaluation module system that enables developers to write software and develop hardware around the PRU subsystem. This wiki article outline how to rebuild the Demo software available for the PRU Cape.

For more details about the PRU Cape and the Demo software, visit:



Prerequisites

The PRU Cape Demo Software is available in the PRU Software Support Package hosted on git.ti.com. To download this package, select the "Source Tree" button from the PRU Software Support Package webpage and then click "Download master as tar.gz." In Windows, a program such as 7-zip can be used to open the downloaded file and extract the software package contents.

To EDIT or REBUILD the PRU Cape demos, the following software is required:



Rebuilding the Demo Source Code

NOTE: This section uses the notation $PRU_SW_PATH to reference the installed location of the downloaded PRU Software Support Package.


1. Launch CCSv6 and select the default Workspace
2. Load the PRU_Demo and Firmware projects' into CCS
a. Select Project->Import CCS Projects...
b. Browse to the pru_cape directory in the PRU Software Package sources (i.e. $PRU_SW_PATH/pru_cape)
c. Select all projects that appear (i.e. PRU_Demo, PRU_LED0, PRU_LED1, etc)
d. Select Finish
3. The projects should now be visible in the Project Explorer. Don't see the Project Explorer? Select View->Project Explorer
4. Configure PRU_Demo project Build Configurations as "Release"
a. Right click on the PRU_Demo project
b. Select "Build Configurations -> Set Active -> 2 Release"
5. Link the PRU_Demo project to StarterWare
a. Right click on the PRU_Demo project
b. Select Properties
c. Select CCS Build->Environment
d. Edit (or add) the variable named "STARTERWARE_ROOT"
e. Update the Value of this variable to the StarterWare directory on your computer (i.e. C:/TI/AM335X_StarterWare_02_00_01_01)
f. Select OK and OK
6. Update PRU_Demo project Link Order
a. Right click on the PRU_Demo project
b. Select Properties
c. Select CCS Build->Link Order
d. Select Add... icon
e. Select pru.c and pru_cape_demo.c files
f. Select OK and OK
7. (Optional) To create an SD bootable application image, add a Post-build step
Note this step must be performed in Windows. If this step is skipped, a .out file will still be created, which can be loaded to and executed on the BeagleBone Black through CCS over JTAG.
For more details about the TI Image Tool used in this step, refer to the AM335x StarterWare wiki here
a. Right click on the PRU_Demo project
b. Select Properties
c. Select CCS Build->Steps
d. Add the following text under Post-build steps:
"${CCS_INSTALL_ROOT}/utils/tiobj2bin/tiobj2bin.bat" "${ProjName}.out" "${ProjName}.bin" "${CG_TOOL_ROOT}/bin/ofd470.exe" "${CG_TOOL_ROOT}/bin/hex470.exe" "${CCS_INSTALL_ROOT}/utils/tiobj2bin/mkhex4bin.exe" & "${STARTERWARE_ROOT}/tools/ti_image/tiimage.exe" "0x80000000" "NONE" "${ProjName}.bin" "${ProjName}_ti.bin"
e. Select OK
8. Build the PRU_Demo and PRU Firmware projects
a. Select the PRU_Demo project
b. Select Project->Build Project
c. Note the firmware projects are linked to the PRU_Demo project. Building the PRU_Demo project should cause the other projects to build.
d. Building the PRU_Demo and PRU_Firmware projects should create PRU_Demo.out (located in the $PRU_SW_PATH/pru_cape/pru_demo/Release directory). This .out file can be loaded and run on the CortexA8 core through CCS over JTAG.
e. If creating the optional SD bootable application image (Step 6 above), the Post-Build step should create PRU_Demo_ti.bin (located in the $PRU_SW_PATH/pru_cape/pru_demo/Release directory). Rename PRU_Demo_ti.bin to app and follow the steps on the PRU Cape Getting Started Guide to prepare the SD Card.




Running the Demos

Refer to the PRU Cape Getting Started Guide for details about running the demos.