PRU-ICSS Debug on AM335x

From Texas Instruments Wiki
Jump to: navigation, search

Introduction

This page is intended to help users with very early PRU development. This is intended to be OS-agnostic and a simple way of connecting to the PRU, loading a program, and being able to debug through CCS. The goal is to get some of the low level logic in place (e.g. creating waveforms on the pins or doing whatever you're trying to accomplish with the PRU). This does NOT communicate with the Cortex A8. It is intended for simple, stand-alone development to get things rolling. Once you have the base functionality in place, then you can look at adding communication with the A8.

Because the PRU-ICSS cores are deeply embedded inside the AM335x, there are multiple registers that need to be configured in order to perform JTAG debug. This includes:

  • ICSS clocks
  • ICSS reset
  • Pin muxing for PRU-ICSS signals
  • And in some cases even enabling various JTAG clocks so you can connect. (Linux turns many clocks off.)

A script was developed in large part from the work in Debug Configuration Initialization Scripts to handle this automatically.

Steps Involved

Prerequisites

Hardware

  • AM335x Beaglebone Black - Order Now
  • BeagleBone PRU Cape - Order Now
  • 5V power supply or USB cable connection
  • JTAG emulator
  • FTDI cable

Software

One time setup

  1. Create your target configuration file. This is the ccxml file that specifies which JTAG probe you have as well as the processor. If you don't have this already you can go to File -> New -> Target Configuration to create this.
  2. Your Target Configuration file must either reside in the same directory as your project or alternatively you can right-click on it and set it as the default.
  3. Import one of the projects from the "pru_cape" directory of the PRU software package such as PRU_Hardware_UART.
  4. Create a starter "Debug Configuration" by launching the project. (You will not connect all the way -- yet...)
    • Click the "bug" icon.
    • Specify whether this particular project will load to one or both PRUs. Let's choose only PRU_0 (i.e. de-select PRU_1).
    • The project will build.
    • CCS will attempt to connect and load. Generally you will hit an error here. That's ok. The goal of this step was to generate a Debug Configuration.
  5. Click the arrow next to the debug icon and then choose Debug Configurations:
    Am335x-pru-debug-configuration.png
  6. For the "Initialization Script" for your project you will need to browse to the am335x-bbb-pru-startup.js file:
    Am335x-pru-debug-configuration2.png
  7. Click "Apply" and "Close".

Debugging your project

Now that we have everything setup, debug should be a breeze:

  • Click the "bug". This will build your project, launch the debugger, configure all the necessary registers, and load your code.

Video Demo