Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 262198

RTOS/TMS320C6678: HeapMem: line 221: out of memory

$
0
0

Part Number:TMS320C6678

Tool/software: TI-RTOS

I am composing a cpp program using sysBios. When I enter new operator at the instantiation of a pointer to a class
paToProcessThroughputAccelerator =
new ThroughputAccelerator;
in the code below I get this

"ti.sysbios.heaps.HeapMem: line 221: out of memory: handle=0x840770, size=478956"

tracing into the code I arrive here

Ptr HeapMem_alloc(HeapMem_Object *obj, SizeT reqSize,
SizeT reqAlign, Error_Block *eb)
{
IArg key;
Ptr buffer;

key = Gate_enterModule();

buffer = HeapMem_allocUnprotected(obj, reqSize, reqAlign);

Gate_leaveModule(key);

if (buffer == NULL) {
Error_raise(eb, HeapMem_E_memory, (IArg)obj, (IArg)reqSize);
}
return (buffer);
}
"HeapMem_allocUnprotected(obj, reqSize, reqAlign)"returns a NULL to buffer and the
error manifests. The new object is not instantiated and the code fails.
Have you any idea where I have slipped in a bug?

Copy of failed snippet mentioned in first sentence ->
/*
* ======== taskFxn ========
* this is a skeletal pipeline manager spoof
*/
Void throughputAcceleratorTest(UArg a0, UArg a1)
{

System_printf("spoofing receiver\n");
// create in data
spoofReceiver();
// Let's go
System_printf("test Begins\n %d \n%d\n",1,2);
// instantiate edma 0 for pa(ddr) to process
// error asserts upon entering this +++++++++++++++++++++++++++
paToProcessThroughputAccelerator =
new ThroughputAccelerator;
// create edma driver object

System_flush(); /* force SysMin output to console */
}
/*
* ======== main ========
*/
Int main()
{
Task_Params param;
Task_Handle task;
Error_Block eb;

// System_printf("enter main()\n");
Task_Params_init(&param);
/* Create sntp task with priority 8*/
param.stackSize = 16384;

param.priority = 8;

Error_init(&eb);
task = Task_create(throughputAcceleratorTest, NULL, &eb);
if (task == NULL) {
// System_printf("Task_create() failed!\n");
BIOS_exit(0);
}

BIOS_start(); /* does not return */
return(0);
}

This is 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 Startup = xdc.useModule ("xdc.runtime.Startup");
var System = xdc.useModule('xdc.runtime.System');
var Text = xdc.useModule('xdc.runtime.Text');
var BIOS = xdc.useModule('ti.sysbios.BIOS');
var Clock = xdc.useModule('ti.sysbios.knl.Clock');
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 Hwi = xdc.useModule('ti.sysbios.hal.Hwi');
var ECM = xdc.useModule ("ti.sysbios.family.c64p.EventCombiner");
var C64_Hwi = xdc.useModule ("ti.sysbios.family.c64p.Hwi");
var Cache = xdc.useModule('ti.sysbios.hal.Cache');
var CpIntc = xdc.useModule('ti.sysbios.family.c66.tci66xx.CpIntc');
var ti_sysbios_family_c66_Cache = xdc.useModule('ti.sysbios.family.c66.Cache');

ECM.eventGroupHwiNum[0] = 7;
ECM.eventGroupHwiNum[1] = 8;
ECM.eventGroupHwiNum[2] = 9;
ECM.eventGroupHwiNum[3] = 10;


/*
* 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;

/*
* 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 = 0x1000;
*/
/*
* Build a custom SYS/BIOS library from sources.
*/
BIOS.libType = BIOS.LibType_Custom;

/* System stack size (used by ISRs and Swis) */
Program.stack = 0x2000;

/* Circular buffer size for System_printf() */
SysMin.bufSize = 0x200;

/*
* Create and install logger for the whole system
*/
var loggerBufParams = new LoggerBuf.Params();
loggerBufParams.numEntries = 16;
var logger0 = LoggerBuf.create(loggerBufParams);
Defaults.common$.logger = logger0;
Main.common$.diags_INFO = Diags.ALWAYS_ON;

System.SupportProxy = SysMin;

