This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/TMS320C6657: Custom System Trace crashes CCS

Part Number: TMS320C6657


Tool/software: Code Composer Studio

Dear TI Support Team,

I am using CCS v7.0.0 and v6.2.0 as well. I will try to send printf like STM messages and I am using the ctools library. If I record the STM messages via "Custom System Trace" wizard then the "Trace Viewer" runs in an endless loop during the decoding of custom STM messages. The tracing of CP Tracer messages (e.g. Memory Throughput Analysis) instead works. Do you have ony idea wath is going wrong?

My code is somthing like that:

STMHandle* g_pSTMhdl = NULL;

/******************************************************************************
 * Initialize STM for printf like usage.
 */
void stmPrintfOpen()
{
	STMBufObj* 		stm_buf = NULL;
	STMConfigObj	stm_config;

	if (g_pSTMhdl != NULL)
		return;

    // Initialize STM Configuration
	stm_config.xmit_printf_mode      = eSend_optimized;		// send const string address only
	stm_config.optimize_strings      = true;
	stm_config.STM_XportBaseAddr     = STM_XPORT_BASE_ADDR;
	stm_config.STM_CntlBaseAddr      = STM_CONFIG_BASE_ADDR;
	stm_config.STM_ChannelResolution = STM_CHAN_RESOLUTION;
	stm_config.pCallBack             = NULL;

	g_pSTMhdl = STMXport_open(stm_buf, &stm_config);
}

/******************************************************************************
 * Close STM for printf like usage.
 */
void stmPrintfClose()
{
	if (g_pSTMhdl != NULL)
	{
		STMXport_flush(g_pSTMhdl);
		STMXport_close(g_pSTMhdl);
	}
	g_pSTMhdl = NULL;
}

/******************************************************************************
 * Example to printf like output to STM
 */
void stmPrintfTest()
{
	int32_t	stm_ch = 0;
	int ii, jj;

	stmPrintfOpen();

	/***
	 * Example of STM based printf
	 */
	STMXport_printf(g_pSTMhdl, stm_ch, "%s", "C66xx STM demo - BEG LOOP" );
	for (ii=0, jj=0; ii<8800; ii++)
	{
		if ((ii%250) == 0)
		{
			STMXport_putShort(g_pSTMhdl, stm_ch, (short)jj );
			jj++;
		}
	}
	STMXport_printf(g_pSTMhdl, stm_ch, "%s", "C66xx STM demo - END LOOP" );
	STMXport_flush(g_pSTMhdl);

	stmPrintfClose();
}

Thanks for your help.

Kind regards

