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.

program will not fit into available memory

Other Parts Discussed in Thread: CC2650, CC2640

Hi ,

I am getting the following Error (basically the programme will not fit into memory).... what steps can I pursue to debug this issue/ are there memory tools available to help:?

"C:/TI/simplelink/ble_cc26xx_2_01_00_44423/Projects/ble/common/cc26xx/CCS/cc26xx_ble_app.cmd", line 103: error #10099-D: program will not fit into available memory.  placement with alignment fails for section ".text" size 0xe5ae .  Available memory ranges:
   FLASH        size: 0x8fff       unused: 0x11         max hole: 0x3       
   FLASH_LAST_PAGE   size: 0x1000       unused: 0x2          max hole: 0x2       
"C:/TI/simplelink/ble_cc26xx_2_01_00_44423/Projects/ble/common/cc26xx/CCS/cc26xx_ble_app.cmd", line 104: error #10099-D: program will not fit into available memory.  placement with alignment fails for section ".const" size 0x10b7 .  Available memory ranges:
   FLASH        size: 0x8fff       unused: 0x11         max hole: 0x3       
   FLASH_LAST_PAGE   size: 0x1000       unused: 0x2          max hole: 0x2       
error #10099-D: program will not fit into available memory.  run placement with alignment fails for section "DATA_GROUP" size 0xc29 .  Available memory ranges:
   SRAM         size: 0x2cff       unused: 0x4b         max hole: 0x38      
"C:/TI/simplelink/ble_cc26xx_2_01_00_44423/Projects/ble/common/cc26xx/CCS/cc26xx_ble_app.cmd", line 107: error #10099-D: program will not fit into available memory.  placement with alignment fails for section ".cinit" size 0x787 .  Available memory ranges:
   FLASH        size: 0x8fff       unused: 0x9          max hole: 0x3       
   FLASH_LAST_PAGE   size: 0x1000       unused: 0x0          max hole: 0x0       
