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" error -- but it seems like plenty of memory is available

Other Parts Discussed in Thread: MSP430F5529

We have some firmware that previously compiled with only 46% of FLASH2 being consumed on an MSP430F5529.  After adding some new routines though, we started getting a "Program will not fit into available memory" error,  However, CCS reports that only 49% of FLASH2 is being used, which is puzzling.

I've attached an excerpt from the memory allocation display below.  Any ideas about what is going wrong?  It doesn't seem to me that we should be seeing such a dramatic increase in the memory used.

  • Looking at the memory allocation, it appears that the .bss and .TI.init sections are the ones in Red and failed to allocate. You can confirm if those are indeed the sections that failed to allocate by looking at the link map file (.map). 

    The .bss section is for uninitialized global variables, and goes into RAM, along with stack and heap (.sysmem) sections . If you are truly running out of RAM due to a large number of global variables, you may want to review them and consider making some of them const so they go into the .const section instead (which gets placed in FLASH and not RAM). 

  • Thanks! Looks like that fixed the problem.