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/CC1310: Place heap memory into GPRAM

Part Number: CC1310
Other Parts Discussed in Thread: SYSBIOS

Tool/software: Code Composer Studio

Hi,

due to memory limitation, we decided to use GPRAM as SRAM in CC1310. We have done it before for certain variables or array in our object files. Right now, I would like to place all heap memory into GPRAM. Unfortunately, I was not able to find the correct syntax. Could you please advise about corect syntax?

For example for a array in radio.c file we used such syntax and it works.
/* Section allocation in memory */

SECTIONS
{
    .text           :   > FLASH
    .const          :   > FLASH
    .constdata      :   > FLASH
    .rodata         :   > FLASH
    .cinit          :   > FLASH
    .pinit          :   > FLASH
    .init_array     :   > FLASH
    .emb_text       :   > FLASH
    .ccfg           :   > FLASH (HIGH)

    .data           :   > SRAM
    .gpram             :
    {
    radio.obj(*rfRxTaskStack)
    }  > GPRAM
    .bss            :   > SRAM
    .sysmem         :   > SRAM
    .stack          :   > SRAM (HIGH)
    .nonretenvar    :   > SRAM
}



For heap, the object is seen as .common:ti_sysbios_heaps_HeapMem_Instance_State_0_buf__A  in Memory_Allocation.

Best Regards
Cem



  • Hi,

    First of all, I have not used GPRAM in this manner and I've heard there might be some performance/power issues. For instance I found this thread:

    Having said that there are a couple ways to place TI-RTOS kernel items. If you have only a few (e.g. heap), it's probably easiest to just put it in the linker file. For your explicit example of the kernel's heap, you can do this.

    ...

       .data           :   > SRAM

       .bss:.common:ti_sysbios_heaps_HeapMem_Instance_State_0_buf__A : > GPRAM

       .bss            :   > SRAM

    ...

    Note: this is assuming you are not using the primary_heap logic like we have in some example. This allows you to change the size of the heap in the linker file instead of the .cfg file. In the primary heap use case, just place .priheap to GPRAM in the linker file.

    Additionally inside the .cfg, most modules have ways to place static items. For example, if you want to place a stack on a statically created task in a specific section, there is

    Task.defaultStackSection = ".myStack";  // then place .myStack to GPRAM in the linker file.

    Note: there are ways to place memory sections (e.g. .bss or .bss:taskStackSection) to memory regions (e.g. GPRAM), but we've found most people prefer to do it in the linker file. 

    Todd

  • Thanks, this solved my problem