var runProcessAParams = new Swi.Params();
runProcessAParams.instance.name = "swiRunProcessA";
runProcessAParams.priority = 5;
runProcessAParams.arg0 = "&runProcessAIn";
runProcessAParams.arg1 = "&runProcessAOut";
Program.global.swiRunProcessA = Swi.create("&runProcessA", runProcessAParams);
var runProcessBParams = new Swi.Params();
runProcessBParams.instance.name = "swiRunProcessB";
runProcessBParams.priority = 5;
runProcessBParams.arg0 = "&runProcessBIn";
runProcessBParams.arg1 = "&runProcessBOut";
Program.global.swiRunProcessB = Swi.create("&runProcessB", runProcessBParams);
var semReadyForPAParams = new Semaphore.Params();
semReadyForPAParams.instance.name = "semReadyForPA";
semReadyForPAParams.mode = Semaphore.Mode_COUNTING;
Program.global.semReadyForPA = Semaphore.create(null, semReadyForPAParams);
var hwi0Params = new Hwi.Params();
hwi0Params.instance.name = "hwiPaTrafficManager";
hwi0Params.priority = 6;
hwi0Params.eventId = 8;
Program.global.hwiPaTrafficManager = Hwi.create(6, "&paTrafficManager", hwi0Params);
var runProcessCParams = new Swi.Params();
runProcessBParams.instance.name = "swiRunProcessC";
runProcessBParams.priority = 5;
runProcessBParams.arg0 = "&runProcessCIn";
runProcessBParams.arg1 = "&runProcessCOut";
Program.global.swiRunProcessC = Swi.create("&runProcessC", runProcessCParams);

var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');
var heapMemParams = new HeapMem.Params();
heapMemParams.size = 0xa20000;
heapMemParams.sectionName = "systemHeap";
Program.global.heap0 = HeapMem.create(heapMemParams);

/* This is the default memory heap. note that this section is commented out +++++++++
Memory.defaultHeapInstance = Program.global.heap0;
Program.sectMap["vectors"] = "MSMCSRAM";
Program.sectMap["sharedL2"] = "MSMCSRAM";
Program.sectMap[".sysmem"] = "MSMCSRAM";
Program.sectMap[".args"] = "MSMCSRAM";
Program.sectMap[".cio"] = "MSMCSRAM";
Program.sectMap[".far"] = "MSMCSRAM";
Program.sectMap[".rodata"] = "MSMCSRAM";
Program.sectMap[".neardata"] = "MSMCSRAM";
Program.sectMap[".cppi"] = "MSMCSRAM";
Program.sectMap[".init_array"] = "MSMCSRAM";
Program.sectMap[".qmss"] = "MSMCSRAM";
Program.sectMap[".cinit"] = "MSMCSRAM";//code should be in ddr3
Program.sectMap[".bss"] = "MSMCSRAM";
Program.sectMap[".const"] = "MSMCSRAM";
Program.sectMap[".text"] = "MSMCSRAM";//thats code, should be in ddr3
Program.sectMap[".code"] = "MSMCSRAM";//thats still code
Program.sectMap[".switch"] = "MSMCSRAM";
Program.sectMap[".data"] = "MSMCSRAM";
Program.sectMap[".fardata"] = "MSMCSRAM";
Program.sectMap[".args"] = "MSMCSRAM";
Program.sectMap[".cio"] = "MSMCSRAM";
Program.sectMap[".vecs"] = "MSMCSRAM";
Program.sectMap["platform_lib"] = "MSMCSRAM";
Program.sectMap[".far:taskStackSection"] = "L2SRAM";
Program.sectMap[".stack"] = "L2SRAM";
Program.sectMap[".nimu_eth_ll2"] = "L2SRAM";
Program.sectMap[".resmgr_memregion"] = {loadSegment: "MSMCSRAM", loadAlign:128}; /* QMSS descriptors region */
/*Program.sectMap[".resmgr_handles"] = {loadSegment: "MSMCSRAM", loadAlign:16}; /* CPPI/QMSS/PA Handles */
/*Program.sectMap[".resmgr_pa"] = {loadSegment: "MSMCSRAM", loadAlign:8}; /* PA Memory */
/*Program.sectMap[".far:IMAGEDATA"] = {loadSegment: "MSMCSRAM", loadAlign: 8};
Program.sectMap[".far:NDK_OBJMEM"] = {loadSegment: "MSMCSRAM", loadAlign: 8};
Program.sectMap[".far:NDK_PACKETMEM"] = {loadSegment: "MSMCSRAM", loadAlign: 128}; */
till here +++++++++++++++++++++++++++++++++++++++++++++
Program.sectMap["systemHeap"] = "DDR3";
Program.sectMap["UserCallRecordQ"] = "DDR3";
Program.sectMap["UserPktQ"] = "DDR3";
/*
Program.sectMap["pipelinePktQ"] = "DDR3";
Program.sectMap["CallDb"] = "DDR3";
Program.sectMap["callIndexDb"] = "L2SRAM";
Program.sectMap["logBuffer"] = "DDR3";

Program.sectMap[".ambeconst"] = "MSMCSRAM";
Program.sectMap[".ambetext"] = "MSMCSRAM";
/* Required if using System_printf to output on the console */
SysStd = xdc.useModule('xdc.runtime.SysStd');
System.SupportProxy = SysStd;


Viewing all articles
Browse latest Browse all 262198

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>