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.
Part Number: EVMK2H
Tool/software: Code Composer Studio
Hello,
I have been debugging a benchmark program I have written on one of the C66 cores of the EVMK2H.
On the first load everything appears to be OK. But after one iteration of my benchmarking loop the debugger appears to have issues controlling the device. After hitting halt / pause I get the following popup:
Trouble Halting Target CPU:
(Error -1202 @ 0x0)
Device core is hung. The debugger will attempt to force the device to a ready state to recover debug control. Your application's state will be corrupt. You should have limited access to memory and registers, but you may need to reset the device to debug further.
(Emulation package 7.0.48.0)
Here is the console output:
C66xx_0: GEL Output:
Connecting Target...
C66xx_0: GEL Output: TCI6638K2K GEL file Ver is 1.60000002
C66xx_0: GEL Output: Detected PLL bypass enabled: SECCTL[BYPASS] = 0x00800000
C66xx_0: GEL Output: (2a) MAINPLLCTL1 = 0x00000040
C66xx_0: GEL Output: (2b) PLLCTL = 0x00000048
C66xx_0: GEL Output: (2c) PLLCTL = 0x00000048
C66xx_0: GEL Output: (2d) Delay...
C66xx_0: GEL Output: (2e) SECCTL = 0x00810000
C66xx_0: GEL Output: (2f) PLLCTL = 0x0000004A
C66xx_0: GEL Output: (2g) Delay...
C66xx_0: GEL Output: (2h) PLLCTL = 0x00000048
C66xx_0: GEL Output: (4)PLLM[PLLM] = 0x0000000F
C66xx_0: GEL Output: MAINPLLCTL0 = 0x05000000
C66xx_0: GEL Output: (5) MAINPLLCTL0 = 0x07000000
C66xx_0: GEL Output: (5) MAINPLLCTL1 = 0x00000040
C66xx_0: GEL Output: (6) MAINPLLCTL0 = 0x07000000
C66xx_0: GEL Output: (7) SECCTL = 0x00890000
C66xx_0: GEL Output: (8a) Delay...
C66xx_0: GEL Output: PLL1_DIV3 = 0x00008002
C66xx_0: GEL Output: PLL1_DIV4 = 0x00008004
C66xx_0: GEL Output: PLL1_DIV7 = 0x00000000
C66xx_0: GEL Output: (8d/e) Delay...
C66xx_0: GEL Output: (10) Delay...
C66xx_0: GEL Output: (12) Delay...
C66xx_0: GEL Output: (13) SECCTL = 0x00090000
C66xx_0: GEL Output: (Delay...
C66xx_0: GEL Output: (Delay...
C66xx_0: GEL Output: (14) PLLCTL = 0x00000041
C66xx_0: GEL Output: PLL has been configured (CLKIN * PLLM / PLLD / PLLOD = PLLOUT):
C66xx_0: GEL Output: PLL has been configured (122.879997 MHz * 16 / 1 / 2 = 983.039978 MHz)
C66xx_0: GEL Output: Power on all PSC modules and DSP domains...
C66xx_0: GEL Output: Set_PSC_State... Timeout Error #03 pd=2, md=9!
C66xx_0: GEL Output: Set_PSC_State... Timeout Error #03 pd=17, md=25!
C66xx_0: GEL Output: Set_PSC_State... Timeout Error #03 pd=17, md=26!
C66xx_0: GEL Output: Set_PSC_State... Timeout Error #03 pd=18, md=27!
C66xx_0: GEL Output: Set_PSC_State... Timeout Error #03 pd=19, md=28!
C66xx_0: GEL Output: Set_PSC_State... Timeout Error #03 pd=19, md=29!
C66xx_0: GEL Output: Set_PSC_State... Timeout Error #03 pd=20, md=30!
C66xx_0: GEL Output: Set_PSC_State... Timeout Error #03 pd=20, md=31!
C66xx_0: GEL Output: Set_PSC_State... Timeout Error #03 pd=20, md=32!
C66xx_0: GEL Output: Set_PSC_State... Timeout Error #03 pd=20, md=33!
C66xx_0: GEL Output: Set_PSC_State... Timeout Error #03 pd=21, md=34!
C66xx_0: GEL Output: Set_PSC_State... Timeout Error #03 pd=22, md=35!
C66xx_0: GEL Output: Set_PSC_State... Timeout Error #03 pd=22, md=36!
C66xx_0: GEL Output: Set_PSC_State... Timeout Error #03 pd=23, md=37!
C66xx_0: GEL Output: Set_PSC_State... Timeout Error #03 pd=23, md=38!
C66xx_0: GEL Output: Set_PSC_State... Timeout Error #03 pd=24, md=39!
C66xx_0: GEL Output: Set_PSC_State... Timeout Error #03 pd=24, md=40!
C66xx_0: GEL Output: Set_PSC_State... Timeout Error #03 pd=24, md=41!
C66xx_0: GEL Output: Set_PSC_State... Timeout Error #03 pd=24, md=42!
C66xx_0: GEL Output: Set_PSC_State... Timeout Error #03 pd=25, md=43!
C66xx_0: GEL Output: Set_PSC_State... Timeout Error #03 pd=25, md=44!
C66xx_0: GEL Output: Set_PSC_State... Timeout Error #03 pd=25, md=45!
C66xx_0: GEL Output: Set_PSC_State... Timeout Error #03 pd=25, md=46!
C66xx_0: GEL Output: Set_PSC_State... Timeout Error #03 pd=26, md=47!
C66xx_0: GEL Output: Set_PSC_State... Timeout Error #03 pd=27, md=48!
C66xx_0: GEL Output: Power on all PSC modules and DSP domains... Done.
C66xx_0: GEL Output: WARNING: SYSCLK is the input to the PA PLL.
C66xx_0: GEL Output: Completed PA PLL Setup
C66xx_0: GEL Output: PAPLLCTL0 - before: 0x0x098804C0 after: 0x0x09080500
C66xx_0: GEL Output: PAPLLCTL1 - before: 0x0x00000040 after: 0x0x00002040
C66xx_0: GEL Output: DDR begin
C66xx_0: GEL Output: XMC setup complete.
C66xx_0: GEL Output: DDR3 PLL (PLL2) Setup ...
C66xx_0: GEL Output: DDR3 PLL Setup complete, DDR3A clock now running at 666 MHz.
C66xx_0: GEL Output: DDR3A initialization complete
C66xx_0: GEL Output: DDR3 PLL Setup ...
C66xx_0: GEL Output: DDR3 PLL Setup complete, DDR3B clock now running at 800MHz.
C66xx_0: GEL Output: DDR3B initialization complete
C66xx_0: GEL Output: DDR done
C66xx_0: Trouble Halting Target CPU: (Error -1060 @ 0x0) Device is not responding to the request. Reset the device, and retry the operation. If error persists, confirm configuration, power-cycle the board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 7.0.48.0)
C66xx_0: Trouble Halting Target CPU: (Error -1202 @ 0x0) Device core is hung. The debugger will attempt to force the device to a ready state to recover debug control. Your application's state will be corrupt. You should have limited access to memory and registers, but you may need to reset the device to debug further. (Emulation package 7.0.48.0)
Here is my benchmark loop:
Void BenchmarkTask_RunBenchmark(UArg arg0, UArg arg1)
{
algorithms_ICovariance_dataCell_s weights[16]; // hard coded size!!!
UInt32 preTicks;
UInt32 covarTicks;
UInt32 triTicks;
UInt32 postTicks;
UInt32 covTime;
UInt32 chTime;
UInt32 triTime;
UInt32 totalTime;
Timer_Handle timerH;
BenchmarkTask_Object* obj = (BenchmarkTask_Object*)arg0;
timerH = Clock_getTimerHandle();
Log_print0(Diags_USER2,"enter loop");
while(1)
{
preTicks = Timer_getCount(timerH);
tasks_BenchmarkTask_PCovariance_RunCovariance(obj->CovarianceH, &(module->inputData[0]), &(module->choleskyData[0]));
covarTicks = Timer_getCount(timerH);
tasks_BenchmarkTask_PCholesky_RunCholesky(obj->CholeskyH, &(module->choleskyData[0]));
triTicks = Timer_getCount(timerH);
tasks_BenchmarkTask_PTrisolve_RunTrisolve(obj->TrisolveH, &(module->choleskyData[0]), &(weights[0]), &(module->outputData[0]));
postTicks = Timer_getCount(timerH);
totalTime = postTicks - preTicks;
covTime = covarTicks - preTicks;
chTime = triTicks - covarTicks;
triTime = postTicks - triTicks;
Log_print4(Diags_USER2,"%u %u %u %u", covTime, chTime, triTime, totalTime);
}
}
Here is the core's config file:
//////////////////////////////////////////////
// Generic XDC Modules for use
//////////////////////////////////////////////
var Main = xdc.useModule('xdc.runtime.Main');
// logger for diagnostics tools
//var LoggerBuf = xdc.useModule('xdc.runtime.LoggerBuf');
var LoggerSys = xdc.useModule('xdc.runtime.LoggerSys');
//Generic Defaults - random things go here
var Defaults = xdc.useModule('xdc.runtime.Defaults');
// Diagnostics tools
var Diags = xdc.useModule('xdc.runtime.Diags');
var Log = xdc.useModule('xdc.runtime.Log');
var SysStd = xdc.useModule('xdc.runtime.SysStd');
var System = xdc.useModule('xdc.runtime.System');
var Program = xdc.useModule('xdc.cfg.Program');
var Memory = xdc.useModule('xdc.runtime.Memory');
//////////////////////////////////////////////
// BIOS Modules for use
//////////////////////////////////////////////
var Bios = xdc.useModule('ti.sysbios.BIOS');
var Task = xdc.useModule('ti.sysbios.knl.Task');
var Clock = xdc.useModule('ti.sysbios.knl.Clock');
var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');
// bios utility for CPU loading
var Load = xdc.useModule('ti.sysbios.utils.Load');
var Timer64 = xdc.useModule('ti.sysbios.hal.Timer');
//////////////////////////////////////////////
// TI Debugging modules -- not needed for C66?
//////////////////////////////////////////////
//var ti_rtdx_driver_RtdxDvr = xdc.useModule('ti.rtdx.driver.RtdxDvr');
//var ti_rtdx_RtdxModule = xdc.useModule('ti.rtdx.RtdxModule');
//////////////////////////////////////////////
// TI Debugging modules
//////////////////////////////////////////////
var UIAErr = xdc.useModule('ti.uia.events.UIAErr');
var UIAEvt = xdc.useModule('ti.uia.events.UIAEvt');
var UIABenchmark= xdc.useModule('ti.uia.events.UIABenchmark');
var UIAStatistic= xdc.useModule('ti.uia.events.UIAStatistic');
//var UIALogger = xdc.useModule('ti.uia.loggers.LoggerRunMode');
// parameters for creating new tasks
var task_params = new Task.Params;
//////////////////////////////////////////////
// Diagnostics and Logging Configuration
//////////////////////////////////////////////
// Old logger
//var logbuf_params = new LoggerBuf.Params;
//logbuf_params.bufType = LoggerBuf.BufType_CIRCULAR;
//logbuf_params.numEntries = 512;
//logbuf_params.exitFlush = true;
//var loggerBuf = LoggerBuf.create(logbuf_params);
// New UIA Logger
//var loggerParams = new UIALogger.Params();
//loggerParams.transferBufSize = 32768;
//loggerBuf = UIALogger.create(loggerParams);
//loggerBuf.instance.name = "Main Logger";
//Load.taskEnabled = true;
var LoggingSetup = xdc.useModule('ti.uia.sysbios.LoggingSetup');
/* Use LoggerRunMode with real-time JTAG upload */
LoggingSetup.loggerType = LoggingSetup.LoggerType_JTAGRUNMODE;
LoggingSetup.loadLoggerSize = 1024;
LoggingSetup.mainLoggerSize = 32768;
LoggingSetup.sysbiosLoggerSize = 32768;
/* Enable CPU Load logging */
LoggingSetup.loadLogging = true;
//Main.common$.logger = loggerBuf;
Main.common$.diags_USER1 = Diags.RUNTIME_ON;
Main.common$.diags_USER2 = Diags.RUNTIME_ON;
Main.common$.diags_USER3 = Diags.RUNTIME_OFF;
Main.common$.diags_USER4 = Diags.RUNTIME_OFF;
Main.common$.diags_USER5 = Diags.RUNTIME_OFF;
Main.common$.diags_USER6 = Diags.RUNTIME_OFF;
Main.common$.diags_INFO = Diags.RUNTIME_ON;
Main.common$.diags_ANALYSIS = Diags.RUNTIME_ON;
Main.common$.diags_LIFECYCLE = Diags.RUNTIME_ON;
Main.common$.diags_INTERNAL = Diags.RUNTIME_ON;
Main.common$.diags_EXIT = Diags.RUNTIME_ON;
Main.common$.diags_ENTRY = Diags.RUNTIME_ON;
//////////////////////////////////////////////
// load program specific modules
//////////////////////////////////////////////
var Benchmark = xdc.useModule('tasks.BenchmarkTask');
Benchmark.PCovariance = xdc.useModule('algorithms.CovarianceC');
Benchmark.PCholesky = xdc.useModule('algorithms.CholeskyB');
Benchmark.PTrisolve = xdc.useModule('algorithms.TrisolveB');
// create and configure program specific XDC Instances
var covar_params = new Benchmark.PCovariance.Params;
//covar_params.NumChannels = 16;
//covar_params.NumRangeCells = 143;
var cholesky_params = new Benchmark.PCholesky.Params;
cholesky_params.matrixSize = 16;
var trisolve_params = new Benchmark.PTrisolve.Params;
trisolve_params.matrixSize = 16;
var bench_params = new Benchmark.Params;
bench_params.CovarianceH = Benchmark.PCovariance.create(covar_params);
bench_params.CholeskyH = Benchmark.PCholesky.create(cholesky_params);
bench_params.TrisolveH = Benchmark.PTrisolve.create(trisolve_params);
var bench_task = Benchmark.create(bench_params);
// create the Benchmarking task
task_params.arg0 = bench_task;
task_params.arg1 = 0;
task_params.priority = 10;
Task.create(Benchmark.RunBenchmark, task_params);
//////////////////////////////////////////////
// Global Settings
//////////////////////////////////////////////
System.SupportProxy = SysStd;
System.extendedFormats = "%f";
// period in microseconds
Clock.tickPeriod = 100000;
//////////////////////////////////////////////
// Memory Settings
//////////////////////////////////////////////
Memory.defaultHeapSize = 0x10000;
Program.heap = 0x10000
Program.stack = 0x2000;
var heap_mem_params = new HeapMem.Params;
heap_mem_params.size = 0x10000;
heap_mem_params.align = 128;
Program.global.heap = HeapMem.create(heap_mem_params);
Memory.defaultHeapInstance = Program.global.heap;
The program was built manually on the command line in linux, and then debugged on windows with CCSv7.
xdctools: 3.32.02.22
SYS/BIOS: 6.46.05.55
UIA: 2.00.06.52
I had this running at one point in 2011 on the 6678 demoboard and CCSv5 back in 2011 using I don't remember what versions of xdc, bios and uia.
Thanks!
I have not seen anything in the ROV area which suggests any exceptions or errors have occurred.
I think the debugger locking up is a symptom.
I posted my config file above. my stack sizes are system heap are already huge! I see no point in going larger than 8K for stack and 64k for heap.
When I step through my code all seems ok until I step into this line:
timerH = Clock_getTimerHandle();
I placed a breakpoint on that line. and when I run up to that point I get the following:
Then i click the "step into" button and the following happens:
Why does stepping into a SYS/BIOS function call cause the stack trace to go out the window?
So I went through the process of rebuilding everything to match with the original era I got this up and running in.
I went FROM : TO on the following
CCSv7.3 : CCSv5.3
XDC 3.32.01.22 : XDC 3.24.03.33
BIOS 6.46.05.55 : BIOS 6.34.01.14
IPC 3.46.00.02 : IPC 1.23.01.26
UIA 2.00.06.52 : UIA 1.00.01.16_eng
and I was able to get the EVM6678 to act as intended:
As you can see from the continuously running printf logs and the lack of infinite stack traces of the same function, that it is alive.
But... How do I upgrade from the libraries / tools of 6+ years ago to what is compatible with CCSv7 era?
I have now attempted to upgrade to the latest XDCTools, BIOS and UIA:
XDC 3.50.03.33
BIOS 6.52.00.12
UIA 2.20.00.02
Attempting to run on CCSv7 and the infinite backtrace persists, and I am no longer getting any prints out of the EVM6678, but it appears to be "running." Without UIA prints, all I have for proof that it id running is that whenever I halt the CPU it stops in a different location.
On the EVMK2H board, after I configure UIA and turn on the print logs I instantly get a debugger error popup:
Ok, so I think I found the code that was causing the warning:
Timer_Handle timerH; BenchmarkTask_Object* obj = (BenchmarkTask_Object*)arg0; timerH = Clock_getTimerHandle();
There is a type mismatch here. The Clock timer proxy is "ti.sysbios.timers.timer64.Timer" and the handle returned by Clock_getTimerHandle() is the handle to that type of Timer object. I believe you are including "ti/sysbios/hal/Timer.h" in your benchmark app. A Timer64 timer object handle cannot be used with Hal Timer module APIs. If used, then it can cause a dereference to an invalid address and I guess could also result in loss of debug connection.
Can you change the Timer.h included in your benchmark app from "ti/sysbios/hal/Timer.h" to "ti/sysbios/timers/timer64/Timer.h" ?
Best,
Ashish