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.

Compiler/AM3352: NOINIT heap memory linker error

Part Number: AM3352

Tool/software: TI C/C++ Compiler

Dear TI support team,

I do have an TI RTOS application in which I want to use a large amount of heap memory (about 100M).
If I merely change the BIOS.heapSize property in the .cfg file, the application takes a long time to start.
It looks like the C init function tries to zero initialize it.

In the E2E forums I found some hints to define a "NOINIT" section and set the heap module to use this section by performing the following steps:
(example is a BeagleBone Black application)

BIOS.heapSize = 100*1024*1024;
BIOS.heapSection = ".myheap";

Program.sectMap[".myheap"] = new Program.SectionSpec();
Program.sectMap[".myheap"].loadSegment = "DDR2";
Program.sectMap[".myheap"].type = "NOINIT";

When I add this to my .cfg file and try to compile it, the linker throws an error regarding the (generated) linker script:
configPkg/linker.cmd:84: non constant or forward reference address expression for section .myheap

This error does not occur if I remove the "NOINIT" part.

Used toolchain:
* CCS 9.0.0.00018
* PDK 1.0.15
* SYS/BIOS 6.75.2.00
* XDCtools 3.50.8.24
* Compiler: GNU v7.2.1 Linearo

Kind regards,
Markus

  • Can you please post the generated linker command file here for reference. We have tested this with older version of the compiler and BIOS and have never run into this issue. It may also be good to post the question in our compiler forum to see if they have any inputs on why the issue occurs with the toolchain that you are using.

    Regards,

    Rahul

  • Hello Rahul,

    I have attached a file to this thread containing 2 generated linker scripts.

    "linker_noinit_omitted.cmd" contains the generated linker script when I do not define the section ".myheap" as "NOINIT".
    This configuration compiles without error.

    "linker_noinit.cm" contains the generated linker script when I do define the section ".myheap" as "NOINIT".
    This configuration causes the error which I've mentioned in my first post.

    The affected line is #84.

    Kind regards,
    Markus

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/791/Generated_5F00_Linker_5F00_Scripts.7z

  • Hallo Rahul,

    I haven't found a "compiler" forum - do you mean the "Tools - Code Composer Studio" forum?

    Is this thread still under observation or should I post this question in the CCS forum?
    Could you reproduce the problem as well?

    Thanks,
    Markus

  • Hello,

    I have found the solution by myself resp. a colleague.
    The mistake was to use "NOINIT".

    "NOINIT" seems to be used by the TI compiler but - as I have stated in my first post - I use the GNU Linearo compiler.
    In this case you have to use "NOLOAD" instead of "NOINIT".

    That's all of the "magic".
    I am a little surprised that no one of the TI staff was able to tell me that ;)

    Regards,
    Markus