Hello,
I tried to configure my heap size using a *.cfg file using the following adapted commands below taken from a projekt template example.
I am using bios 6.31.4.27:
/*
** Create a Heap
*/
var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');
var heapMemParams = new HeapMem.Params();
// heapMemParams.size = 0xF4240;
heapMemParams.size = 0x300000;
heapMemParams.sectionName = "systemHeap";
Program.global.heap0 = HeapMem.create(heapMemParams);
Memory.defaultHeapInstance = Program.global.heap0;
Program.heap = 0x300000;
Program.stack = 0x2000;
/********************************************************************************************************************
* Define our Memory Map. We made up the memory names LL2RAM, DDR2 and SL2RAM. They do have special meaning. *
* *
* DDR2 - Anyhting destined for DDR2 always goes into the external RAM on the paltform. *
* LL2RAM - This is data that should be placed into the Local L2 of the core. *
* SL2RAM - This is data that should go into the shared L2 (if it exists) or could be placed into LL2 if it doesnt.*
* *
* These section names are mapped to specific addresses for a paltform using our custom memroy maps which are *
* defined using the Platform Wizard. Examples are custom.hpdpsua.evm6472, etc.,. *
********************************************************************************************************************/
Program.sectMap[".vecs"] = {loadSegment: "LL2RAM", loadAlign:8}; /* CSL per core data structures */
Program.sectMap[".switch"] = {loadSegment: "LL2RAM", loadAlign:8}; /* CSL per core data structures */
// Program.sectMap[".far:EMAC_DRV"]= {loadSegment: "LL2RAM", loadAlign:8}; /* Ethernet core specific data structures*/
// Program.sectMap[".far:NDK_OBJMEM"]= {loadSegment: "LL2RAM", loadAlign: 8}; /* NDK structures */
Program.sectMap[".cio"] = {loadSegment: "LL2RAM", loadAlign:8}; /* per core data structures */
Program.sectMap[".args"] = {loadSegment: "LL2RAM", loadAlign:8}; /* per core data structures */
Program.sectMap["systemHeap"] = "DDR2"; /* XDC Heap .. eg mmxxxAlloc() */
Program.sectMap[".far"] = "DDR2";
Program.sectMap[".cinit"] = "DDR2";
Program.sectMap[".bss"] = "DDR2";
Program.sectMap[".const"] = "DDR2";
Program.sectMap[".text"] = "DDR2";
Program.sectMap[".code"] = "DDR2";
Program.sectMap[".data"] = "DDR2";
Program.sectMap[".sysmem"] = "DDR2"; /* malloc heap */
// Program.sectMap[".gBuffer"] = {loadSegment: "DDR2", loadAlign:8}; /* Upload buffer used by the Web Server*/
// Program.sectMap[".far:WEBDATA"] = {loadSegment: "DDR2", loadAlign: 8}; /* Web Pages and web server structures */
Program.sectMap[".taskStackSection"]= "SL2RAM";
//Program.sectMap[".stack"] = "SL2RAM";
Program.sectMap[".stack"] = "DDR2";
//Program.sectMap["emacComm"] = {loadSegment: "SL2RAM", loadAlign:128}; /* EMAC Buffer Pool */
// Program.sectMap[".far:NDK_PACKETMEM"]= {loadSegment: "SL2RAM", loadAlign: 128}; /* NDK Buffer Pool */
Using this configuration, I get the following output in the *_p64P_x.xdl file. Heap is set to zero and all heap settings seem to be ignored. How can this happen?
--args 0x200
-heap 0x0
-stack 0x2000
MEMORY
{
LL2RAM (RWX) : org = 0x800000, len = 0x98000
SL2RAM (RWX) : org = 0x200000, len = 0xc0000
DDR2 (RWX) : org = 0xe0000000, len = 0x10000000
}
My main goal is just to set the program stack to size x and the heap, that will be used by malloc, to size x.
Best regards, Carsten