cmsp430code-composer

Why does upgrading to a higher Version of Code Composer Studio/Compiler increase the size of the program for MSP430-F148?


I have a tested, working, and shipping firmware program (C language) for the TI MPS430-F148 micro-controller. It was carefully crafted to fit into the available memory, developed with TI's Code Composer Studio version 5.2.1/compiler version 4.1.1.

I exported the project from Code Composer Studio 5.2.1 and imported it into TI's Code Composer Studio Version 7.4.0. Upon building the project I get this error message:

"error #10099-D: program will not fit into available memory."

This was followed by a warning saying my program was created with compiler version 4.1.1, but another compiler version will be used:

"This project was created using a version of compiler that is not currently installed - 4.1.1 [MSP430]. Another version of the compiler will be used during build - 16.9.6.LTS."

Additional text in the warning suggested getting and installing the earlier version of the compiler. I found and installed the version closest to version 4.1.1, which is version 4.1.9

Then the project was built without error, with memory to spare, as expected. It passed subsequent testing. Problem solved, but a question remains.

I assumed that a higher version of Code Composer Studio, with a higher version of the compiler, using the same project files and the same source code, would still produce code that fits into the available memory.

What is wrong with my assumption?


Solution

  • Your main assumption—that it is the very same compiler—is wrong: it is a different compiler, even if it is "just" a different version. You have to treat it like you would treat a new compiler.

    I cannot tell you the exact reason for its new behavior without the sourcecodes but I guess it is a different way to optimize for speed. The ChangeLog might give you a hint, e.g.: switching on/off some optimizations for speed/size. Or, as Mandraenke suggests, the actual reasons are just some different settings somewhere else in the chain, my first guess would be in the Makefile.

    You should change your compiler, some even say the whole building tool-chain, only if you need a grave bug fixed, some additional options, or support for a newer standard, especially with the large zoo of MCUs today. And with the current sizes of harddrives it is probably not the worst idea to archive the compiler[1] together with the sourcecode.

    [1] the license of your compiler may or may not allow for it.