Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 262198

RM48L930: how to combine os_heap with sysmem, or eliminate one of these heaps?

$
0
0

Part Number:RM48L930

Support Path: /Product/Help with Device Selection/

Hello,

I am running a CCSv7 project built with HALCoGen and FreeRTOS.  In the project properties, under ARM Linker - Basic Options, the Heap Size for C/C++ dynamic memory allocation is set.  This memory is located in .sysmem and following a build the location of .sysmem  is visible in the created .map file.  The malloc() function in the runtime support library (rtsv7R4) (file = memory.c) uses this heap area.  And the C++ operator 'new' works as expected in my code.

Notice also that in FreeRTOSConfig.h the configTOTAL_HEAP_SIZE setting.  The HALCoGen code in os_heap.c uses this to create its own heap (ucHEAP[]) that is used by pvPortMalloc().  And pvPortMalloc() also works as expected.  Note that FreeRTOS uses pvPortMalloc() when creating tasks and OS objects.

So in my current setup I have 2 different heaps, which appears very wasteful of limited RAM if each is lightly used.  Why does HALCoGen have a heap separate from the runtime library?  Can I merge these 2 heaps so to minimize my memory footprint?  Do you recommend that application code never call pvPortMalloc() and instead use the malloc() from the RTS lib (memory.c)?

Thank you,

Keith


Viewing all articles
Browse latest Browse all 262198

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>