• Resolved

CCS/CC3220S-LAUNCHXL: Is there a guidance about CCS link file(.cmd)? how to increase the size of ".cinit", ".data" section ?

Part Number: CC3220S-LAUNCHXL

Tool/software: Code Composer Studio

Hi team,

Is there a guidance about CCS link file(.cmd)? how to increase the size of ".cinit", ".data" section ? thanks.

  • The size of output sections like .cinit and .data depends on the number and size of the corresponding input sections.  For more general background, please see the article Linker Command File Primer.

    Thanks and regards,

    -George


    TI C/C++ Compiler Forum Moderator
    Please click This Resolved My Issue on the best reply to your question
    The CCS Youtube Channel
     has short how-to videos
    The 
    Compiler Wiki answers most common questions
    Track an issue with SDOWP. Enter your bug id in the Search box.

  • In reply to George Mock:

    Dear George,

    I read the document you mentioned at above, and understand some basic concept about Linker Command, but I still don't know how to fix below problem i met.

    enviroments:

    1. CC3220S.

    2. SDK: simplelink_cc32xx_sdk_2_10_00_04

    3. peripheral (SPI) flash 8Mbytes.

    when i add some HTTP & Jason codes in my project, i met below compile problem:

    <Linking>
    "../CC3220S_LAUNCHXL_TIRTOS.cmd", line 61: error #10099-D: program will not fit into available memory.  run placement with alignment fails for section ".bss" size 0x3dc6 .  Available memory ranges:
       SRAM         size: 0x3c000      unused: 0x2e98       max hole: 0x2e90    
    "../CC3220S_LAUNCHXL_TIRTOS.cmd", line 63: error #10099-D: program will not fit into available memory.  run placement with alignment fails for section ".data" size 0x3dbe .  Available memory ranges:
       SRAM         size: 0x3c000      unused: 0x2e98       max hole: 0x2e90    
    error #10010: errors encountered during linking; "cc3220s_app.out" not built

    and below is CC3220S_LAUNCHXL_TIRTOS.cmd file that i used at my project:

    /*
     *  ======== CC3220S_LAUNCHXL.cmd ========
     */

    /*
     * The starting address of the application.  Normally the interrupt vectors
     * must be located at the beginning of the application.
     */
    #define SRAM_BASE 0x20004000
    #define SRAM0_BASE 0x20000000

    --stack_size=1024   /* C stack is also used for ISR stack */

    /* Size of heap buffer used by HeapMem */
    /* HEAPSIZE = 0x8000; */
    HEAPSIZE = 0x4000;  /* 16K */

    MEMORY
    {
        SRAM0 (RWX) : origin = 0x20000000, length = 0x4000
        SRAM  (RWX) : origin = 0x20004000, length = 0x00040000 - 0x4000
    }

    /* Section allocation in memory */

    SECTIONS
    {
        .text       : > SRAM
        .bss        : > SRAM
        .TI.ramfunc : > SRAM
        .data       : > SRAM
        .const      : > SRAM

        .sysmem     : > SRAM
        .cinit      : > SRAM
        .pinit      : > SRAM
        .init_array : > SRAM

        /* Heap buffer used by HeapMem */
        .priheap    : {
            __primary_heap_start__ = .;
            . += HEAPSIZE;
            __primary_heap_end__ = .;
        } > SRAM align 8

        .stack      : > SRAM0(HIGH)
    }

    how to redefine the SECTIONS at CC3220S_LAUNCHXL_TIRTOS.cmd, anyone can provide a sample definitions?

    for example, map .text on peripheral (SPI) flash.

    thanks a lot.

    Linx

  • In reply to linx zhang:

    The most likely explanation for ...

    linx zhang
    "../CC3220S_LAUNCHXL_TIRTOS.cmd", line 61: error #10099-D: program will not fit into available memory.  run placement with alignment fails for section ".bss" size 0x3dc6 .  Available memory ranges:
       SRAM         size: 0x3c000      unused: 0x2e98       max hole: 0x2e90    
    "../CC3220S_LAUNCHXL_TIRTOS.cmd", line 63: error #10099-D: program will not fit into available memory.  run placement with alignment fails for section ".data" size 0x3dbe .  Available memory ranges:
       SRAM         size: 0x3c000      unused: 0x2e98       max hole: 0x2e90    
    error #10010: errors encountered during linking; "cc3220s_app.out" not built

    ... is that your program is bigger than the memory you have specified in the linker command file.

    linx zhang

    how to redefine the SECTIONS at CC3220S_LAUNCHXL_TIRTOS.cmd, anyone can provide a sample definitions?

    for example, map .text on peripheral (SPI) flash.

    I lack the expertise with your system to answer these questions.  That is why I am moving this thread to the Simplelink forum.

    Thanks and regards,

    -George


    TI C/C++ Compiler Forum Moderator
    Please click This Resolved My Issue on the best reply to your question
    The CCS Youtube Channel
     has short how-to videos
    The 
    Compiler Wiki answers most common questions
    Track an issue with SDOWP. Enter your bug id in the Search box.

  • Guru 21500 points

    In reply to George Mock:

    Hi,

    I agree with George. You haven't enough space inside your RAM.

    CC3220S have 256kB RAM and you need fit your code and RAM stuff into this memory. You cannot cannot map any of sections (.text, .bss, etc.) into external sFlash to offload RAM.

    I have this suggestions:
    - please check size of your code and RAM variables (big buffers, etc.)
    - alternately you can use advance techniques like dynamic loading of code ( see example dynamic_lib_loader for previous generation - CC3200 SDK).

    Jan

    Please click to "Verify Answer", if your question was answered.