I`m using TCI6638, CCS v5.5, mcsdk 3.1.1.4.
There is a example, and it works. (path : C:\ti\mcsdk_bios_3_01_01_04\examples\ctools\evmk2h\mc_pc_trace_edma_drn)
But, when I apply to my project, It doesn`t work.
My project is using UART, IPC, and No EDMA.
I added codes below this.
in cfg file.
/* Load the Trace Debug Package */
xdc.loadPackage('ti.sdo.edma3.drv');
var ctools = xdc.loadPackage('ctoolslib_sdk.evmk2h');
and cpp file
int DspShellReadMem(const char * * params, int param_cnt)
{
uint32_t* pBuffer = 0;
int32_t coreId, i;
ctools_Result ctools_ret = {0};
ctools_edma_result_t pct_edma_res;
EDMA3_RM_Handle edma3_handle;
ctools_etb_config_t config = {0};
/* channel arrary */
uint32_t edma3_channels[10] = {0};
/* param array */
uint32_t edma3_params[10] = {0};
coreId = DNUM;
/* 1. Initialize the ETB */
/* 1a. Get the EDMA requirements/pre-setups for the ctools use case library */
edma3_handle = app_edma_pre_setup(&edma3_channels[0], &edma3_params[0]);
if (NULL == edma3_handle)
return -2;
config.edmaConfig.param_ptr = &edma3_params[0];
config.edmaConfig.dbufAddress = (uint32_t)&trace_data;
config.edmaConfig.dbufBytes = 0x2000;
config.edmaConfig.mode = CTOOLS_USECASE_EDMA_STOP_BUF_MODE;
config.etb_mode = eETB_TI_Mode;
if (CTOOLS_SOK != ctools_etb_init(CTOOLS_DRAIN_ETB_EDMA, &config, CTOOLS_DSP_ETB))
return -1;
/* 3. Initialize the DSP trace
* Please refer to the ctools use case library Doxygen API reference
* Guide for the API usage */
ctools_ret = ctools_dsptrace_init();
if (ctools_ret != CTOOLS_SOK)
{
System_printf (" ctools_dsptrace_init failed\n");
exit (1);
}
ctools_ret = ctools_pct_setup(&example_start_symb, &example_stop_symb);
//ctools_ret = ctools_pct_start_now();
if (ctools_ret != CTOOLS_SOK)
{
System_printf (" ctools_pct_start_exc failed\n");
return -1;
}
/* trigger the PC trace start in ETB when PC hits this function */
example_start_symb();
if (param_cnt != 3)
{
MAKE_DATA("[usage] : read_mem [start address(hex value)] [size(words)]\r\n");
MAKE_DATA("example : read_mem 80000000 16\r\n");
return 1;
}
unsigned long addr = strtoul(params[1], NULL, 16);
int size = atoi(params[2]);
unsigned long * ptr = (unsigned long *)addr;
Cache_wbInvAll();
for (int i=0; i<size; ++i)
{
MAKE_DATA("[%d] => 0x%08X\r\n", i, ptr[i]);
}
/* Trigger the PC trace stop when PC hits this function*/
example_stop_symb();
//if (CTOOLS_SOK != ctools_pct_stop_now()) return -2;
/* 5. Call PC trace job close, to drain the collected trace
* This would copy ETB hardware buffer as a linear buffer
* containing PC and timing traces to the memory provided here
*/
ctools_ret = ctools_etb_edma_drain(&pct_edma_res, CTOOLS_DSP_ETB);
if(ctools_ret == CTOOLS_SOK)
{
System_printf("ctools_etb_edma_drain successful, %d bytes would be available in the &etb_drain_mem[%d] memory\n", pct_edma_res.availableWords, DNUM);
}
else
{
System_printf("ctools_pct_stop_cpu_drn failed [%d]\n", ctools_ret);
}
/* 6. close the PCT */
ctools_pct_close();
/* 7. Shutdown the dsp trace */
ctools_ret = ctools_dsptrace_shutdown();
if(ctools_ret == CTOOLS_SOK)
{
System_printf("ctools_dsptrace_shutdown successful\n");
}
else
{
System_printf("ctools_dsptrace_shutdown failed\n");
}
System_flush();
return 1;
}
when I execute this code, There is No Error.
In console window message,
edma3init() Passed
ctools_etb_edma_drain successful, 2048 bytes would be available in the &etb_drain_mem[0] memory
ctools_dsptrace_shutdown successful
But, in trace_data buffer memory, there is no data.
What is problem? please help me. I have no idea.

