How to release heap size on IMXRT1062 platform?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to release heap size on IMXRT1062 platform?

Jump to solution
702 Views
Edward-Liao33
Contributor I

Hi Sir:

Below is my platform information

Chipset: i.MX RT1060X Processor

OS: FreeRTOS , version V10.3.0

Memory management by file heap_3.c ( pvPortMalloc and vPortFree)

When I call function "vPortFree" at the end of my execution, I do not see the MCU heap being properly released. I think the function is releasing the heap of the RTOS rather than the on the MCU, right?

If yes, how can I release the heap on the MCU? 

EdwardLiao33_0-1686652297784.png

Best Regards

Edward

0 Kudos
Reply
1 Solution
668 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi @Edward-Liao33 ,

Yes, heap3.c use system malloc/free function. It seems IDE can't detect new heap usage data after free().

You can test by below code

 

    pt=pvPortMalloc(0x200);
    *pt=1;
    vPortFree(pt);

 

The heap usage will increase when malloc, but will not decrease after free().

 

Regards,

Jing

View solution in original post

0 Kudos
Reply
2 Replies
669 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi @Edward-Liao33 ,

Yes, heap3.c use system malloc/free function. It seems IDE can't detect new heap usage data after free().

You can test by below code

 

    pt=pvPortMalloc(0x200);
    *pt=1;
    vPortFree(pt);

 

The heap usage will increase when malloc, but will not decrease after free().

 

Regards,

Jing

0 Kudos
Reply
661 Views
Edward-Liao33
Contributor I
I understand, thank you Jing.
0 Kudos
Reply