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.
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.
Hello,
Shared variables need to be defined in the C28x source. Please see this FAQ:
The CLA hands-on-workshop is very good at describing the CLA, how to develop code for it, and also how to debug it in Code Composer Studio. I think you will find it helpful. Here is the link to the workshop:
Click here for more CLA FAQs and resources.
I hope this helps. If this answers your question, please click the green "Verified Answer" button.