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.

CCS/MSP430F2013: Unwanted .cio buffer

Part Number: MSP430F2013

Tool/software: Code Composer Studio

I'm struggling with the unwanted inclusion of a .cio buffer and presumably some associated library code that makes the project's RAM and ROM requirements too large for a MSP430F2013. The code has no printf, assert, or other statements that, so far as I know, require console I/O. The code compiled, downloaded, and ran without problem using IAR Embedded Workbench. How can I either discover what's invoking a .cio buffer or configure Code Composer not to include it?

  • Please submit your CCS project.  Follow the directions in the article Sharing Projects to create the zip file, then attach the zip to your next post.

    Thanks and regards,

    -George

  • As I prepared to submit the CSS project for scrutiny, I thought to first try commenting out portions of the code, starting with most of the code in main.c and proceeding through additional modules in the project. I hoped to discover what was engendering a .cio segment. I created a new project to handle the excised code. I built the new project with exact copies of the original module files. This time no .cio segment was created and no unwanted, presumably library components appeared in the code segment. I'm certain that the source code was unchanged. I'm chagrined that I cannot explain why the project now builds properly, but I'm relieved that it does. Thanks for the suggestion to submit the project.

  • The .cio buffer and additional object files from the rts430_eabi.lib library were being included by the linker output because in an .h file shared by several modules I declared 

        extern unsigned long time;

    but failed to define it anywhere. The linker therefore brought various unwanted objects, including

           rts430_eabi.lib : time.c.obj (.text:__time32)
                                           : trgmsg.c.obj (.text:__TI_writemsg)
                                           : trgmsg.c.obj (.text:__TI_readmsg)
                                           : lsl32.asm.obj (.text:l_lsl_const)
    It also created an unwanted .cio segment that was consuming 288 bytes of RAM.  Properly defining time eliminated the unwanted RTS components and the .cio segment.
  • PF9244 said:
    roperly defining time eliminated the unwanted RTS components and the .cio segment.

    time in a function in the run time library which obtains the time of day from the host PC via the CIO mechanism. Given that the time symbol was referenced in your program, but not defined, that explains why the linker included the time function and dependent symbols from the run time library.

  • I struggled with this problem for hours.  I could not find a way in Code Composer to identify what element or elements in a project cause unwanted components of run time library to be included.  Is there a way to do this?

  • PF9244 said:
    I could not find a way in Code Composer to identify what element or elements in a project cause unwanted components of run time library to be included.

    The TI linker supports the --emit_references:file option - see the 8.4.6 Control Linker Diagnostics section of the MSP430 Assembly Language Tools User's Guide. You can specify the filename to create in the CCS project properties:

    The file containing the references is generated even if the link fails due insufficient space.

    The CCS Stack Usage view displays a call tree of the program which can also be used to determine what is causing unwanted RTS functions to be linked, but the Stack Usage analysis is only possible when the program is successfully linked.