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.

"Error #10099-D:Program will not fit into available memory" when adding UART initialisation

Other Parts Discussed in Thread: CC1310, SIMPLELINK-CC13X0-SDK

I'm using the CC1310 Launchpad and running the 15.4 stack collector example. I wanted a better way to stream data, so have tried to initialise the UART. 

What I found, however, is that when I put in place this code:

    /* Initialise UART */
    char test[] = "Success!";
    
    UART_init();

    UART_Params_init(&uartParams);
    uartParams.baudRate  = 115200;
    uartParams.writeDataMode = UART_DATA_BINARY;
    uartParams.readDataMode = UART_DATA_BINARY;
    uartParams.readReturnMode = UART_RETURN_FULL;
    uartParams.readEcho = UART_ECHO_OFF;
    uartHandle = UART_open(Board_UART0, &uartParams);
    if (!uartHandle) {
    	//LCD_WRITE_STRING("UART_open failed", 10);
    }else{

    	UART_write(uartHandle, test, sizeof(test));
    }

I get an error:

#10099-D: program will not fit into available memory.  placement with alignment fails for section ".const" size 0x865 .

Looking at my compilation log, it shows:

"../cc1310lp.cmd", line 100: error #10099-D: program will not fit into available memory.  placement with alignment fails for section ".const" size 0x865 .  Available memory ranges:
   FLASH        size: 0xe000       unused: 0x7e7        max hole: 0x5cb     
error #10010: errors encountered during linking; "collector_cc13xx_lp.out" not built

>> Compilation failure
makefile:167: recipe for target 'collector_cc13xx_lp.out' failed
gmake: *** [collector_cc13xx_lp.out] Error 1
gmake: Target 'all' not remade because of errors.

What could be causing this? Surely an example like this (made to expand on) can't already be close to the maximum memory?

  • Hello,

    The error is described in detail in the below link:

    http://processors.wiki.ti.com/index.php/Compiler/diagnostic_messages/10099

    The cmd file I am using for the 1310 seems to indicate space for the FLASH section. Can you attach the cmd file you are using?


    Thanks

    ki

  • Here is the command file. It's just the one that comes with the Simplelink 15.4 stack collector example:

     ******************************************************************************
     Release Name: ti-15.4-stack-sdk_2_00_00_25
     Release Date: 2016-07-14 14:37:14
     *****************************************************************************/
    
    /* Retain interrupt vector table variable                                    */
    --retain=g_pfnVectors
    /* 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 following command line options are set as part of the CCS project.    */
    /* If you are building using the command line, or for some reason want to    */
    /* define them here, you can uncomment and modify these lines as needed.     */
    /* If you are using CCS for building, it is probably better to make any such */
    /* modifications in your CCS project and leave this file alone.              */
    /*                                                                           */
    /* --heap_size=0                                                             */
    /* --stack_size=256                                                          */
    /* --library=rtsv7M3_T_le_eabi.lib                                           */
    
    /* The starting address of the application.  Normally the interrupt vectors  */
    /* must be located at the beginning of the application.                      */
    #define FLASH_BASE              0x00000000
    #define FLASH_SIZE              0x0E000
    #define FLASH_LAST_BASE         0x1F000
    #define FLASH_LAST_SIZE         0x1000
    #define RAM_BASE                0x20000000
    #define RAM_SIZE                0x3100
    
    
    /* System memory map */
    
    MEMORY
    {
        /* Application stored in and executes from internal flash */
        FLASH (RX) : origin = FLASH_BASE, length = FLASH_SIZE
        /* Last flash page */
        FLASH_LAST (RX) : origin = FLASH_LAST_BASE, length = FLASH_LAST_SIZE
        /* Application uses internal RAM for data */
        SRAM (RWX) : origin = RAM_BASE, length = RAM_SIZE
    }
    
    /* Section allocation in memory */
    
    SECTIONS
    {
        .intvecs        :   > FLASH_BASE
        .text           :   > FLASH
    
        config_const { mac_user_config.obj(.const) } > FLASH
    
        .const          :   > FLASH                      // THIS IS WHERE IT REPORTS AN ERROR
        .constdata      :   > FLASH
        .rodata         :   > FLASH
        .cinit          :   > FLASH
        .pinit          :   > FLASH
        .init_array     :   > FLASH
        .emb_text       :   > FLASH
        .ccfg           :   > FLASH_LAST (HIGH)
    
        GROUP > SRAM
        {
            .data
            .bss
            .vtable
            .vtable_ram
             vtable_ram
            .sysmem
            .nonretenvar
        } LOAD_END(heapStart)
    
        .stack          :   >  SRAM (HIGH) LOAD_START(heapEnd)
    }
    
    /* Create global constant that points to top of stack */
    /* CCS: Change stack size under Project Properties    */
    __STACK_TOP = __stack + __STACK_SIZE;

  • Is your device the CC1310F64 (64KB system flash)? If so, then you memory map makes sense to me.

    To get the rest of it to fit in flash, you can try increasing optimization (favoring code size) and see if that reduces the code size enough.

    Thanks

    ki

  • My optimisation is currently at it's maximum level to reduce the code size.

    I'm using the CC1310 launchpad, so it's the 128 KB version. Does this mean that the examples install with the wrong memory map?
  • Hi Craig,

    Sorry for the delayed response. I've been going though my list of threads and see I have left several still hanging. Your cmd file is a bit different than the one I have been using for the 1310 LP:

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/156/cc13x0lp.cmd

    I will move this to the 13xx forum, where the experts there can help you best.


    Thanks

    ki

  • Are you using the latest TI 15.4-Stack-2.0.1 released as part of the SimpleLink CC13x0 SDK for your development? If not, I would recommend to download the latest release from www.ti.com/tool/SIMPLELINK-CC13X0-SDK. And use the collector example application for CC1310. It supports sending data over the UART out of box. For more details about the application please refer to the developers guide part of the SDK install or at the page www.ti.com/tool/SIMPLELINK-CC13X0-SDK.