Hi folks,
in my application I create multiple GateMP instances, one for each FIFO communication channel I use. However, if there are more then about 28 channels GateMP_create() function starts to produces the following error:
"ti.sdo.ipc.GateMP: line 1384: E_gateUnavailable: No gates of requested type are available"
Is there a limit for the amount of Gates that can be created? Do I need more memory in shared region 0?
for creation of FIFO communication channels I initialize the Gate:
-----
Char fifo_gate_name[] = "edma_\0\0";
System_sprintf(&fifo_gate_name[5], "%d", fifo->id);
/* Create the gate needed for mutual exclusion */
GateMP_Params_init(&gparams);
gparams.name = (String)fifo_gate_name;
gparams.regionId = 0;
gparams.localProtect = GateMP_LocalProtect_THREAD;
gparams.remoteProtect = GateMP_RemoteProtect_SYSTEM;
gate = GateMP_create(&gparams);
-----
I'm using the latest CCS 5.2.1 with MCSDK 2.0.9
My platform configuration file is attached, the debugging is done with an XSD510 USB Plus.
Platform config:
/****************************************************************************** *****************************************************************************/ /* ============= XDC Runtime Configuration ============= */ var Memory = xdc.useModule('xdc.runtime.Memory'); var Log = xdc.useModule('xdc.runtime.Log'); var Error = xdc.useModule('xdc.runtime.Error'); var Diags = xdc.useModule('xdc.runtime.Diags'); var Timestamp = xdc.useModule('xdc.runtime.Timestamp'); var Startup = xdc.useModule('xdc.runtime.Startup'); var System = xdc.useModule('xdc.runtime.System'); var SysStd = xdc.useModule('xdc.runtime.SysStd'); System.SupportProxy = SysStd; /* ================ BIOS Configuration ================ */ var BIOS = xdc.useModule('ti.sysbios.BIOS'); var Task = xdc.useModule('ti.sysbios.knl.Task'); var Clock = xdc.useModule('ti.sysbios.knl.Clock'); var Sem = xdc.useModule('ti.sysbios.knl.Semaphore'); var Hwi = xdc.useModule('ti.sysbios.hal.Hwi'); var Ecm = xdc.useModule('ti.sysbios.family.c64p.EventCombiner'); var BiosCache = xdc.useModule('ti.sysbios.hal.Cache'); var Idle = xdc.useModule('ti.sysbios.knl.Idle'); var HeapBuf = xdc.useModule('ti.sysbios.heaps.HeapBuf'); var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem'); var Exc = xdc.useModule('ti.sysbios.family.c64p.Exception'); var Cache = xdc.useModule('ti.sysbios.family.c66.Cache'); var Load = xdc.useModule('ti.sysbios.utils.Load'); var CpIntc = xdc.useModule('ti.sysbios.family.c66.tci66xx.CpIntc'); var ECM = xdc.useModule ("ti.sysbios.family.c64p.EventCombiner"); Idle.addFunc('&myIdleFunc'); //Cache.setMarMeta(0x80000000, 0x20000000, Cache.PC | Cache.PCX | Cache.PFX | Cache.WTE ); ECM.eventGroupHwiNum[0] = 7; ECM.eventGroupHwiNum[1] = 8; ECM.eventGroupHwiNum[2] = 9; ECM.eventGroupHwiNum[3] = 10; /* Create a default system heap using ti.bios.HeapMem. */ Memory.defaultHeapSize = 0x20000; Program.heap = 0x20000; /* Load and configure NDK */ //var Global = xdc.useModule('ti.ndk.config.Global'); /* ================ IPC Configuration ================ */ /* Modules explicitly used in the application */ var Ipc = xdc.useModule('ti.sdo.ipc.Ipc'); var MessageQ = xdc.useModule('ti.sdo.ipc.MessageQ'); var GateMP = xdc.useModule('ti.sdo.ipc.GateMP'); var HeapBufMP = xdc.useModule('ti.sdo.ipc.heaps.HeapBufMP'); var HeapMemMP = xdc.useModule('ti.sdo.ipc.heaps.HeapMemMP'); var SharedRegio = xdc.useModule('ti.sdo.ipc.SharedRegion'); var MultiProc = xdc.useModule('ti.sdo.utils.MultiProc'); MultiProc.setConfig(null, ["CORE0", "CORE1", "CORE2", "CORE3", "CORE4", "CORE5", "CORE6", "CORE7"]); /* Synchronize all processors (this will be done in Ipc_start) */ Ipc.procSync = Ipc.ProcSync_ALL; /* Shared Memory base address and length */ var SHAREDMEM0 = 0x0C200000; var SHAREDMEMSIZE0 = 0x00110000; var SHAREDMEM1 = 0x0C310000; var SHAREDMEMSIZE1 = 0x00070000; var SHAREDMEM2 = 0x98000000; var SHAREDMEMSIZE2 = 0x04000000; /* * Need to define the shared region. The IPC modules use this * to make portable pointers. All processors need to add this * call with their base address of the shared memory region. * If the processor cannot access the memory, do not add it. */ var SharedRegion = xdc.useModule('ti.sdo.ipc.SharedRegion'); SharedRegion.numEntries = 3; SharedRegion.translate = false; SharedRegion.setEntryMeta(0, { base: SHAREDMEM0, len: SHAREDMEMSIZE0, ownerProcId: 0, isValid: true, cacheLineSize: 128, name: "SR0", }); SharedRegion.setEntryMeta(1, { base: SHAREDMEM1, len: SHAREDMEMSIZE1, ownerProcId: 0, isValid: true, cacheLineSize: 128, name: "SR1", }); SharedRegion.setEntryMeta(2, { base: SHAREDMEM2, len: SHAREDMEMSIZE2, ownerProcId: 0, isValid: true, cacheEnable: true, createHeap: true, cacheLineSize: 128, name: "SR2", }); /* =========== CPPI and QMSS Configuration =========== */ var Cppi = xdc.loadPackage('ti.drv.cppi'); var Qmss = xdc.loadPackage('ti.drv.qmss'); /* Use the CSL module and indicate that INTC library will be used. */ var cslSettings = xdc.useModule ('ti.csl.Settings'); cslSettings.useCSLIntcLib = true; /* ================ Logger configuration ================ */ var LoggerCircBuf = xdc.useModule('ti.uia.runtime.LoggerCircBuf'); var Diags = xdc.useModule('xdc.runtime.Diags'); var Defaults = xdc.useModule('xdc.runtime.Defaults'); var Main = xdc.useModule('xdc.runtime.Main'); var Load = xdc.useModule('ti.sysbios.utils.Load'); Load.windowInMs = 50; Load.windowInMs = 50; CpuTimestamp = xdc.useModule('ti.uia.family.c66.TimestampC66XLocal'); GlobalTimestamp = xdc.useModule('ti.uia.family.c66.TimestampC66XGlobal'); LogSync = xdc.useModule('ti.uia.runtime.LogSync'); LogSync.enableEventCorrelationForJTAG = true; LogSync.GlobalTimestampProxy = GlobalTimestamp; LogSync.CpuTimestampProxy = CpuTimestamp; CpuTimestamp.maxTimerClockFreq = {lo:1000000000,hi:0}; CpuTimestamp.maxBusClockFreq = {lo:1000000000,hi:0}; GlobalTimestamp.maxTimerClockFreq = {lo:250000000,hi:0}; GlobalTimestamp.maxBusClockFreq = {lo:1000000000,hi:0}; GlobalTimestamp.cpuCyclesPerTick = 4; Exc.common$.logger = Main.common$.logger; Exc.enablePrint = true; var LoggingSetup = xdc.useModule('ti.uia.sysbios.LoggingSetup'); // Increase the sysbios logger and turn Hwi and Swi logging off LoggingSetup.sysbiosLoggerSize = 32768; LoggingSetup.mainLoggerSize = 8*1024; LoggingSetup.loadLoggerSize = 32768; LoggingSetup.loadLogging = true; // true LoggingSetup.sysbiosTaskLogging = false; // true LoggingSetup.sysbiosSwiLogging = false; LoggingSetup.sysbiosHwiLogging = false; //LoggingSetup.eventUploadMode = LoggingSetup.UploadMode_NONJTAGTRANSPORT; LoggingSetup.eventUploadMode = LoggingSetup.UploadMode_JTAGRUNMODE; // C66xx JTAG // ================ UIA configuration ================ var UIABenchmark = xdc.useModule('ti.uia.events.UIABenchmark'); /* ========= General Sections Configuration ========== */ Program.sectMap["systemHeap"] = Program.platform.stackMemory; Program.sectMap[".fifoTable"] = new Program.SectionSpec(); Program.sectMap[".fifoTable"].loadAddress = 0x0C380000; Program.sectMap[".fifoTable"].fill = 0x00000000; Program.sectMap[".qmss"] = "SL2SRAM_SHARED"; Program.sectMap[".cppi"] = "SL2SRAM_SHARED"; Program.sectMap[".csl_vect"] = "LL2SRAM"; Program.sectMap[".ppdata"] = "LL2SRAM"; Program.sectMap[".dataLL2SRAM"] = "LL2SRAM"; Program.sectMap[".dataDDRShared"] = "DDR3_SHARED"; Program.sectMap[".dataSL2SRAMShared"] = "SL2SRAM_SHARED";