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/CC2640: problem with "program will not fit into available memory" : what is actual nature?

Part Number: CC2640


Tool/software: Code Composer Studio

My code for CC2640r2 launchpad got this when build:

program will not fit into available memory. placement with alignment fails for section ".cinit" size 0x59d . Available memory ranges:
FLASH size: 0x1f000 unused: 0x4 max hole: 0x3
FLASH_LAST_PAGE size: 0x1000 unused: 0x554 max hole: 0x554

memory allocation below

open cc26xx_app.cmd, the problem located at this line:

 .cinit          :   >  FLASH | FLASH_LAST_PAGE

So I tried increasing FLASH_LAST_PAGE at FLASH_LAST_PAGE (RX) :  origin = FLASH_LAST_PAGE_START, length = PAGE_SIZE

and I am able to get compiled OK

However when debug I get :File Loader: Memory write failed: Timed out waiting for target flashloader to execute command.

as below photo, there is no more failed allocation, but I cannot flash into MCU

what should I try at the moment?

  • Hi Tuan,

    We do not recommend changing the linker cmd file to get rid of the build errors that you received. The CC2640R2F has 128kb of flash. When using a BLE application, part of the stack and application is consuming some of the flash space. Simple_peripheral out of the box for instance allows for upwards of 60 or 70kb of available flash when using the BLE Stack v3.x. This means that you have a limited space for your application.

    The constraints are more apparent as well when using the BLE5 applications. You will either need to shrink your application code or move to the CC26x2 which has much more flash available (350kb+).