This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

PROCESSOR-SDK-AM437X: Get heap status information

Expert 1700 points
Part Number: PROCESSOR-SDK-AM437X
Other Parts Discussed in Thread: SYSBIOS

Hello,

I am working on a Sitara AM437x project. I am currently implementing a serial command, which allows me to query some important system information like e.g. the timings of the SYS/BIOS tasks, the stack occupation etc....

One of the missing information I would like to query, is the current consumed heap memory when e.g. creating OS tasks via TaskP_create();

Inside out project configuration file we defined the following amount of heap memory:

var BIOS = xdc.useModule('ti.sysbios.BIOS');
var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');

/*
 * The BIOS module will create the default heap for the system.
 * Specify the size of this default heap.
 */
BIOS.heapSize = 32000;

I have seen that there if obviously a way to get some heap statistics, I checked the following web-page:

http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/sysbios/6_76_04_02/exports/bios_6_76_04_02/docs/cdoc/index.html#ti/sysbios/heaps/HeapMem.html

 

void HeapMem_getStats (HeapMem_Handle handle, Memory_Stats *stats);

 

Can I use the above function in order to check how much of the current heap is being occupied? Or is there another ways to check how much heap is currently in use?

If I can use the above function, I may need to know how I get the default heap memory handle (first function argument), which is currently in use by the system. How can I access this handle inside our firmware?

Thanks,

Inno