0
\$\begingroup\$

In memory allocation window of Code composer studio 6.1 I see 288 bytes of .CIO section. What is this segment and how I can remove it. Linker file lnk_msp430f2619 has mention of .CIO section. But where I can make this zero byte section.

 .bss        : {} > RAM                  /* Global & static vars              */
    .data       : {} > RAM                  /* Global & static vars              */
    .TI.noinit  : {} > RAM                  /* For #pragma noinit                */
    .sysmem     : {} > RAM                  /* Dynamic memory allocation area    */
    .stack      : {} > RAM (HIGH)           /* Software system stack             */

#ifndef __LARGE_DATA_MODEL__
    .text       : {}>> FLASH                /* Code                              */
#else
    .text       : {}>> FLASH2 | FLASH       /* Code                              */
#endif
    .text:_isr  : {} > FLASH                /* ISR Code space                    */
    .cinit      : {} > FLASH                /* Initialization tables             */
#ifndef __LARGE_DATA_MODEL__
    .const      : {} > FLASH                /* Constant data                     */
#else
    .const      : {} > FLASH | FLASH2       /* Constant data                     */
#endif
    .cio        : {} > RAM                  /* C I/O Buffer                      *

/

\$\endgroup\$

1 Answer 1

3
\$\begingroup\$

According to the CCS user guide:

Console I/O (CIO) functions, such as printf, require the use of a breakpoint. If these functions are compiled in, but you do not wish to use a breakpoint, disable CIO functionality by changing the option in Project → Properties → CCS Debug Settings → Target → Generic Debug Options → Enable CIO function use.

According to the TI Forums:

The Debug project properties control if the CCS debugger attempts to perform CIO, and not the allocation of the .cio section on the target.

To prevent the .cio section being allocated on the target you have to ensure there are no calls to run time library functions which use CIO, e.g. ensure there are no calls to printf() in the code.

Later on it mentions:

Turns out I had some _assert(0) statements in one of my libraries. This would in turn bring in stdio, which would demand a .cio section, consuming ~400 bytes of RAM.

Mind which libraries you use.

\$\endgroup\$
2
  • \$\begingroup\$ Disabling Enable CIO funcion use does not guarantee .CIO section will not use memory. I think its about using run time library. I disabled assert function and its working. \$\endgroup\$
    – prasad
    Commented Jul 31, 2015 at 15:03
  • \$\begingroup\$ [final scene of detective novel] IT WAS THE ASSERT FUNCTION THE WHOLE TIME \$\endgroup\$
    – detly
    Commented Mar 9, 2019 at 11:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.