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 program is loaded, what is 'Text' and 'Data' in console window?

Using Code Composer Studio,  Version: 4.1.3.00038, when a program is loaded the following is displayed

MSP430: Program loaded. Code Size - Text: 120256 bytes  Data: 62621 bytes

What are the Text and Data values?  Definitive answers only please.  I had assumed I knew what they are but via a couple of tests my assumptions turned out to be incorrect.

 

  • Hello PeterO,

    The text count is the sum of the lengths of all the STYP_TEXT sections in the COFF object file.

    The data count is the sum of the lengths of all the STYP_COPY and STYP_BSS sections in the COFF object file.

    Regards,
    Raymond

  • Peter,

    The number listed under "Text" refers to the combined size of all ".text", ".text:_isr", and any other code linker output sections - basically what your application code and C-runtime library code is. The number listed under "Data" refers to all non-Text sections that get programmed, such as ".cinit", ".reset", ".intXXX", ".const" and so on - basically everything else that needs to go into Flash which isn't code. So what is really interesting is that when you add those two numbers together, this gives you the total number of bytes that get programmed into Flash. If you re-check the linker map file given this understanding you should be able to match things up.

    Hope this helps,

    Rafael

  • Cheers guys for the replies.