error #10010: errors encountered during linking; "SimpleBLEBroadcaster21.out" not built

  • IMHO the error message is quite clear - you are out of (code space) memory. Or to state it differently, the code space is too small for your application.

    There are three possible remedies :

     - optimizing your application (compile with optimization for size enabled)

     - reduce / shorten your application, e.g. throw out debug code

     - use another device with bigger Flash

    If you are not in the final stages of your project, it is probably the best choice to go for the last option - a bigger Flash.

    PS: albeit I'm not a c2000 user, this issue transcends this controller family. I went through similiar situations with other MCUs during the last years ...

  • Hello. There are likely ways to reduce your flash usage. Can you post your application and stack project .map files? And can you also post the build_config.opt?
  • /**************************************************************************************************
        Filename:       buildConfigSrc.opt
        Revised:        $Date: 2007-10-12 17:31:39 -0700 (Fri, 12 Oct 2007) $
        Revision:       $Revision: 15678 $
    
        Description:    This file contains the Bluetooth Low Energy (BLE) build
                        config options. 
    
        Copyright 2011 - 2015 Texas Instruments Incorporated. All rights reserved.
    
        IMPORTANT: Your use of this Software is limited to those specific rights
        granted under the terms of a software license agreement between the user
        who downloaded the software, his/her employer (which must be your employer)
        and Texas Instruments Incorporated (the "License").  You may not use this
        Software unless you agree to abide by the terms of the License. The License
        limits your use, and you acknowledge, that the Software may not be modified,
        copied or distributed unless embedded on a Texas Instruments microcontroller
        or used solely and exclusively in conjunction with a Texas Instruments radio
        frequency transceiver, which is integrated into your product.  Other than for
        the foregoing purpose, you may not use, reproduce, copy, prepare derivative
        works of, modify, distribute, perform, display or sell this Software and/or
        its documentation for any purpose.
    
        YOU FURTHER ACKNOWLEDGE AND AGREE THAT THE SOFTWARE AND DOCUMENTATION ARE
        PROVIDED 揂S IS?WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED,
        INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE,
        NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL
        TEXAS INSTRUMENTS OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER CONTRACT,
        NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER
        LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
        INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE
        OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT
        OF SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
        (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
    
        Should you have any questions regarding your right to use this Software,
        contact Texas Instruments Incorporated at www.TI.com.
    **************************************************************************************************/
    
    /*
        The following is a list of all possible build defines and corresponding options
        that can be set for each define:
    
        GATT_DB_OFF_CHIP        - Indicates that the GATT database is maintained off the chip on the 
                                Application Processor (AP).
    
        GAP_PRIVACY             - Applicable to the Peripheral Privacy feature only.
        GAP_PRIVACY_RECONNECT   - The Peripheral Privacy Flag attribute is included in the GATT database 
                                when either of GAP_PRIVACY or GAP_PRIVACY_RECONNECT is defined.
                                - The Reconnection Address attribute is included in the GATT database 
                                when GAP_PRIVACY_RECONNECT is defined.
    
        GAP_BOND_MGR            - Used to include the Bond Manager
    
        L2CAP_CO_CHANNELS       - Used to include the L2CAP Connection Oriented Channel support
    
        GATT_NO_SERVICE_CHANGED - Used to exclude service changed characteristic from GATT Service
                                Note: Either L2CAP_CO_CHANNELS or GATT_NO_SERVICE_CHANGED must be defined
                                exclusively for any project.
        
        HOST_CONFIG             (BLE Host Build Configurations) Possible Options:
            PERIPHERAL_CFG      - Used to include the GAP Peripheral Role support
            CENTRAL_CFG         - Used to include the GAP Central Role support 
            OBSERVER_CFG        - Used to include the GAP Observer Role support 
            BROADCASTER_CFG     - Used to include the GAP Broadcaster Role support 
    
        HCI_TL_FULL             - All supported HCI commands are available via the Tranport Layer's NPI. 
                                - Intended for NP solution.
        HCI_TL_PTM              - Only those HCI commands needed for Production Test Mode are available 
                                via the Transport Layer's NPI
                                - Intended for SOC solutions where, during production, accesss is temporarily
                                needed (e.g. for PHY testing using Direct Test Mode, etc.).
        HCI_TL_NONE             - No supported HCI commands are available via the Transport Layer's NPI.
                                - Intended for SOC solutions.
    
        CTRL_V41_CONFIG         (BLE v4.1 Features) Possible Options:
            PING_CFG            - Feature that was added to the Controller to ready it for Secure Connections.
                                It ensures connection authentication is maintained
            SLV_FEAT_EXCHG_CFG  - Feature that allows the Slave to initiate a formerly prohibited feature 
                                exchange control procedure
            CONN_PARAM_REQ_CFG  - LL Topology feature that allows the Master or Slave to initiate a connection 
                                parameter control procedure used to exchange and negotiate not only a change in 
                                connection parameters, but offset adjustments and connection interval 
                                periodicities as well.
            MST_SLV_CFG         - Feature that allows a device to assume both the Master and Slave connection role
                                at the same time in support of more complicated topologies that can be leveraged 
                                by applications and future features, such as Mesh.
    
        Below is general information for using and/or changing this configuration option file:
    
        Combo Roles:        Combo roles can be set by defining multiple roles for HOST_CONFIG. The possible 
                            combo roles and HOST_CONFIG defines are:
                            Peirpheral + Observer   :                   PERIPHERAL_CFG+OBSERVER_CFG
                            Central + Broadcaster   :                   CENTRAL_CFG+BROADCASTER_CFG
                            Peripheral + Central    :                   PERIPHERAL_CFG+CENTRAL_CFG
                            Broadcaster + Observer  :                   BROADCASTER_CFG+OBSERVER_CFG
    
        LibSearch Tool:     There is a pre build action for every stack project that runs a tool 
                            LibSearch.exe. This tool aims to automatically import the correct library
                            files into your project based on the defines in this file.
    
                            The locations of all library files and their correspond options are
                            <install dir>/Projects/ble/Libraries/CC26xx/IAR/CC2650/bin for stack libs
                            and at <install dir>/Projects/ble/Libraries/CC26xx/IAR/Common/bin for 
                            HCI Transport Layer libs
    
                            If an library is found that was built with matching options, it will be 
                            copied into the project local directory at <App ewp dir>/../../Lib/ and 
                            subsequently linked with the stack.
    
                            If you experience a build error with LibSearch.exe, expand the build error 
                            message by clicking Tools->Options->Messages->Show build messages:->All. 
                            The error messages printed out by the LibSearch tool should now appear in 
                            your Build Message window.
    
        Restrictions:       For CTRL_V41_CONFIG, either all options should be defined or no options should
                            be defined. This is based on the stack library files provided. In order to
                            reduce the number of stack combinations, only libraries with default
                            v4.1 features (for size constrained projects) or with all of the 
                            v4.1 features are provided in the release.
    */
    
    /* BLE Host Build Configurations */
    /* -DHOST_CONFIG=PERIPHERAL_CFG */
    /* -DHOST_CONFIG=CENTRAL_CFG */
    /* -DHOST_CONFIG=OBSERVER_CFG */
    -DHOST_CONFIG=BROADCASTER_CFG
    /* -DHOST_CONFIG=PERIPHERAL_CFG+OBSERVER_CFG */
    /* -DHOST_CONFIG=CENTRAL_CFG+BROADCASTER_CFG */
    /* -DHOST_CONFIG=PERIPHERAL_CFG+CENTRAL_CFG */
    /* -DHOST_CONFIG=OBSERVER_CFG+BROADCASTER_CFG */
    
    /* GATT Database being off chip*/
    /* -DGATT_DB_OFF_CHIP*/
    
    /* GAP Privacy Feature */
    /* -DGAP_PRIVACY */
    /* -DGAP_PRIVACY_RECONNECT */
    
    /* Include GAP Bond Manager */
    /* -DGAP_BOND_MGR */
    
    /* Host Build Options */
    -DL2CAP_CO_CHANNELS 
    /* -DGATT_NO_SERVICE_CHANGED */
    
    /* Include Transport Layer (Full or PTM) */
    -DHCI_TL_NONE
    /* -DHCI_TL_PTM */
    /* -DHCI_TL_FULL */
    
    /* BLE Core Spec V4.1 Controller Feature Partition Build Configuration. Comment out to use default Controller Configuration  */
    -DCTRL_V41_CONFIG=PING_CFG+SLV_FEAT_EXCHG_CFG+CONN_PARAM_REQ_CFG+MST_SLV_CFG
    

    Build_config.opt

  • How can I attach the .map files?
  • Hi ,

    I am actually at the stage of my project where if there was a CC2650 device available with more Flash RAM I would be interested in knowing if TI have plans for that ?
  • I have noticed that the Flash Length in the application .map file is much shorter versus another computer I have ported this project from:

    The length is '00008fff'

    MEMORY CONFIGURATION
    
             name            origin    length      used     unused   attr    fill
    ----------------------  --------  ---------  --------  --------  ----  --------
      FLASH                 00000000   00008fff  00008ff6  00000009  R  X
      FLASH_LAST_PAGE       0001f000   00001000  00001000  00000000  R  X
      SRAM                  20000000   00002cff  00002cb4  0000004b  RW X
    

    on another computer that this project compiles just fine it is ICALL_STACK0_ADDR-1  where   ICALL_STACK0_ADDR=0x00017000 (this is correct)

    MEMORY CONFIGURATION
    
             name            origin    length      used     unused   attr    fill
    ----------------------  --------  ---------  --------  --------  ----  --------
      FLASH                 00000000   00016fff  000101d2  00006e2d  R  X
      FLASH_LAST_PAGE       0001f000   00001000  00000058  00000fa8  R  X
      SRAM                  20000000   00004667  000038b0  00000db7  RW X
    

    The .cmd and .cfg files under the Tools folder in the Application seem to match the other computer but how come the SRAM Flash length is getting corrupted?

  • I tried to add to the Predefined Symbols (but I think this is a duplication of C:/TI/simplelink/ble_cc26xx_2_01_00_44423/Projects/ble/SimpleBLEBroadcaster21/CC26xx/CCS/Config/ccsLinkerDefines.cmd )

    ICALL_STACK0_ADDR=0x00017000
  • Based on the following line from your .opt file, you are compiling in multiRole capability and other 4.1 features:DCTRL_V41_CONFIG=PING_CFG+SLV_FEAT_EXCHG_CFG+CONN_PARAM_REQ_CFG+MST_SLV_CFG

    Are you using / do you need these?

  • Hi Tim,

    I have commented out this line in the .opt file and redid a clean build of the Stack and the Application .. still getting the same message "program will not fit into available memory"

    Regards

  • I dont know what happened to my suggested answer in the last post but here it is again:


    To get this working I had to add the following properties to the project:

    Properties>ARM Linker > Advanced options > Command File Preprocessor > Add the following

    ICALL_STACK0_ADDR=0x00017000
    ICALL_RAM0_ADDR=0x20004668

    Then do a clean build ,... seems that these variables are getting corrupted .. noticed that the Link Order on this computer is different from another computer the link libraries are coming after the object files on this computer whereas on another computer they are coming before(highlighted in BOLD below)?

    Building target: SimpleBLEBroadcaster21.out'
    'Invoking: ARM Linker'
    "C:/TI/ccsv6/tools/compiler/ti-cgt-arm_5.2.4/bin/armcl" --cmd_file="C:/ti/simplelink/ble_cc26xx_2_01_00_44423/Projects/ble/SimpleBLEBroadcaster21/CC26xx/CCS/SimpleBLEBroadcaster21/../../IAR/Application/CC2640/../../../CCS/Config/ccsCompilerDefines.bcfg"  -mv7M3 --code_state=16 --abi=eabi -me -Ooff --opt_for_speed=0 --define=USE_ICALL --define=TI_DRIVERS_I2C_INCLUDED --define=USE_DMP --define=MPU9250 --define=SBB_TASK_STACK_SIZE=700 --define=GAPROLE_TASK_STACK_SIZE=520 --define=POWER_SAVING --define=HEAPMGR_SIZE=3072 --define=ICALL_MAX_NUM_TASKS=3 --define=ICALL_MAX_NUM_ENTITIES=6 --define=xdc_runtime_Assert_DISABLE_ALL --define=xdc_runtime_Log_DISABLE_ALL --define=CC26XXWARE --define=CC26XX --define=ccs --define=DEBUG --define=CC2650EM_7ID --display_error_number --diag_suppress=48 --diag_warning=225 --diag_wrap=off --gen_func_subsections=on -z -m"SimpleBLEBroadcaster21.map" --heap_size=0 --stack_size=256 -i"C:/TI/ccsv6/tools/compiler/ti-cgt-arm_5.2.4/lib" -i"C:/TI/ccsv6/tools/compiler/ti-cgt-arm_5.2.4/include" --reread_libs --define=ICALL_STACK0_ADDR=0x00017000 --define=ICALL_RAM0_ADDR=0x20004668 --warn_sections --display_error_number --diag_suppress=10247-D --diag_wrap=off --xml_link_info="SimpleBLEBroadcaster21_linkInfo.xml" --rom_model --unused_section_elimination=on --compress_dwarf=on -o "SimpleBLEBroadcaster21.out" "./Startup/Board.obj" "./Startup/ccfg_appBLE.obj" "./Startup/main.obj" "./PROFILES/broadcaster.obj" "./ICallBLE/ICallBleAPI.obj" "./ICallBLE/bleUserConfig.obj" "./ICall/ICall.obj" "./ICall/ICallCC2650.obj" "./Drivers/UDMA/UDMACC26XX.obj" "./Drivers/UART/UART.obj" "./Drivers/UART/UARTCC26XX.obj" "./Drivers/SPI/SPI.obj" "./Drivers/SPI/SPICC26XXDMA.obj" "./Drivers/PIN/PINCC26XX.obj" "./Drivers/LCD/LCDDogm1286.obj" "./Drivers/LCD/LCDDogm1286_util.obj" "./Application/ArcTan.obj" "./Application/I2C.obj" "./Application/I2CCC26XX.obj" "./Application/StepCount.obj" "./Application/bsp_i2c.obj" "./Application/buzzer.obj" "./Application/cc2650_port.obj" "./Application/deviceID.obj" "./Application/inv_mpu.obj" "./Application/inv_mpu_dmp_motion_driver.obj" "./Application/mpu9150.obj" "./Application/quaternion.obj" "./Application/simpleBLEBroadcaster.obj" "./Application/util.obj" "./Application/vector3d.obj" "C:/TI/simplelink/ble_cc26xx_2_01_00_44423/Projects/ble/common/cc26xx/CCS/cc26xx_ble_app.cmd" "C:/TI/simplelink/ble_cc26xx_2_01_00_44423/Projects/ble/SimpleBLEBroadcaster21/CC26xx/CCS/Config/ccsLinkerDefines.cmd" -l"./configPkg/linker.cmd"  -l"libc.a" -l"C:/ti/tirtos_simplelink_2_13_00_06/products/cc26xxware_2_21_01_15600/driverlib/bin/ccs/driverlib.lib"
    <Linking>
    'Finished building target: SimpleBLEBroadcaster21.out'

  • Well that is good that you solved the problem but I'm not sure why that would be. By default, those RAM and flash boundary variables are managed by a post-processing step (BoundaryTool) in the stack project. You shouldn't have to set them manually.
  • Hi,
    I am struggling with the same problem. could u solve it??? where can i get this .opt file??
  • Hello. Please see section 5.8 of the software developer's guide for the .opt file location and description: www.ti.com/.../swru393

  • That worked for me. Many thanks!!!

    These numbers seems somewhat magical though. Are these the only settings, or just optimal in some context.

    Is there any reason they should be adjusted at all for a standard 7x7 cc2650?

  • After testing, I realized it didn't work.
    Everything compiled, but then code wouldn't run.
    Back to the drawing board.
  • I have the very same problem, after porting a project to BLE SDK 2.2. In that project, this configurations are set in two configuration files (cssLinkerDefines.cmd and cssLinkDefines.cmd). From comments in that files I would say that this configurations are set by a tool that analyses the map files of both projects (app and stack) (Stack Frontier Generator / formerly known as Boundary tool).

    Am I'm supposed to set that Options? Or are they auto generated?