Sven

  • Sven,

    What receiver are you using to capture trace data (pins or ETB)? Does the SimpleSTMExample.c application work for you in your environment?  I noticed that your code snippet is not calling Config_STM_for_ETB().  If this function is not called you will need to manually configure the trace export settings.  Is the trace viewer actually freezing or just returning no data?

    Thanks,

    Mark

  • Hi Mark,

    I have try out both ETB and 560v2Trace as well. In both cases the STM decoder of CCS runs in an endless loop and it blocks the GUI of CCS. With the process explorer of sysinternals I can see that the STM decoder DLL is the reason.

    Kind regards
    Sven
  • Sven,

    Can you reproduce the issue and capture a trace log (processors.wiki.ti.com/.../Emulation_FAQ I'm able to capture STM trace on a 6657 without any issue in my environment.

    Thanks,
    Mark
  • Dear Mark,

    how can I capture a trace log without a working STM trace?
    On my site the capturing of STMXport_printf() based messages crashes the CCS.

    I am using the PSDK 3.1.0.6 of C6657, CCS v6.2.0 and CCS v7.0.0.

    Kind regards
    Sven
  • Sven,

    You should be able to enable trace logging following the steps here: processors.wiki.ti.com/.../Emulation_FAQ

    After, you've enabled logging, you can reproduce the issue to generate the log file. STM trace doesn't have to work to generate this log file.

    Thanks,
    Mark
  • Dear Mark,

    sorry, the list of FAQ's was too long for me ;-) Now I have set the TI_TRACE_LOGGING variable and I get a trace.log of CCS.

    Attached is the ti_trace_log file as ZIP archive. For your reference the archive contains also a snapshot of running threads and the stack trace of the wrong thread as screenshot during the crash.

    Interesting is, that the issue is only in my large OMP project. If I make a small project with the same test function for STM then it works. In the trace file you can also see, that the transfer has been done, but the viewer does not view any messages. It halts on 0% and after pressing of run button the CCS crashes.

    You have any idea?

    Kind regards

    Sven

    ti_trace_log_1132017_4752.zip

  • Sven,

    For both of your CCS7 and CCS6.2 installations, can you provide the names of the contents in C:\ccs\7.0.0.00042\ccsv7\ccs_base\dvt_4.1.0.201612061750\Trace\bin?  The dvt_#.#.#.############ directory will probably be different for both installations.

    Thanks,

    Mark

  • Dear Mark,

    thanks for your help. This is the content of my both CCS installations:

    Verzeichnis von D:\ti\ccsv6\ccs_base\dvt_4.1.0.201609091143\Trace\bin
    
    05.01.2017  10:32    <DIR>          .
    05.01.2017  10:32    <DIR>          ..
    13.12.2016  19:17           136.704 JTrace.dll
    09.09.2016  12:13           134.656 JTrace2017-01-05-10-32.dll
    09.09.2016  12:13           621.872 libJTrace.so
    09.09.2016  12:13           622.699 libJTrace64.so
                   4 Datei(en),      1.515.931 Bytes
                   2 Verzeichnis(se), 648.184.107.008 Bytes frei
    
    
    Verzeichnis von D:\ti\ccsv7\ccs_base\dvt_4.1.0.201612061750\Trace\bin
    
    10.01.2017  18:35    <DIR>          .
    10.01.2017  18:35    <DIR>          ..
    06.12.2016  18:38           136.704 JTrace.dll
    06.12.2016  18:38           621.872 libJTrace.so
    06.12.2016  18:38           622.699 libJTrace64.so
                   3 Datei(en),      1.381.275 Bytes
                   2 Verzeichnis(se), 648.184.107.008 Bytes frei

    Kind regards

    Sven

  • Sven,

    You dvt directory looks to be correct. I'm also still unable to reproduce in my environment. I think some more information may be helpful:

    1. What version of StmLibrary? This is found in the headers revision history.

    2. When the decoder hangs are you able to save off a .tdf?

    3. I took your example code and made a loop to send a large amount of stm messages until the trace buffer overflowed for both 560v2/ETB and do not see an issue.  Do you have an example code that you can send that duplicates the issue you are seeing?

    4. Is any data (.bin or .dcm) being created in your ..\User Directory\.TI-trace\data? If so could you clear that directory, reproduce the issue, and send whatever is in the data folder?

    Thanks,

    Mark

  • Dear Mark,

    sorry for my late response, I was very busy with some other issues on my project. To your questions:

    1. STMlib version 5.2 of 9/29/2014 from StmLibrary.h

    2. open - I will try out the behaviour

    3. I have also make a simple application, which has not the issue. It looks like that the issue is present only in complex programs

    4. open - I will try out the behaviour

    Thanks for your help, I will reply tomorrow with more details.

    Kind regards
    Sven
  • Dear Mark,

    to 2.

    If I try to save the hidden STM trace data to a file then the CCS v7 hangs completely and it crashes.

    to 4.

    I have delete the .TI-trace directory and I have try again. The attached ZIP contains the complete directory content incl. trace log file.

    Is it possible that my *.out file is too large with 145 MByte?

    Kind regards

    Sven

    ti-trace-20170130.zip

  • Sven,

    Sorry for the delayed response. It is certainly possible that the size of the application code is causing the crash. I will try to find some large binaries to test that will invoke the STM decoder in the manner described here. Have you had any further success regarding this issue?

    Thanks,
    Mark
  • Hi Mark,

    I have no further success regarding the STM decoder.

    My application is very complex and it contains a DAB receiver and DAB modulator. It uses OMP and the SIMD vector extension. The code is using also C++ with some boost based smart pointers. The application is spreed over 10 static libraries and some more libraries from TI (NDK, UIA, PDK ...).

    If I start the RTOS Object View then it takes more than 15 minutes to display some data, however the CCS works in that time.

    In the meantime I have some success to use Ethernet based UIA tracing. So the issue of STM decoder is not a real problem for me currently. I can transfer my messages as UIA based LOG messages. For details of my solution look here:

    e2e.ti.com/.../567465

    I do not want to waste your time. It will be very hard to find the reason of the STM decoder issue. Finally, in small applications it works, in my bigger application the same code does not work.

    Let me know, if I can do anything to find the reason of issue.

    Kind regards
    Sven