Other Parts Discussed in Thread: CC2640
Tool/software: Code Composer Studio
Hello all,
I have some questions about size optimization for embedded software.
My application is based on ProjectZero sample program that comes with CC2640R2 LaunchXL kit.
This app is based on two projects :
- the main application
- the library (ble5_simple_central_cc2640r2lp_stack_library)
As I modified the main application I need to reduce the embedded code size.
So, I did the same things on both application and library, build parameters settings. These consists to suppress debug informations, and set maximum code optimizations for size. I have set two build configurations :
- DEBUG with minimal optimization and all debug options
- RELEASE with maximum code size optimizations but no debug options
I can see a global application (compiled and linked with .lib) little size gain, from 124k to 117k on the whole FLASH area of 127k.
But, this gain is not as important that what I can see ater library generation....
Here are some values :
- Library .LIB as DEBUG = 6 403 118 bytes
- Library .LIB as RELEASE = 577 976 bytes
- Application .HEX as DEBUG = 300 226 bytes
- Application .OUT as DEBUG = 3 701 584 bytes
- Application .HEX as RELEASE = 283 153 bytes
- Application .OUT as RELEASE = 2 518 704 bytes
I already checked my build configuration to be sure that it takes tha right files and that's Ok on this side.
To check that, I made an intermediate configuration using library in RELEASE and only the application in DEBUG :
- Application .HEX = 300 226 bytes
- Application .OUT = 3 394 812 bytes
I have tried to check the .MAP files... but it seems to be very complicated to interpret...
So, two questions :
1/- Do someone an help me in understanding why the final whole size doesn't decrease in the same proportion than the library ?
2/- Since the size I can read in generated files properties is not the same that I can see in the Memory Allocation window from CCS, I have many doubts... Am I checking the right files ?
Thank you in advance for any help.
I wish you a nice day, and to stay safe.
Regards
Patrick