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/TMS320F28377D: Check the storage location of internal static variable (inside function)

Part Number: TMS320F28377D

Tool/software: Code Composer Studio

Hi expert,

May I know if we have any method in CSS, using debug, compiler generated file or some other method to dig out the storage location of internal static variable?

Thanks

Sheldon

  • Hi Sheldon,

    I am not sure what you mean by internal static variables..

    These 4 sections below are usually the common sections where the static variables are stored. 

    • .cinit : The compiler does not generate a .cinit section unless the --rom_mode linker option is specified. If -- rom_mode is specified, the linker creates this section, which contains tables for explicitly initialized global and static variables.
    • .const Global and static const variables, including string constants and initializes for local variables.
    • .data Global and static non-const variables that are explicitly initialized.
    • .bss Uninitialized global and static variables

    Other memory locations and details can be got it sections 6.3.5 Specifying Where to Allocate Sections in Memory and 8.1.1 Sections  of the below doc.

    http://www.ti.com/lit/ug/sprui04b/sprui04b.pdf

    The linker command file specifies which physical memory these sections like .bss etc are allocated to .

    The .map file generated as part of the code compile can give details on the static variables and the sections.

    Regards.