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: C5505 - ALLOCATING BIG INT16 ARRAY IN EMIF

Tool/software: TI C/C++ Compiler

Hi, according to C5505 specification it should be equipped with an EM.

In my linker file c5505.cmd i have configured the EMIF like this:

 

EMIF_CS0 (RW) : origin = 0050000h length = 07B0000h /* mSDR */
EMIF_CS2 (RW) : origin = 0800000h length = 0400000h /* ASYNC1 : NAND */
EMIF_CS3 (RW) : origin = 0C00000h length = 0200000h /* ASYNC2 : NAND */
EMIF_CS4 (RW) : origin = 0E00000h length = 0100000h /* ASYNC3 : NOR */
EMIF_CS5 (RW) : origin = 0F00000h length = 00E0000h /* ASYNC4 : SRAM */

...

...

channel_1      : > EMIF_CS0

My array is 

#pragma DATA_SECTION(array, "array");

Int16 array[7430] = {

...

...

...};

The compiler stops loadable code generation because the program doesn't fit into memory.

I don't understand where is the error and what can be a solution

Thanks in advance

Paolo

  • Please read the first part of the article Linker Command File Primer.  Focus on the terms input section, output section, and memory range.

    This line ...

    Paolo Martinetti said:
    #pragma DATA_SECTION(array, "array");

    ... causes an input section named array to be created.  I don't see where it gets combined into an output section.

    This line ...

    Paolo Martinetti said:
    channel_1      : > EMIF_CS0

    ... combines all the input sections named channel_1 into an output section of that same name, then allocates it to the EMIF_CS0 memory range.  The input section array will not be a part of this output section.

    This is probably not all of your errors.  But fixing these errors is likely to make the remaining errors more clear.

    Thanks and regards,

    -George

  • Ok,

    corrected channel_1 with array.

    My emote configuration is:

    EMIF_CS0 (RW) : origin = 0050000h length = 07B0000h 
    EMIF_CS2 (RW) : origin = 0800000h length = 0400000h 
    EMIF_CS3 (RW) : origin = 0C00000h length = 0200000h 
    EMIF_CS4 (RW) : origin = 0E00000h length = 0100000h 
    EMIF_CS5 (RW) : origin = 0F00000h length = 00E0000h 

     but the problem persists.

    Thanks

    Paolo

  • Please show exactly how the linker is invoked, and all the resulting diagnostics.  And attach the linker command file to your next post.  So the forum will accept it, add the file extension ".txt" to it.

    Thanks and regards,

    -George

  • Hi, 

    I have noticed that the linker shows errors on other arrays than 'array', but this happens only if i create the 'array section.

    MEMORY
    {
    MMR (RW) : origin = 0000000h length = 0000c0h /* MMRs */
    DARAM (RW) : origin = 00000c0h length = 00ff40h /* on-chip DARAM */
    SARAM (RW) : origin = 0030000h length = 01e000h /* on-chip SARAM */

    SAROM_0 (RX) : origin = 0fe0000h length = 008000h /* on-chip ROM 0 */
    SAROM_1 (RX) : origin = 0fe8000h length = 008000h /* on-chip ROM 1 */
    SAROM_2 (RX) : origin = 0ff0000h length = 008000h /* on-chip ROM 2 */
    SAROM_3 (RX) : origin = 0ff8000h length = 008000h /* on-chip ROM 3 */

    EMIF_CS0 (RW) : origin = 0050000h length = 07B0000h /* mSDR */
    EMIF_CS2 (RW) : origin = 0800000h length = 0400000h /* ASYNC1 : NAND */
    EMIF_CS3 (RW) : origin = 0C00000h length = 0200000h /* ASYNC2 : NAND */
    EMIF_CS4 (RW) : origin = 0E00000h length = 0100000h /* ASYNC3 : NOR */
    EMIF_CS5 (RW) : origin = 0F00000h length = 00E0000h /* ASYNC4 : SRAM */

    }


    SECTIONS
    {
    vectors (NOLOAD)
    .bss : > DARAM /*, fill = 0 */
    vector : > DARAM ALIGN = 256
    .stack : > DARAM
    .sysstack : > DARAM
    .sysmem : > DARAM
    .text : > SARAM
    .data : > DARAM
    .cinit : > DARAM
    .const : > DARAM
    .cio : > DARAM
    .usect : > DARAM
    .switch : > DARAM


    Buf : > DARAM
    rfftL : > DARAM
    ifftL : > DARAM
    cmplxBuf : > DARAM
    brBuf : > DARAM
    tmpBuf : > DARAM
    lpf_32 : > DARAM
    lpf_42 : > DARAM
    dbuffer : > DARAM
    array : > EMIF_CS0

    }
    _hwafft_br = 0x00ff6cd6;
    _hwafft_1024pts = 0x00ff7a56;

    In attachment the linker output

    Thanks

    Paolo

    **** Build of configuration Debug for project DC2017 ****
    
    "C:\\TI\\ccsv6\\utils\\bin\\gmake" -k all 
    'Building target: DC2017_DEBUG.out'
    'Invoking: C5500 Linker'
    "C:/TI/ccsv6/tools/compiler/c5500_4.4.1/bin/cl55" -vcpu:3.3 --memory_model=huge -O3 --symdebug:coff --define="_DEBUG" --define="C55X" --define=c5505 --diag_warning=225 --ptrdiff_size=32 --algebraic --no_mac_expand --asm_source=algebraic --optimizer_interlist --opt_for_speed=5 --opt_for_space=3 -z -m"DC2017_DEBUG.map" --stack_size=0x1000 --heap_size=0x800 -i"C:/TI/ccsv6/tools/compiler/c5500_4.4.1/lib" -i"C:/TI/ccsv6/tools/compiler/c5500_4.4.1/include" -i"C:/TI/bios_5_42_02_10/packages/ti/rtdx/lib/c5500" -i"C:/TI/bios_5_42_02_10/packages/ti/bios/lib" -i"C:/Users/marti/Desktop/BACKUP/DC2017/project" --reread_libs --diag_suppress=10063 --warn_sections --xml_link_info="DC2017_DEBUG_LinkInfo.xml" --entry_point=reset_isr --rom_model --sys_stacksize=0x1000 -o "DC2017_DEBUG.out" "../c5505.cmd" "./aic_test_i2c.obj" "./dma.obj" "./gpio.obj" "./i2s.obj" "./i2s_register.obj" "./main.obj" "./ref_data.obj" "./rtc.obj" "./sar.obj" "./signals.obj" "./vector.obj"  -l"C:/TI/ccsv6/tools/compiler/c5500_4.4.1/lib/55xdsph_r3.lib" -lrts55h.lib -llibc.a 
    <Linking>
    "../c5505.cmd", line 39: error: program will not fit into available memory.
       run placement with alignment/blocking fails for section "Buf" size 0x800
       page 0.  Available memory ranges:
       DARAM        size: 0xff40       unused: 0x72         max hole: 0x58      
    "../c5505.cmd", line 41: error: program will not fit into available memory.
       run placement with alignment/blocking fails for section "ifftL" size 0x800
       page 0.  Available memory ranges:
       DARAM        size: 0xff40       unused: 0x72         max hole: 0x58      
    "../c5505.cmd", line 40: error: program will not fit into available memory.
       run placement with alignment/blocking fails for section "rfftL" size 0x800
       page 0.  Available memory ranges:
       DARAM        size: 0xff40       unused: 0x72         max hole: 0x58      
    error: errors encountered during linking; "DC2017_DEBUG.out" not built
    
    >> Compilation failure
    makefile:154: recipe for target 'DC2017_DEBUG.out' failed
    gmake: *** [DC2017_DEBUG.out] Error 1
    gmake: Target 'all' not remade because of errors.
    
    **** Build Finished ****
    

  • You simply ran out of DARAM.  Your linker command file puts every section in DARAM, except .text and array.  You either need to put some sections in other memory ranges, or reduce the sizes of some of those sections.  Please see this wiki article for further detail and suggestions.

    Thanks and regards,

    -George

  • Great!

    I released some DARAM space and it works!

    Thanks a lot!

    Paolo