Hi all
I'm using the HeapMem implementation of the Heap in the following system configuration:
- CCS 6.0.0.00190
- SYS/BIOS 6.40.3.39
- XDCtools 3.30.4.52
- CPU: Sitara ARM AM3359
I need to open and close files dinamically and I don't know the file dimensions.
So, I call Memory_alloc(heapMem0, size, 0, &eb) and Memory_free(heapMem0, (Ptr*)mblock, size) to manage the Heap when necessary. I know that the value of "size" is correct for each function call; heapMem0 is an instance name declared in the .cfg file as follows:
- var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');
- var heapMem0Params = new HeapMem.Params();
- heapMem0Params.instance.name = "heapMem0";
- heapMem0Params.size = 16777216;
- heapMem0Params.sectionName = ".myHeapSect";
- Program.global.heapMem0 = HeapMem.create(heapMem0Params);
Randomly the task involved in the allocations hangs, looping forever inside the HeapMem_alloc() function code. The ROV seems to be blocked too and it waits for data forever. After some minutes the entire CCS does not answer and the only way is to turn off the device.
It seems that something in the heap queue is corrupted, beacuse the value of the currHeader is the same of the currHeader->next, so it loops forever looking for a NULL that will never found.
The situation when I pause the execution is:
I don't know if I'm making some mistakes using the HeapMem_alloc() or if there is some other kind of problem.
Do you kindly have any suggestions?
Thank you very much
Best Regards
Maurizio