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.
When using CCS to compile code for CC3200, is there a way to insure the standard C libraries are compiled with optimization for minimal size?
To address the issues with RTS code size, and avoiding functions not called, you need to build a custom RTS library. Then, in your CCS project, change from using a standard RTS library to the custom one.
You can build a custom RTS library with the utility Mklib. This is a command line tool. In your command line shell, navigate to the \lib directory of the compiler installation. It will be a location similar to ...
C:\ti\ccsv7\tools\compiler\ti-cgt-arm_16.9.4.LTS\lib
Make sure your system path includes the \bin directory of the compiler installation. Then issue a command similar to ...
.\mklib --pattern=rtsv7M4_T_le_eabi.lib --name=rtsv7M4_T_le_eabi_small.lib --install_to=C:\path\to\my\ccs\project --extra_options="--gen_func_subsections=on --opt_for_speed=0" --parallel=4
I'll discuss this command line by line. But when you really invoke it, everything must be on one line.
Line 1 invokes the mklib utility. Line 2 names the RTS library you currently use. This is the library typically used for CC3200. But this has to match whatever you use now. Line 3 names the new custom library. You can name it however you like. I used the standard RTS library name, plus "_small". Line 4 says where to put the new library. I put it in the location of the CCS project that needs it. Line 5 lists the custom build options. --gen_func_subsections=on puts each function in a separate section. --opt_for_speed=0 tells the compiler to always favor size when optimizing. Please read more about these options in the ARM compiler manual. Line 6 is optional. It distributes the build commands across that many threads, usually making the build faster.
Now the custom library is yet another file in your CCS build. But you need to tell CCS not to use the standard RTS library. Right-click the project name and choose Properties. Then use the screen shot below.
Thanks and regards,
-George