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.

RTOS/CC1310: CC1310F32 Program cannot fit into available memory

Expert 1595 points
Part Number: CC1310

Tool/software: TI-RTOS

Hi,

I was developing my program on the CC1310 launchpad without any problems. Now I am migrating my codes to my custom board based on the CC1310F32.

In the project properties, I have changed the device to CC1310F32 and in the CC1310_LAUNCHXL_TIROS.cmd file, I change the flash and ram definition to:

 *  ======== CC1310_LAUNCHXL.cmd ========
 */

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

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

/* Override default entry point.                                             */
--entry_point ResetISR
/* Allow main() to take args                                                 */
--args 0x8
/* Suppress warnings and errors:                                             */
/* - 10063: Warning about entry point not being _c_int00                     */
/* - 16011, 16012: 8-byte alignment errors. Observed when linking in object  */
/*   files compiled using Keil (ARM compiler)                                */
--diag_suppress=10063,16011,16012

/* The starting address of the application.  Normally the interrupt vectors  */
/* must be located at the beginning of the application.                      */
//#define FLASH_BASE              0x0
//#define FLASH_SIZE              0x20000
//#define RAM_BASE                0x20000000
//#define RAM_SIZE                0x5000

#define FLASH_BASE              0x0
#define FLASH_SIZE              0x8000
#define RAM_BASE                0x20000000
#define RAM_SIZE                0x4000

Now I am getting the error:

warning #10325-D: creating memory range $BOUND$0x1b000 to accommodate BOUND section ".TI.bound:flashBuf"
"../CC1310_LAUNCHXL_TIRTOS.cmd", line 77: error #10099-D: program will not fit into available memory. placement with alignment fails for section ".text" size 0x854b . Available memory ranges:
FLASH size: 0x8000 unused: 0x6c50 max hole: 0x6ab8
error #10010: errors encountered during linking; "rfWakeOnRadioRx_CC1310_LAUNCHXL_tirtos_ccs.out" not built

Is this settings correct? How do I know how much memory my current program is using? I am using NVS in my program and I need about 100 bytes to store some information. Is there any possibility of freeing up more memory, or I will have to use another CC1310 with more memory eg CC1310F64 or CC1310F128?

  • Hi, check the map file. it  contains info on your  memory usage, like this one from the pinStandby example:

    MEMORY CONFIGURATION
    
             name            origin    length      used     unused   attr    fill
    ----------------------  --------  ---------  --------  --------  ----  --------
      FLASH                 00000000   00020000  000039c2  0001c63e  R  X
      SRAM                  20000000   00005000  00001da7  00003259  RW X
    

    For easy of use our examples are built without any code optimization. You could try to enable such to reduce the code foot print.

  • Hi FredG,

    My memory map looks like this without any code optimization:


    MEMORY CONFIGURATION

    name origin length used unused attr fill
    ---------------------- -------- --------- -------- -------- ---- --------
    FLASH 00000000 00008000 00001614 000069ec R X
    $BOUND$0x1b000 0001b000 00004000 00004000 00000000 R IX
    SRAM 20000000 00004000 000031be 00000e42 RW X

    But I don't understand it. Can you help to explain what it means? Thanks!
  • Hi Kian, it is number of bytes in hexadecimal.

    The pinStandby example stated SRAM used 0x1da7, and unused 0x3259. The total then is 0x5000 which is 20480 in decimal. This correlates to the CC1310 SRAM size of 20kB.

  • Hi,

    I tried to build the program for CC1310F128 and in the memory map it shows:

    MEMORY CONFIGURATION

    name origin length used unused attr fill
    ---------------------- -------- --------- -------- -------- ---- --------
    FLASH 00000000 00020000 0000dddc 00012224 R X
    SRAM 20000000 00005000 000031be 00001e42 RW X


    So I know that my program is using 55K of FLASH.

    This works fine on the launchpad, and I know that I can't use a CC1310F32 on my custom PCB.

    Now I try to build the program for the CC1310F64 on the launchpad. I modified the CC1310_LAUNCHXL_TIRTOS.cmd file with the following settings:

    #define FLASH_BASE 0x0
    #define FLASH_SIZE 0x10000
    #define RAM_BASE 0x20000000
    #define RAM_SIZE 0x4000

    Building the program on the launchpad give me a warning and show this on the memory map. I change the device to CC1310F64 in project properties and in the targetConfigs folder in CSS, the CC1310F64.ccxml is active.

    Warning I got:
    warning #10325-D: creating memory range $BOUND$0x1b000 to accommodate BOUND section ".TI.bound:flashBuf"

    Memory map:

    MEMORY CONFIGURATION

    name origin length used unused attr fill
    ---------------------- -------- --------- -------- -------- ---- --------
    FLASH 00000000 00010000 00009ddc 00006224 R X
    $BOUND$0x1b000 0001b000 00004000 00004000 00000000 R IX
    SRAM 20000000 00004000 000031be 00000e42 RW X


    What does this warning mean? And why is there an additional BOUND entry?

    I am using NVS in my program. The same program works on the launchpad with the CC1310F128 and all the NVS functions work well. I can erase and read. However, when I build the program for CC1310F64 on my launchpad and load the program onto my custom PCB, NVS doesn't work anymore when I debug and step through the program. I can step through the following codes:

    NVS_init();
    NVS_Params_init(&nvsParams);
    nvsHandle = NVS_open(Board_NVS0, &nvsParams);

    NVS_getAttrs(nvsHandle, &regionAttrs);

    /* Erase the entire flash region */
    NVS_erase(nvsHandle, 0, regionAttrs.regionSize);
    System_printf("Erase Done");

    But it hangs when I try to do a NVS_read:

    NVS_read(nvsHandle, 8*whitelist_count, (void *) buf, sizeof(check)); //Program hangs here.

    Can anyone help resolve this issue? Thanks a million!
  • Do you actually have a F64 device on the LP? The CCFG section is always on the last flash page so you can't run code compiled for F64 on a F128 device
  • Hi TER,

    My apologies for the confusion. Here are the different things I have tried:

    1. NVS works when the code is complied for CC1310F128 and loaded onto the Launchpad with a CC1310F128

    2. NVS works when the code is compiled for CC1310F64 and loaded onto the Launchpad with a CC1310F128. I can erase and read. But I have the warning message:

    #10325-D creating memory range $BOUND$0x1b000 to accommodate BOUND section ".TI.bound:flashBuf" rfWakeOnRadioRx_CC1310_LAUNCHXL_tirtos_ccs C/C++ Problem

    3. NVS does not work when the code is compiled for CC1310F64 and loaded onto a custom PCB with a CC1310F64. I can erase NVS, but the program hangs when I go a NVS_Read. I have the same warning message.

  • Anyone can help?