cUIA 1.00.00.13 Linux Example Program User Guide
This user guide is divided into the following sections:
Introduction,
Building the example program, Configuring and starting System Analyzer, Running the example program.
An example project is provided in the packages/ti/uia/examples/linuxDemo folder that demonstrates the following features:
- How to log UIA events using the Log and LogUC macros
- How to use the ti/uiaplus/loggers/stream/LoggerStreamer event logger to log events to a UIA event packet
- How to send the UIA event packets via UDP to System Analyzer (running on a host PC)
This user guide also provides information on how to configure System Analyzer to receive the event packets and display them in the log view. For details on the use of System Analyzer, please refer to the System Analyzer on-line help in CCStudio, or to the System Analyzer wiki.
You should have the following installed on a host PC in order to be able to receive the UDP packets that are sent by the demo project:
- CCStudio v5.1.1 or later, with System Analyzer installed
- if you are running CCStudio on Windows, you should install WinPCap in order to enable receipt of the UDP packets. A good way to install this is to install Wireshark, which installs WinPCap for you and provides visibility into the packets that are being sent to your PC.
You will need the following information before starting:
- The IP address of the PC that System Analyzer is running on
The
following following files are provided in the packages/ti/uia/examples/linuxDemo folder:
- main.c: the demo program
- Makefile: a makefile for the demo program.
The demo program is intended to be compiled to run on a target CPU such as an ARM Cortex A8/A9/A15 that is running Linux. The program was tested on a Pandaboard (ARM Cortex A9 / OMAP4430) running Ubuntu 11.10.
To build the test program on an ARM target CPU running Linux:
- Make a folder in your home folder named e.g. UIALinux
- unzip the cuia_1_00_00_13.zip file into that folder
- open a terminal window and navigate to the cuia_1_00_00_13 folder.
- For a standalone build, set up the build environment by typing source setupenv.sh
- Build the demo project and the libraries it needs by typing make all
Alternatively, you can build the program on a Windows machine either using a virtual machine or by using a cross-compiler.
When you have built the program, you should see a file named "demoWithAdrs.xv5T". Copy this file over to the PC running System Analyzer, so that System Analyzer can read the program's symbol information from it.
On the PC that is running System Analyzer, do the following steps in CCSv5.1 or CCSv5.1.1:
- Copy over the demo.xv5T executable that was created in the above steps and store it in a folder
- Copy the cuia_1_00_00_13 package into a local folder (e.g. c:\ti\cuia_1_00_00_13)
- In the Debug Perspective, open the System Analyzer Live Dialog (Tools / System Analyzer / Live)
create a UIA config file by clicking on the "Create UIA Config File" button
- if there is no event transport defined, right click on the table and select "Add an event transport".
double click on the event transport and select UDP as the Transport Type, the IP address of the target board as the address, and set the port number to 1235.
If there is a control and status transport entry, and it's type is not "None", double click on it and set the transport type to "None".
If there is no endpoint defined, right click on the table and select "Add an Endpoint".
Double click on the endpoint entry and enter the following:
- Name = CPU0 (or some other useful identifier that indicates which CPU core will be running the test program)
- Endpoint Address = 0
- .out file - click the . button and navigate to the local copy of the demo.xv5T executable that was generated by the "Build the test project" steps
- .uia.xml file - click the . button and navigate to the metadata folder of the local copy of the cuia_1_00_00_13 package (e.g. c:\ti\cuia_1_00_00_13\metadata) and select cuia.uia.xml
- .rta.xml file - click the . button and navigate to the metadata folder of the local copy of the cuia_1_00_00_13 package (e.g. c:\ti\cuia_1_00_00_13\metadata) and select cuia.rta.xml
- Clock Freq. (MHz): enter the speed of the timestamp you are reading in the main.c file's getTimestamp function. (If this is returning 0, then set it to the CPU clock speed in MHz - e.g. 1000 for a 1GHz device)
- Set Cycles per tick to the number of CPU cycles each tick of the timestamp you are reading in the main.c file's getTimestamp function (if this is returning 0, then set it to 1).
- Click OK to close the endpoint dialog
Click Save to save the UIA config file to some location (e.g. the folder containing the local copy of the executable that you are running)
Back in the System Tools Live dialog, click the
button to the left of the "Create UIA Config File" button and select the .usmxml file you just created.
Ensure the "Until data transfer is manually paused" radio button is selected, and click Run
On the Linux target, open a Terminal window and cd to /packages/ti/uia/examples/linuxDemo. Run the test program from the Terminal window by typing ./demoWithAdrs.xv5T 1.1.1.1 , replacing 1.1.1.1 with the IP address of the PC that System Analyzer is running on.
This should print out the packet number for each UIA event packet that is sent on the terminal.
To terminate the program, type Ctrl-C
On the PC running CCS and System Analyzer, you should see event data being displayed in the System Analyzer log view
The cUIA package is a "no XDC tooling required" version of the RTSC-based UIA package, with 'C' code compatible APIs and event defintions. As such, much of the UIA documentation is applicable to the cUIA package, especially those sections covering the events provided in the ti/uia/events package, the use of the Diags_setMask API and the usage of the macros provided in the xdc/runtime/Log.h. The use of System Analyzer to display and analyze these events is generally the same, regardless of whether the events were generated by the UIA RTSC package or the cUIA C-based code. Until such time as cUIA-specific documentation and tutorials are available, for more information please refer to the System Analyzer wiki for UIA Tutorials and for the System Analyzer User's Guide (spruh43b).
Last updated: April 25, 2013