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.

How to use a larger heap (DDR2) with the NDK ???

Hi all,

I have started off with the NDK demo example which I have got up and running fine.

But I require a larger heap than the $30000 that is allocated in the LL2RAM from the example.

I have tried many solutions but so far none have succeeded.

I wish to at least use 50MB of the DDR2 memory as the default program heap but have not found a stable way of doing this.

My first thought was to modify the existing Bios6 config code to:

 

var heapMemParams = new HeapMem.Params();

heapMemParams.size = 0x3000000;

heapMemParams.sectionName = "systemHeap";

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

 

Memory.defaultHeapInstance = Program.global.heap0;

Memory.defaultHeapSize = 0x3000000;

 

Program.sectMap["systemHeap"] = "DDR2";

Program.sectMap[".sysmem"] = "DDR2";

Program.heap = 0x3000000;

But this stills fails ... I have read all the documentation I could find including experimenting with a custom RTSC platform but now I am running out of options.

 

Help :) ... What have I missed?

Cheers.

  •  

    Some more info ... I am using:

    EVMC6472

    CCS 4.1.2.00027

    Bios 6.21.2.19

    CSL 3.0.5.6

    NDK 2.1.0

    Cheers.

  • Hi Fred,

    There is better documentation regarding heaps in the BIOS 6.x User Guide in BIOS 6.30.01 to be released soon.. I will try to send you a link to the latest version.

    Your config code to modify the default heap size as follows is correct.

    var heapMemParams = new HeapMem.Params();

    heapMemParams.size = 0x3000000;

    heapMemParams.sectionName = "systemHeap";

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

    Memory.defaultHeapInstance = Program.global.heap0;

     

    You do not need the following line. Is it only used when you do not set Memory.defaultHeapInstance.

    Memory.defaultHeapSize = 0x3000000;

     

    Setting Program.heap is only required if you are using malloc() from the rts lib. NDK does not use malloc so this etting is NOT required for NDK.

     

     

    Program.heap = 0x3000000;

    With the config code you have now, what error message do you see?

    Regards,

    Nitya

     

     

     

  • I posted the latest SYS/BIOS 6.3x User Guide to the Wiki.  You can find it at the following link.  The relevant  part is Chapter 5.

    http://processors.wiki.ti.com/index.php/SYS/BIOS_User_Guide

  • Thank you for the 6.3 user guide and info.

     

    In regards to your question about the errors I see, I believe that I am having two problems:

    1/ Allocation of the Heap into DDR2 memory - moving .sysmem section to DDR2 creates problem 2 (which the info you have provided may help - I need to go through it).

    2/ Init of the EVMC6472 board using current SDK's - See this thread where we have found bugs with the SDK init code (the latest posts are more relevant)

    http://e2e.ti.com/support/dsp/c6000_multi-core_dsps/f/439/t/51491.aspx

     

    At this stage the project may go on hold until the SDKs and libraries have matured and are released (We have no time to debug this stuff).

    Do you have a rough ETA of when Bios 6.3 will be released ?

    Cheers.

     

  • Nitya Ramdas said:

    Setting Program.heap is only required if you are using malloc() from the rts lib. NDK does not use malloc so this etting is NOT required for NDK.

    Program.heap = 0x3000000;

     

    What about when using new and delete from C++ code ?

    I have guessed they follow the same lines as malloc/free ... but which memory section are they in ?

    IE: moving systemHeap to DDR2 is fine ... But is the program Heap (which malloc uses) still in L2 memory ?

    What section does malloc use, how do I set it and move it to DDR2 memory?

    Cheers.

  • C++ new and delete use the ".sysmem" heap (which malloc also uses) for dynamic memory allocation.You had the correct code in your cfg file to set the this heap's size and place it.

     

     

    Program.heap = 0x3000000;

    Program.sectMap[".sysmem"] = "DDR2";

     

    Also 6_30_01_33 was released on 06/28/2010.

  • hi,

    my customer contends your statement:  "Also 6_30_01_33 was released on 06/28/2010."

     

    he checked at:

     

     

    http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/bios/sysb

    ios/index.html

    but it hasn't been posted there yet. he searched exhaustively and cannot find the file.

    he lodged a question with TI Support but no answer

    So, the long and the short is they have hit a brick wall. It looks like all they need to get moving again is a copy of SYS/BIOS 6.30 (unless that only works with the imminent CCS 4.2?). Can you help us?

     

  • I just checked

    http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/bios/sysbios/index.html

    and I see the patch release 6.20.02.42 which is based on 6.30.01. The customer can use this patch release.

    Nitya

     

     

  • Note that BIOS 6.30 requires CCSv4.2 which has not been released yet.  We have kept the links hidden because of this dependency.  CCSv4.2 should be out soon.  Pre-releases are available, final release will be available to everyone soon.