Dear all,
I am working on C6657 processor and SYS/BIOS 6.40.0339.
When the sytem is running, some times i get the following error E_spOutOfBounds: Task 0x85d7cc stack error, SP = 0x80428530. The task is not always the same. I have checked the ROV and the usage of stack is low.
I am using the EDMA interrupts and mcbso interrupts in my program
Coud you please help me?
Please have a look in the image below .
Below you can find the cfg file
var Defaults = xdc.useModule('xdc.runtime.Defaults');
var Diags = xdc.useModule('xdc.runtime.Diags');
var Error = xdc.useModule('xdc.runtime.Error');
var Log = xdc.useModule('xdc.runtime.Log');
var LoggerBuf = xdc.useModule('xdc.runtime.LoggerBuf');
var Main = xdc.useModule('xdc.runtime.Main');
var Memory = xdc.useModule('xdc.runtime.Memory')
var SysMin = xdc.useModule('xdc.runtime.SysMin');
var System = xdc.useModule('xdc.runtime.System');
var Text = xdc.useModule('xdc.runtime.Text');
var BIOS = xdc.useModule('ti.sysbios.BIOS');
var Swi = xdc.useModule('ti.sysbios.knl.Swi');
var Task = xdc.useModule('ti.sysbios.knl.Task');
var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore');
var Mailbox = xdc.useModule('ti.sysbios.knl.Mailbox');
var GIO = xdc.useModule('ti.sysbios.io.GIO');
var DEV = xdc.useModule('ti.sysbios.io.DEV');
var ECM = xdc.useModule("ti.sysbios.family.c64p.EventCombiner");
var Clock = xdc.useModule('ti.sysbios.knl.Clock');
var Hwi = xdc.useModule('ti.sysbios.hal.Hwi');
var Cache = xdc.useModule('ti.sysbios.family.c66.Cache');
//var Timer = xdc.useModule('ti.sysbios.hal.Timer');
var Timer64 = xdc.useModule('ti.sysbios.timers.timer64.Timer')
var GateMutexPri = xdc.useModule('ti.sysbios.gates.GateMutexPri');
var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');
var Edma = xdc.loadPackage('ti.sdo.edma3.drv');
var Timestamp = xdc.useModule('xdc.runtime.Timestamp');
var ECM = xdc.useModule("ti.sysbios.family.c64p.EventCombiner");
var CpIntc = xdc.useModule('ti.sysbios.family.c66.tci66xx.CpIntc');
var Idle = xdc.useModule('ti.sysbios.knl.Idle');
Idle.idleFxns[0] = "&DBG_idlfxn";
/*use CSL package*/
var cslSettings = xdc.useModule ('ti.csl.Settings');
//Cache.setMarMeta(0x80000000, 0x07FFFFFF, 0x1);
environment['xdc.cfg.check.fatal'] = 'false';
/*
* Uncomment this line to globally disable Asserts.
* All modules inherit the default from the 'Defaults' module. You
* can override these defaults on a per-module basis using Module.common$.
* Disabling Asserts will save code space and improve runtime performance.
Defaults.common$.diags_ASSERT = Diags.ALWAYS_OFF;
*/
/*
* Uncomment this line to keep module names from being loaded on the target.
* The module name strings are placed in the .const section. Setting this
* parameter to false will save space in the .const section. Error and
* Assert messages will contain an "unknown module" prefix instead
* of the actual module name.
Defaults.common$.namedModule = false;
*/
/*
* Minimize exit handler array in System. The System module includes
* an array of functions that are registered with System_atexit() to be
* called by System_exit().
*/
System.maxAtexitHandlers = 4;
System.SupportProxy = SysMin;
/*
* Uncomment this line to disable the Error print function.
* We lose error information when this is disabled since the errors are
* not printed. Disabling the raiseHook will save some code space if
* your app is not using System_printf() since the Error_print() function
* calls System_printf().
Error.raiseHook = null;
*/
/*
* Uncomment this line to keep Error, Assert, and Log strings from being
* loaded on the target. These strings are placed in the .const section.
* Setting this parameter to false will save space in the .const section.
* Error, Assert and Log message will print raw ids and args instead of
* a formatted message.
Text.isLoaded = false;
*/
/*
* Uncomment this line to disable the output of characters by SysMin
* when the program exits. SysMin writes characters to a circular buffer.
* This buffer can be viewed using the SysMin Output view in ROV.
SysMin.flushAtExit = false;
*/
/*
* The BIOS module will create the default heap for the system.
* Specify the size of this default heap.
*/
BIOS.heapSize = 0x12000;
/*
* Build a custom SYS/BIOS library from sources.
*/
BIOS.libType = BIOS.LibType_Custom;
BIOS.cpuFreq.lo = 850000000; /* max 850 MHz for C6654, 1000 MHz for C6657 */
//NOTE: enable the interrupts
// No interrupt is triggered without this apart from set dynamically
//ECM.eventGroupHwiNum[0] = 7;
//ECM.eventGroupHwiNum[1] = 8;
//ECM.eventGroupHwiNum[2] = 9;
//ECM.eventGroupHwiNum[3] = 10;
/* System stack size (used by ISRs and Swis) */
Program.stack = 0x1000;
/* Circular buffer size for System_printf() */
SysMin.bufSize = 0x300;
LoggerBuf.enableFlush = true;
/*
* Create and install logger for the whole system
*/
var loggerBuf0Params = new LoggerBuf.Params();
loggerBuf0Params.instance.name = "DBG_traceLogHandle";
loggerBuf0Params.bufHeap = Program.global.logRamSection_handle;
loggerBuf0Params.bufSection = ".trace_section";
//loggerBuf0Params.bufType = LoggerBuf.BufType_CIRCULAR;
loggerBuf0Params.exitFlush = true;
loggerBuf0Params.numEntries = 64;
Program.global.DBG_traceLogHandle = LoggerBuf.create(loggerBuf0Params);
Main.common$.diags_INFO = Diags.ALWAYS_ON;
Swi.common$.diags_INFO = Diags.ALWAYS_ON;
Hwi.common$.diags_INFO = Diags.ALWAYS_ON;
Task.common$.diags_INFO = Diags.ALWAYS_ON
var loggerBuf1Params = new LoggerBuf.Params();
loggerBuf1Params.instance.name = "LOG_systemHandle";
loggerBuf1Params.bufSection = ".trace_section";
loggerBuf1Params.bufHeap = Program.global.logRamSection_handle;
loggerBuf1Params.exitFlush = true;
loggerBuf0Params.numEntries = 64;
Program.global.LOG_systemHandle = LoggerBuf.create(loggerBuf1Params);
Defaults.common$.logger = Program.global.LOG_systemHandle;
LoggerBuf.common$.instanceHeap = Program.global.logRamSection_handle;
LoggerBuf.common$.instanceSection = ".trace_section";
LoggerBuf.common$.namedInstance = true;
/*
Create device instances
*/
var pcmParams = new DEV.Params();
pcmParams.instance.name = "pcm";
pcmParams.initFxn = null;
Program.global.pcm = DEV.create("/pcm", "&PCM_iomFxns", pcmParams);
var apiParams = new DEV.Params();
apiParams.instance.name = "api";
apiParams.initFxn = null;
Program.global.api = DEV.create("/api", "&API_iomFxns", apiParams);
//
//NOTE:
/*
IDRAM0 = MEM.create("IDRAM0");
IDRAM0.heapSize = 0x00030000
IDRAM0.len = 0x00074300
IDRAM0.base = 0x00000300
*/
var heapMemParamsCM_Env = new HeapMem.Params;
heapMemParamsCM_Env.size = 0x00030000 ;
heapMemParamsCM_Env.align = 32;
heapMemParamsCM_Env.sectionName = ".cm_section";
heapMemParamsCM_Env.instance.name = "cmEnvironHandle";
Program.global.cmEnvironHandle = HeapMem.create(heapMemParamsCM_Env);
Program.sectMap[".cm_section "] = "CHANRAM";
//NOTE:
/*
EDRAM = MEM.create("EDRAM");
EDRAM.heapSize = 0x0038b500
EDRAM.len = 0x00500000
EDRAM.base = 0x80080000
*/
var heapMemParamsEDRAM = new HeapMem.Params;
heapMemParamsEDRAM.size = 0x0038b500;
heapMemParamsEDRAM.align = 32;
heapMemParamsEDRAM.sectionName = ".edram_section";
heapMemParamsEDRAM.instance.name = "edramHeapSectionHandle";
Program.global.edramHeapSectionHandle = HeapMem.create(heapMemParamsEDRAM);
Program.sectMap[".edram_section"] = "EDRAM";
//HeapMem.common$.instanceHeap = Program.global.edramHeapSectionHandle;
//HeapMem.common$.instanceSection = ".edram_section";
GIO.common$.instanceHeap = Program.global.edramHeapSectionHandle;
GIO.common$.instanceSection = ".edram_section";
//Mailbox.common$.instanceHeap = Program.global.edramHeapSectionHandle;
//Mailbox.common$.instanceSection = ".edram_section";
//NOTE
/*
LOGRAM = MEM.create("LOGRAM");
LOGRAM.heapSize = 0x00e7FF00
LOGRAM.len = 0x00e7FF00
LOGRAM.base = 0x89180100
*/
var heapMemParamsLOGRAM = new HeapMem.Params;
heapMemParamsLOGRAM.size = 0x00e7FF00;
heapMemParamsLOGRAM.align = 32;
heapMemParamsLOGRAM.sectionName = ".trace_section";
heapMemParamsLOGRAM.instance.name = "logRamSection_handle";
Program.global.logRamSection_handle = HeapMem.create(heapMemParamsLOGRAM);
Program.sectMap[".trace_section"] = "LOGRAM";
//NOTE:
/*
SDERAM = MEM.create("SDERAM");
SDERAM.heapSize = 0x00010000
SDERAM.len = 0x00010000
SDERAM.base = 0x89170100
*/
var heapMemParamsCM = new HeapMem.Params;
heapMemParamsCM.size = 0x00010000 ;
heapMemParamsCM.align = 32;
heapMemParamsCM.sectionName = "SDERAMSection";
heapMemParamsCM.instance.name = "sderamHandle";
Program.global.sderamHandle = HeapMem.create(heapMemParamsCM);
Program.sectMap["SDERAMSection"] = "SDERAM";
var timer0Params = new Timer64.Params();
timer0Params.instance.name = "hTimer0";
timer0Params.period = 62500;
timer0Params.intNum = 11;
timer0Params.startMode = xdc.module("ti.sysbios.interfaces.ITimer").StartMode_USER;
Program.global.hTimer0 = Timer64.create(0, null, timer0Params);
var timer1Params = new Timer64.Params();
timer1Params.instance.name = "hTimer1";
//timer1Params.period = 0x1E848; // defined in the code
timer1Params.intNum = 12;
timer1Params.startMode = xdc.module("ti.sysbios.interfaces.ITimer").StartMode_USER;
Program.global.hTimer1 = Timer64.create(2, "&TIM_int", timer1Params);
/*
var clock0Params = new Clock.Params();
clock0Params.instance.name = "api_clock";
//clock0Params.period = 1;
clock0Params.startFlag = true;
Program.global.api_clock = Clock.create("&API_rxISR", 1, clock0Params);
Clock.tickSource = Clock.TickSource_USER;
*/
var timer64Params = new Timer64.Params();
timer64Params.instance.name = "hTimer64";
timer64Params.period = 0x1; // in microsecs
timer64Params.extFreq.lo = 850000;
timer64Params.intNum = 13;
timer64Params.startMode = xdc.module("ti.sysbios.interfaces.ITimer").StartMode_USER;
Program.global.hTimer64 = Timer64.create(3, "&API_rxISR", timer64Params);
var semaphore0Params = new Semaphore.Params();
semaphore0Params.instance.name = "CM_terminateSem";
Program.global.CM_terminateSem = Semaphore.create(null, semaphore0Params);
/*Synchronize the reclaim and issue */
var semaphore2Params = new Semaphore.Params();
semaphore2Params.instance.name = "pcm_io_sem";
Program.global.pcm_io_sem = Semaphore.create(null, semaphore2Params);
/*
var semaphore3Params = new Semaphore.Params();
semaphore3Params.instance.name = "pcm_tsa_out_sem";
Program.global.pcm_tsa_out_sem = Semaphore.create(null, semaphore3Params);
*/
var gateMutexPri0Params = new GateMutexPri.Params();
gateMutexPri0Params.instance.name = "mutexPri";
Program.global.mutexPri = GateMutexPri.create(gateMutexPri0Params);
var API_rxTskParams = new Task.Params();
API_rxTskParams.instance.name = "API_rxTskHandle";
API_rxTskParams.stackSize = 4096;
API_rxTskParams.priority = 8;
//API_rxTskParams.stackHeap = Program.global.edramHeapSectionHandle ;
//TODO: check the definitions below
//API_rxTskParams.stackSection = ".edram_stack";
Program.global.API_rxTskHandle = Task.create("&API_rxTsk", API_rxTskParams);
var FM_taskFxnParams = new Task.Params();
FM_taskFxnParams.instance.name = "FM_taskFxnHandle";
FM_taskFxnParams.stackSize = 2048;
FM_taskFxnParams.priority = 5;
FM_taskFxnParams.stackHeap = Program.global.edramHeapSectionHandle;
//TODO: check the definitions below
FM_taskFxnParams.stackSection = ".edram_stack";
Program.global.FM_taskFxnHandle = Task.create("&FM_taskFxn", FM_taskFxnParams);
var CallbackIn_taskFxnParams = new Task.Params();
CallbackIn_taskFxnParams.instance.name = "pcmCallbackInTskHandle";
CallbackIn_taskFxnParams.stackSize = 2048;
CallbackIn_taskFxnParams.priority = 1;
CallbackIn_taskFxnParams.stackHeap = Program.global.edramHeapSectionHandle;
//TODO: check the definitions below
CallbackIn_taskFxnParams.stackSection = ".edram_stack";
Program.global.pcmCallbackInTskHandle = Task.create("&pcmCallbackInTskFxn", CallbackIn_taskFxnParams);
var CallbackOut_taskFxnParams = new Task.Params();
CallbackOut_taskFxnParams.instance.name = "pcmCallbackOutTskHandle";
CallbackOut_taskFxnParams.stackSize = 2048;
CallbackOut_taskFxnParams.priority = 1;
CallbackOut_taskFxnParams.stackHeap = Program.global.edramHeapSectionHandle;
//TODO: check the definitions below
CallbackOut_taskFxnParams.stackSection = ".edram_stack";
Program.global.pcmCallbackOutTskHandle = Task.create("&pcmCallbackOutTskFxn", CallbackOut_taskFxnParams);
BIOS.rtsGateType = BIOS.GateMutexPri;

