Hi,
I want to create a large heap (using SYS/BOIS, vision Mid), and I do the following 2 steps
(1) Change the .cfg setting
var Memory = xdc.useModule('xdc.runtime.Memory');
var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');
var heapMemParams = new HeapMem.Params();
heapMemParams.size = 0x2000000;
heapMemParams.sectionName = "systemHeap";
Program.global.heap0 = HeapMem.create(heapMemParams);
Memory.defaultHeapInstance = Program.global.heap0;
(2) allocate memory in c code
Ptr bufs[1];
IHeap_Handle heap = HeapMem_Handle_upCast(heap0);
bufs[0] = Memory_alloc(heap, SURR_VIEW_SIZE, 0, NULL);
Memory_free(heap, bufs[0], SURR_VIEW_SIZE);
When I run this program in debug mode, the error message is "0x86C01C3B out of memory"
What should I do ?
Besides, I have another question.
When I read SYS/BIOS user guide, section 6.8, it says HeapBuf is faster than HeapMem.
So if I just need a 0x2000000 memory, the better way is to use HeapBuf?
I follow the example in the user's guide, but never success.
Can you provide an example for this case?
Thank you very much!
Regards,
Killo