Quantcast
Channel: Processors forum - Recent Threads
Viewing all articles
Browse latest Browse all 17527

RTOS/AM5728: question about creating a heap using HeapBuf

$
0
0

Part Number:AM5728

Tool/software: TI-RTOS

Hi, Dear Ti exports:

I'm using GP evmAM572x to do some algorithms in my rtos project(A15_0). There are so many malloc(), free(), and calloc() in my algorithms so i created a heap using HeapBuf in my .cfg file as follows:

// Memory
var Memory = xdc.useModule('xdc.runtime.Memory');
// system heap manager.
var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');

/* Create a heap using HeapBuf */
var HeapBuf = xdc.useModule('ti.sysbios.heaps.HeapBuf');
var heapBufParams = new HeapBuf.Params;
heapBufParams.blockSize = 16;
heapBufParams.numBlocks = 0x01000000;//16M
heapBufParams.align = 8;
heapBufParams.sectionName = "myHeap";
Program.global.myHeap = HeapBuf.create(heapBufParams);
Program.sectMap["myHeap"] = "APP_DATA_HEAP";

Memory.defaultHeapInstance = Program.global.myHeap;

BIOS.heapSize        = 0x10000000;//16*16M=256MB
BIOS.heapSection 	= "myHeap";

but the generated .out file is too large(about 275MB), Is there any mistakes? my linker.cmd is posted bellow:

MEMORY
{
    SRAM (RWX) : org = 0x402f0000, len = 0x10000
    OCMC_RAM1 : org = 0x40300000, len = 0x80000
    OCMC_RAM2 : org = 0x40400000, len = 0x100000
    OCMC_RAM3 : org = 0x40500000, len = 0x100000
    APP_CODE (RWX) : org = 0x80100000, len = 0xf00000
    APP_DATA_IPC (RWX) : org = 0x81000000, len = 0xf600000
    VPS_FRAME_BUFFER (RWX) : org = 0x90600000, len = 0xf400000
    VPS_FIRMWARE (RWX) : org = 0xa0000000, len = 0x200000
    APP_DATA_STACK (RWX) : org = 0xa0200000, len = 0xe00000
    APP_DATA_HEAP (RWX) : org = 0xa1000000, len = 0x18000000
}

My go is to let malloc() and free() run fast in my algorithms, which will cost about 128MB in heap. My last version project used the HeapMem as the default and it runs so slowly.

So, my question is how to configure the heap to let malloc and free runs fast.


Viewing all articles
Browse latest Browse all 17527

Trending Articles



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