Dear all,
I'm using CCS v5 and targeting an MSP430F1611. Looking at the .map file and the size of the produced image, I've noticed that a lot of unused things are being built into the executable.
The way I'm building my application is by putting each specific piece of code in its own .h/.c file (e.g., drivers). Thus I've got a lot of .obj that are included by the linker into the final image, even when that code is not used at all in the current executable I'm building.
For instance, with a main.c that does not include any header and a completely empty main() function, I get a 6Kb image that includes some of the .obj from my source code tree, and all the global variables (all declared static in their own source file) from all these .obj files.
Here's an excerpt from the .map file I get:
.bss 0 00001100 000006f0 UNINITIALIZED 00001100 0000024e at45db321dApp.obj (.bss) 0000134e 00000206 timers.obj (.bss) 00001554 00000068 tasks.obj (.bss) 000015bc 0000004b sx1231Device.obj (.bss)
There are a lot more of them, but you get the idea: There is no reason to include code from these files since my main() is just an empty function. RAM usage is around 1.7 Kb, and comes from all the individual static variables declared in the source files. These variables are accessed only by the functions in these files (hence the static) which are not called from anywhere (empty main()).
I've tried building in release mode, with all kinds of -O flags. I've also tried using the --gen_func_subsections flag.
Any help would be appreciated.