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: TI C/C++ Compiler
Hi Expert,
Since CLA compiler doesn't support " Initialized global and static data", how to define the variable to be "static" used in CLA?
Thanks!
Rayna
Rayna,
I believe you can still do so, but the Compiler won't initialize them. You can do that inside your C28x CPU side driver code, for example.
Lori can confirm.
Thanks,
Sira
Thanks, Sira.
1. We defined a static variable "static uint16_t myVar = 200U ;" in "my.c" file
2. in header file "my.h", this variable is defined with "extern uint16_t myVar;";
3. in .cla file "my.cla", include header file with " #include "my.h"
we try to use this variable "myVar" in .cla file "my.cla", but this does not work.
Could you please tell us what we did wrong, and corrected our code above? Thanks!
Variables that are shared between the C28x and CLA have to be defined in the C28x code using the process defined here:
software-dl.ti.com/.../faq.html
If you want a variable to be static, meaning it retains its value between CLA tasks, then you would need to allocate a specific spot in memory for this variable and keep it there instead of on the CLA scratchpad.
I found some related posts:
https://e2e.ti.com/support/microcontrollers/c2000/f/171/t/334185?CLA-static-task-variables
The CLA Software Development Guide includes some great getting started information as well as FAQs and Debug tips for the CLA.
https://software-dl.ti.com/C2000/docs/cla_software_dev_guide/index.html