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.

CCS/CC3220SF-LAUNCHXL: How to extend size of HEAPSIZE in linker cmd in CCSv7.3?

Part Number: CC3220SF-LAUNCHXL
Other Parts Discussed in Thread: CC3220SF

Tool/software: Code Composer Studio

Hi

I am not familiar with linker command in CCS ( I am useing v7.3.000019).

The default commands described in CC3220SF_LAUNCHXL_TIRTOS.cmd of my project is shown as below:

#define SRAM_BASE 0x20000000

#define FLASH_BASE 0x01000800

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

HEAPSIZE = 0x30000; /* Size of heap buffer used by HeapMem */

MEMORY
{
/* Bootloader uses FLASH_HDR during initialization */
FLASH_HDR (RX) : origin = 0x01000000, length = 0x7FF /* 2 KB */
FLASH (RX) : origin = 0x01000800, length = 0x0FF800 /* 1022KB */
SRAM (RWX) : origin = 0x20000000, length = 0x00040000 /* 256KB */
}

/* Section allocation in memory */

SECTIONS
{
.dbghdr : > FLASH_HDR
.text : > FLASH
.TI.ramfunc : {} load=FLASH, run=SRAM, table(BINIT)
.const : > FLASH
.cinit : > FLASH
.pinit : > FLASH
.init_array : > FLASH

.data : > SRAM
.bss : > SRAM
.sysmem : > SRAM

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

.stack : > SRAM(HIGH)
}

When I build the project with HEAPSIZE=300000, the linker gets no issues. The link task finished without error.

But when I have to extend HEAPSIZE=400000 in my project, but the linker has given me error log after building the project.

 

"../CC3220SF_LAUNCHXL_TIRTOS.cmd", line 74: error #10099-D: program will not fit into available memory. run placement with alignment fails for section ".priheap" size 0x40000 . Available memory ranges:
SRAM size: 0x40000 unused: 0x332cd max hole: 0x3300d
error #10010: errors encountered during linking; "siotp_sampleapp_issbase.out" not built

>> Compilation failure
makefile:192: recipe for target 'siotp_sampleapp_issbase.out' failed

I think the messages is trying to talk to me to change the memory range. 

1) How do I do in this situation?

2) Could someone can advise me where can I find reference for the linker command and example to set memory map? 

Any comment is appreciated so much! 

  • Hi,

    CC3220 have 256kB of RAM. You cannot set bigger heap than you have RAM.

    HEAPSIZE = 0x30000 (HEX) = ~192kB (very big heap, but according your code may to fit into your RAM)
    HEAPSIZE=300000 (DEC) = ~292kB (not way to fit 292kB heap into 256kB RAM)
    HEAPSIZE=400000 (DEC) = ~390kB (not way to fit 390kB heap into 256kB RAM)

    Memory sections can be shown by ( CCS -> menu View -> Memory Allocation), e.g.:

    Jan

  • The reply by Jan Dospel is correct.  

    RobertArm said:
    2) Could someone can advise me where can I find reference for the linker command and example to set memory map? 

    Start with the Linker Command File Primer.  Then, if you need additional detail, use the linker chapter in the ARM assembly tools manual.

    Thanks and regards,

    -George

  • Hi Jan,

    Thanks for answer!
    Here I have an additional question regarding for linker ( I think):

    The ccs project that can be compiled and linked without error. But when I click "debug" button, the bin is transferred to the LAUNCHPAD and then it shows below messages in console:

    ================================================
    Cortex_M4_0: Symbol Manager: the object file contains invalid call frame information at .debug_frame 0x33d8; the rest of call frame information will be skipped. Callstack may not be unwound properly.
    ================================================

    Regards,
  • Hi,

    Sorry, I don't know way how it can be resolved. Please wait to answer to TI.

    Your issue may to be related to this thread e2e.ti.com/.../649811

    Jan
  • Regarding ...

    RobertArm said:
    ================================================
    Cortex_M4_0: Symbol Manager: the object file contains invalid call frame information at .debug_frame 0x33d8; the rest of call frame information will be skipped. Callstack may not be unwound properly.
    ================================================

    I presume you are still able to debug the program.  There will be times (maybe most of the time?) when the call stack will be wrong.  But I don't see how that causes any big problems.

    All that said, I will ask other CCS experts to take a look.  Because of the holidays, I don't know when you will see a response.

    Thanks and regards,

    -George

  • With regard to the call stack problem, I suspect Hnz is correct to note ...

    Hnz said:
    Your issue may to be related to this thread e2e.ti.com/.../649811

    The problem discussed in that thread is fixed in these versions of the TI ARM compiler ...

    • 15.12.7.LTS or higher
    • 16.9.6.LTS or higher
    • Any 18.x

    Please upgrade your compiler to one of these versions.  There is a good chance that will fix the problem.

    Thanks and regards,

    -George