Other Parts Discussed in Thread: SYSBIOS
Hello,
CCS 4.2.0.6
XDCTools 3.20.4.68
C2000 Code Generation Tools 5.2.8
Sys/Bios 6.30.3.46
I am using the Sys/Bios and have some trouble with the Memory Allocation. The following Code shows that there are two Blocks with a Blocksize of 128 available. In standard usage when I try to allocate less than two Blocks, everything is fine and Memory_alloc returns the pointer to the allocated Block. But when I try to allocate more than two Blocks I expect that Memory_alloc will reutrn a NULL pointer but Memory_alloc will never return. I guess that the Memory_alloc-Function will wait until a used Block is freed up so that it can allocate a new Block.
in CFG-file:
/* Create a heap using HeapBuf */
var HeapBuf = xdc.useModule('ti.sysbios.heaps.HeapBuf');
var heapBufParams = new HeapBuf.Params;
heapBufParams.blockSize = 128;
heapBufParams.numBlocks = 2;
heapBufParams.align = 8;
heapBufParams.sectionName = "heapZone7";
Program.global.heapZone7 = HeapBuf.create(heapBufParams);
Program.sectMap["heapZone7"] = "ZONE7";
in C-file
Ptr p;
for(i=0;i<4;i++){
p = Memory_alloc(heapZone7,128,0,NULL);
if (p==NULL)
return NULL;
}
Thanks a lot
Markus