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.

Problem with create a large size heapMem

Other Parts Discussed in Thread: SYSBIOS

Hi,

I want to create a large heap (using SYS/BOIS, vision Mid), and I do the following 2 steps

(1) Change the .cfg setting

var Memory = xdc.useModule('xdc.runtime.Memory');
var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');
var heapMemParams = new HeapMem.Params();
heapMemParams.size = 0x2000000;
heapMemParams.sectionName = "systemHeap";
Program.global.heap0 = HeapMem.create(heapMemParams);
Memory.defaultHeapInstance = Program.global.heap0;

(2) allocate memory in c code

Ptr bufs[1];

IHeap_Handle heap = HeapMem_Handle_upCast(heap0);
bufs[0] = Memory_alloc(heap, SURR_VIEW_SIZE, 0, NULL);
Memory_free(heap, bufs[0], SURR_VIEW_SIZE);

When I run this program in debug mode, the error message is "0x86C01C3B out of memory"

What should I do ?

Besides, I have another question.

When I read SYS/BIOS user guide, section 6.8, it says HeapBuf is faster than HeapMem.

So if I just need a 0x2000000 memory, the better way is to use HeapBuf?

I follow the example in the user's guide, but never success.

Can you provide an example for this case?

Thank you very much!

Regards,

Killo

  • Hi Killo,

    What device and codegen are you on? The issue you are seeing might be related to this thread: http://e2e.ti.com/support/development_tools/compiler/f/343/p/253348/886334.aspx#886334.

    Todd

  • Hi Todd, 

    Thank you for reply.

    My device is vision Mid (EVM8168), and use CCS5 , SYS/BIOS, XDC 3.24. 3.33

    But my question seems different from the problem in the link. The memory I use is 32MB, not so big like 256 MB.

    Let me rephrase the problem 

    ============================

     I want to create a 32MB heap, so I add the code in .cfg

         <BIOS_AVSDK_dsp.cfg>

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

         var heapMemParams = new HeapMem.Params();

          heapMemParams.size = 0x2000000; // 32MB

         Program.global.heap0 = HeapMem.create(heapMemParams); 

    Then compile, and error appears : 

    "./configPkg/linker.cmd", line 201: error #10099-D: program will not fit into available memory. run placement with alignment fails for section ".far"
    size 0x233959f . Available memory ranges:
    CODE_CORE_DSP size: 0x1000000 unused: 0xcc6aac max hole: 0xcc6a68

    I guess the error caused by the memory is too small(only 0x1000000 and I want 0x2000000 ) ?

    Then I try to modify the memory size in <mem_segment_definition.xs>

    <mem_segment_definition.xs>

    memory[23] = ["CODE_CORE_DSP",
    {
        name: "CODE_CORE_DSP",
        base: 0x85C00000,
        len: 0x01000000,  // change to    len: 0x02000000,
        space: "code"
    }];

    but it doesn't work....

    Thank you again!

    Regards

  • Sorry, this thread was bounced around internally and fell through the cracks. Did your issue get resolved?