Extending System Trace to Blackhawk USB560m Emulators on TI’s C66x KeyStone Multicore SoCs

System Trace
The System Trace (STM) capability offered by Texas Instruments employs the MIPI System Trace Protocol, which provides developers with a “printf” capability. In a multicore environment, information from each core can by analyzed because they are globally time stamped. This is a powerful tool for looking at what each core is processing in a common timeline. TI offers STM for CTools-enabled devices.

This article provides a brief overview of how to configure a Blackhawk USB560m JTAG emulator to collect STM data via embedded trace buffer (ETB) on TI C66xx KeyStone™ multicore architecture.

For additional TI STM information or to download the complete demo project code and examples mentioned in this article, please visit: www.blackhawk-dsp.com/STM.

CCS Project Creation (Code Composer Studio™ IDE)
To demonstrate how easy it is to add STM data collection to an application, a simple, “hello world”-type project for the C6678 will be used.

To recreate the demo project for this or a different STM supported target:

  1. Start Code Composer Studio IDE v5.x
  2. Select the main menu option File → New → CCS Project. This will display the New CCS Project wizard dialog (Figure 1) where you can enter a project name, select the Family (demo uses “C6000”) and its variant (demo uses “Generic C66xx Device”).
  3. Leave the default advanced settings and choose “Empty Project” from the Project Templates and Examples.
  4. Click finished when done. This will create a main.c file with a single function, main() and add it to the eclipse Project Explorer window.
  5. Now locate a C66xx linker command file, copy it to the project workspace and specify the file in the project properties (demo uses a file downloaded in one of the TI C667x CTools Examples). The project will now build successfully.
Figure 1 – New CCS Project Dialog

Adding STMLib to the Project
After the project is configured in CCS:

  1. Download and install the STMLib files.
  2. Include the STM header file and add and the path of the STM library file to the linker in project.
  3. Add the STM API calls to the code. The project’s main.c file will look something like the following code snippet.

#include “StmLibrary.h”

void main(void) {
int jj=0;
pSTMhdl=STMXport_open(pSTMBufInfo, &STMConfigInfo);
STMXport_printf(pSTMhdl, STM_HelperCh, “%s”, “C667x Demo1 - BEG LOOP” );
for (ii=0; ii<880000; ii++) {
if ((ii%250) == 0) {
STMXport_putShort(pSTMhdl, STM_HelperCh, (short)jj );
STMXport_printf(pSTMhdl, STM_HelperCh, “%s”, “C667x Demo1 - END LOOP” );
exit (0)

Configuring CCS
To create a target configuration and setup trace:

1. Select the main menu option, File → New → Target Configuration File, and choose the emulator connection and device (see Figure 2).

Figure 2 – New Target Configuration Dialog

2. Launch the debug session.

3. Connect to the necessary devices to enable STM collection using the ETB (see Figure 3). These devices should be labeled similar to C66xx_0 (first CPU core), CSSTM_0 (STM node), and TETB_STM (ETB node). You may need to select the option to “Show all cores”.

Figure 3 – Debug Window

4. Configure settings in the trace system control dialog from the main menu Tools → Trace Control (see Figure 4).


Figure 4 – Trace System Control

5. Select the CSSTM_0 tab. If the ETB settings are not displayed, select the “Receiver…” button and choose ETB from the list (Figure 6). Make sure the ETB type is “Auto” and “Synchronize trace with target execution” is selected.


Figure 5 – Trace Display Window with STM Data

Figure 6 – Trace Receiver Selection Dialog

6. Press the “OK” button to apply these settings.

Collecting STM Data

  1. Open the trace display window for the CSSTM_0 node from the main menu (Tools → Trace → Analyzer → Open Trace Connection in New View → CSSTM_0). This is where the collected STM data will be displayed (Figure 5).
  2. Load the demo program to C66xx_0 and run (Resume | F8) the program. Because the option to synchronize with target execution was selected in the trace controls, the trace display will update automatically with the STM data collected in the ETB when the program terminates or is halted.

The “Data Message” column of the trace display (Figure 5) shows the output from the function STMXport_printf() and the “Data” column is from the function STMXport_putShort ().

That is all that is required to begin collecting STM debug information from your application using a Blackhawk USB560m JTAG emulator (or any Blackhawk XDS560-class emulator).

Multicore STM Data Collection
To collect STM from more than one core, simply connect to another CPU core (i.e. C66xx_1) prior to setting up the trace controls. It is also helpful to group the CPUs in the debug window to synchronize program load and target execution.

In the trace display, the “Master Name” column will differentiate the data for each CPU and the time stamp will order each debug message in the proper sequence.

XDS560v2 STM Data Collection
This article describes how to extend Blackhawk XDS560-class emulators to collect STM data using the ETB. If you own a Blackhawk XDS560v2 STM model, you can collect STM data directly, without using the ETB.

The setup requires that you change the target connection to the “Blackhawk XDS560v2 STM Emulator”, selecting “560v2 System Trace” as the trace receiver and only connecting to the CSSTM_0 and C66xx_0 devices (do not connect to the TETB_STM node).

For more information, visit: www.blackhawk-dsp.com/STM.

Contact Information


123 Gaiher Drive
Mount Laurel, NJ, 08054

tele: 856.234.2629
fax: 856.866.1100

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • TwitThis
Extension Media websites place cookies on your device to give you the best user experience. By using our websites, you agree to placement of these cookies and to our Privacy Policy. Please click here to accept.