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.

LP-AM243: Read dynamic memory allocation during the runtime

Part Number: LP-AM243


Tool/software:

Hi there;

I am trying to check heap memory usage or dynamic memory allocation during the runtime. In the first step I tried to monitor it on ROV tool. But I realized that the size of used heap is not changing in the runtime. It always same. 



Should I trust the value I've seen on the picture (131072). Is it normal that it doesn't change at all? 


Alternatively how could I get runtime heap size on the code side. I found your API documentation for the heap management.
https://software-dl.ti.com/mcu-plus-sdk/esd/AM243X/08_00_00_21/exports/docs/api_guide_am243x/group__KERNEL__DPL__HEAP.html#ga33a544214b66c9fb0201f08a3be189b1
Can I use HeapP_getHeapStats method for my target? If yes, I need to pass Heap_Object as first parameter. For this I need to know start address and size details of my heap memory. How could I find those values?

Also I think the LP-AM243x eval board only has 2Mb SRAM and no additional DDR. Can you confirm this?

Sincerely
Kadir

  • Hi Kadir,

    I am looking into to this, please expect a reply in 1-2 days.

    Best Regards,
    Meet.

  • I am trying to access FreeRTOS-Kernel methods which is in  portable.h



    But I am getting unresolved symbol error.!!!

  • Hi Kadir,

    The ROV tool is just showing you the total heap size defined in the FreeRTOSConfig.h, using macro configTOTAL_HEAP_SIZE. It is not actually indicating the current heap utilization.

    The HEAP APIs are provided to give the users ability to create multiple user defined heaps, you would need HeapP_Object handle for HeapP_getHeapStats, which is provided as output when you call HeapP_construct() to create a user defined heap. I doubt you would be able to use these APIs for FreeRTOS heap.

    I am checking further to see why you might be getting unresolved symbol error while using the freertos functions, I will get back to you once I have an update.

    Best regards,

    Meet.

  • LP-AM243x eval board doesn't have additional DDR, SRAM is available in the SoC, so it's present.

  • Hi Meet;

    The reason of unresolved symbol is that the active heap that I am using is heap3. heap3 does not contain implementation of these methods. If I use heap 4 or 5 implementations are there.

    Another topic that is very important for me;
    I want to see how much of the 2MB SRAM is occupied.. Maybe a percentage in the code maybe help of a tool provided by TI??

    Regards
    Kadir

  • Hello Kadir, 

    There is memory allocation tool that is available in the CCS window and try this.

    I hope this tool can be helpful for your requirement.

    Regards,

    Anil.

  • Hi Anil,

    this looks very good. Thank you so much. But in ccs 12 I do not see graph like you have in your picture. I can see percentage of usage when I am hovering mouse on it. Is there any way to see it on graph likely yours.
    Or should I upgrade CCS version?

    Regards
    Kadir


  • Hi Kadir,

    I am not sure which graph you are referring to, in the image shared by Anil also you can see the percentage usage only, this is CCS version 12.8.1, it is recommended to use the CCS version mentioned in the MCU+SDK documentation.

    Best Regards,

    Meet.