Post Go back to editing

CCES [Error li1040] Out of memory error using the ADSP 21469

Category: Software
Product Number: ADSP-21469
Software Version: CCES 2.11.0

I'm converting a ADSP-21469 program from VisualDSP++ to CCES.  

When I build the project, I get mutliple out of memory errors.   I know the original program fit into memory because it's been in production for 6 years and it does not use external memory.  This is what the error looks like:

[Error li1040] "C:\Users\JS\Documents\Firmware\DSP\NV_M5\system\startup_ldf\app.ldf":264 Out of memory in output section 'dxe_block2_pm_data' in processor 'p0'
Total of 0xa3d4 word(s) were not mapped.
For more details, see 'linker_log.xml' in the output directory.

Looking at the xml file, the errors are from to files, one called loopback.c and the other SPORTIsr.c.

<TEXT><![CDATA[Out of memory in output section 'dxe_block1_overflow_data' in processor 'p0'
        Total of 0xa3d4 word(s) were not mapped.]]></TEXT>
<EXTENDED_INFO><![CDATA[0xa3d4 words required for loopback.doj(seg_pmda):0x0

Not sure if it's related, but I had problems compiling these files.

There were 16 of the buffers shown below.   

#pragma align 4
#pragma section("seg_sdram", NO_INIT)
unsigned int CircInBuff_1[CIRC_BUF_LENGTH];

#pragma align 4
#pragma section("seg_sdram", NO_INIT)
unsigned int CircInBuff_2[CIRC_BUF_LENGTH];

through CircInBuff_16.

Following other support pages, I removed the #pragma section ("seq_sdram", NO_INIT).   The error related to these went away, but now I have out of memory errors.

Any thoughts on what is causing the out of memory error?

  • Hi,

    As you are hitting the li1040 'out of memory error', we would first recommend ensuring two Linker Optimization options are enabled.

    The first is to enable Linker Elimination via Project->Properties->C/C++ Build->Settings->CrossCore Sharc Linker->Elimination->Eliminate Unused Objects.When elimination is enabled, the Linker discards any objects (*.doj) within the library that do not contain any relevant code or data (i.e. the application makes no reference to any of the data or code symbols within that object). The linker can then examine the objects that are required for the link, and extract only those symbols required to resolve references from the application code, further stripping out unused data.

    Another option is enabling 'Individually map functions and data items' via 'General' tab of the CrossCore Sharc Linker options.When enabled, directs the linker to fill in fragmented memory with individual data objects that fit. When this option is selected, the default behavior of the linker (to place data blocks in consecutive memory addresses) is overridden.

    By enabling the 'Generate symbol Map' option under the 'General' options for the Linker. If you enabled the option to "Generate Symbol Map", the Linker will also generated a file which can be viewed in Internet Explorer to view a map of your project. It shows the memory sections declared in the LDF, their start and end bounds and - most importantly - their free/used space. Using this map file you can determine whether there is perhaps a memory section that is being under-used that you could place more data into.

    Please refer the below CCES help path for more information about li1040 linker error:
    CrossCore® Embedded Studio <version> > SHARC® Development Tools Documentation > Linker and Utilities Manual > Linker and Archiver Messages > Linker Messages > Errors > li1040

    Also we suspect, another cause of the li1040 Out of memory error, you have eventually exhaust all the available memory.

    If so, you would need to look at making use of SDRAM - if your target has external memory.Select Use external memory (SDRAM) to enable the size and partitioning controls under system.svc > Startupcode/LDF > LDF > External Memory

    Could please try mapping some of your data to external memory and let us know how you gets on.

    Controlling the placement of the function or data is then a case of adding appropriate output section in LDF.

    You can use #pragma section("section_name") directive to force your data into specific memory. Use this before each function that you want to place in the section.This pragma will only affect the next symbol and if you use this pragma right before a function, that function alone will be placed in the section.

    Also, from your details we understood that you are already trying to place some buffer in seg_sdram(external memory)using #pragma section.Therefore, please confirm whether you have enabled external memory in your project and have appropriate section name (seg_sdram) present in your ldf.

    If not, as you observe you might receive compiling error while using #pragma section("section_name").

    Below is an example for using #pragma section("section_name") directive:

    #pragma section("mydata") //custom_section_name
    int vector[22050];

    Also, add the appropriate INPUT_SECTIONS commands to your LDF in a suitable place in app.ldf, like below.Also, please refer attached screenshots which might be helpful to you.

    custom_section_name //Output section
    INPUT_SECTIONS( $OBJS_LIBS(custom_section_name) ) // Input section
    } > mem_section_name // Memory section

    For eg:

    } > mem_sdram_dmda

    For more information, take a look at the "#pragma section/#pragma default_section" in the CCES help:
    CrossCore® Embedded Studio <version> > Sharc® Development Tools Documentation > C/C++ Compiler and Library Manual for Sharc® Processors > Compiler > C/C++ Compiler Language Extensions > Pragmas > Linking Control Pragmas > #pragma section/#pragma default_section

    If the above information does not helps, if possible can you please share us your example project along with the screenshot of the error that you are facing and also the steps to reproduce to replicate your issue. This will help us to assist you better.