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.

RTOS/66AK2H12: Entire heap space is getting loaded at program load time

Part Number: 66AK2H12


Tool/software: TI-RTOS

I am creating a separate heap space in the cfg file so I can allocate to different memory section.

/* Create heap as global variable so it can be used in C code */
var heapMemParams = new HeapMem.Params();
heapMemParams.size = 65536*8;
heapMemParams.sectionName = ".mbxHeap";
Program.global.daqMbxHeap = HeapMem.create(heapMemParams);
//Program.sectMap[".mbxHeap"] = "MSMCSRAM";
Program.sectMap[".mbxHeap"] = "DDR3B";

It doesn't matter whether I assign the section to DDR3 or MSMC, the linker causes the heap space to be loaded with the program. I tried assigning the section as suggested in another forum post:

Program.sectMap[".mbxHeap"].type = "NOLOAD";

but that didn't change the behavior at all.

We are using automatically-generated linker cmd files, so please don't suggest methods based on customizing linker.cmd.

Thanks,
Bruce

  • Hi,

    We're looking into this.

    Best Regards,
    Yordan
  • Bruce,

    There are a couple of different options that are discussed here to prevent the heap from loading during program load. Can you please try these options and let us know if this works for you:
    processors.wiki.ti.com/.../AM437x

    These usage notes also apply to all A15 platforms. Let us know if this didn`t work and we can provide further guidance.

    Regards,
    Rahul
  • The second method (mostly) resolved my issue. I was able to allocate the heap to MSMCSRAM, and the heap was no longer loaded on a program load.

    var heapMemParams = new HeapMem.Params();
    heapMemParams.size = 65536*8;
    heapMemParams.sectionName = ".mbxHeap";
    Program.global.mbxHeap= HeapMem.create(heapMemParams);
    Program.sectMap[".mbxHeap"] = new Program.SectionSpec();
    Program.sectMap[".mbxHeap"].runSegment = "MSMCSRAM";
    Program.sectMap[".mbxHeap"].type = "NOLOAD";

    I'm not sure what the Program.sectionsExclude keyword does, but it doesn't seem to impact this issue one way or another.

    Thanks for your help.
    Bruce