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/TMS320F28375S: C struct variable defined in .cla file canot be used in main function.

Part Number: TMS320F28375S

Tool/software: Code Composer Studio

Hi,

I just come with a similar problem with CLA variables. 

I define a struct variable in my .cla file like below:

volatile FILTER vdc_flt;

And then I make an extern declaration before main function and change the value in main function. 

extern volatile FILTER vdc_flt;

void main(void){
....
        /** calculate Vdc after low pass filter **/
        vdc_flt.in[2] = vdc_flt.in[1];
        vdc_flt.in[1] = vdc_flt.in[0];
        vdc_flt.in[0] = 0.1964*Vsense + 0.3205;
        vdc_flt.out[2] = vdc_flt.out[1];
        vdc_flt.out[1] = vdc_flt.out[0];
        vdc_flt.out[0] = 0.0055*vdc_flt.in[0] + 0.0111*vdc_flt.in[1] + 0.0055*vdc_flt.in[2]+\
                    -(-1.7786*vdc_flt.out[1]+0.8008*vdc_flt.out[2]);

What I saw in Expressions window is only vdc_flt.in[0] change and others are 0.

If I add one more command before the variable definition like below, it can work normally:

#pragma DATA_SECTION(vdc_flt,"CLADataLS1")
volatile FILTER vdc_flt;

I have checked that even I don't add the command of '#pragma...', the variable is still in RAMLS0, which is the shared RAM in this MCU.

By the way, I have also defined many other struct variables in CLA but only this variable has a wrong error.