Part Number: TMS320F28P650SH
Other Parts Discussed in Thread: C2000WARE
Tool/software:

When this program runs in the CLA, it affects the results of the main CLA program. What is the reason?
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.
Part Number: TMS320F28P650SH
Other Parts Discussed in Thread: C2000WARE
Tool/software:

When this program runs in the CLA, it affects the results of the main CLA program. What is the reason?
What impact are you seeing with this sigma variable? Is the sigma variable being modified at other parts in the application? I don't believe passing in tttsigma should affect sigma.
It's not sigma and tttsigma, it's what tttsigma points to (the function called is also cla, pointing to a local variable) that affects the value of other programs in cla, and now the program is running, there will be an inexplicable error
It is still not clear to me what the issue is here.
What function is tttsigma referring to? Is this function as part of a CLA task? Can you confirm that the cla has been setup correctly per the guide shown here?
/cfs-file/__key/communityserver-discussions-components-files/171/CLAProjectStructureUG.pdf
It sounds like the same routine shown above works when compiled for the C28x. Is that correct?
Regards,
Ozino
CLA has been configured correctly。The dpwm_Compensatation() function is just a local function located in the header file。The function that is called works when the dpwm_Compensatation() function is not running。A function that calls a dpwm_Compensatation() function, and the code that is called with the same call works fine on Windows、
Can you share the steps to configure your CLA. Which functions are ported to run on the CLA, is it the compensation routine or some other functions that are calling the compensation routine? It sounds like when the compensation routine is disabled all the code works and does not work when enabled. Is that correct?
B->A->dpwm_Compensatation,all in cla; A and dpwm_Compensatation is tested well on windows10. When on cla, it is error
I assume when you say it works well on windows10, I assume this to mean the code works when all functions are compiled for the C28x?
Are you able to split the code implementation and enable each function individual on the CLA to confirm accurate setup and calls to the CLA. For example, start with only dpwm_comp in the CLA, then add func A and lastly func B. At each step, making sure that the code is running on the CLA.
I would reference the cla_ex6_cpu_offloading available in C2000Ware under the driverlib folder for examples of how code is ofloaded.
c28 didn't try because B->A->dpwm_C only run in cla. These codes are ported from arm32, and A->dpwm_C works fine in arm32 and win10x64. Only the top of TI is not normal. Compared to the TI code written by others (which does not use local variables, and the variables used are all global or static variables), the code I added used a lot of local variables and multiple function calls with form parameters. Does TI's cla compilation not support local variables, or function calls that don't know multiple parameters?
If I'm understanding correctly, you have a bunch of local variables within the CLA enabled code and you're not seeing the data show up correct?
If so, I would recommend seeing if you can debug your code within the CLA tasks. Here's some information on how to debug on the CLA
https://software-dl.ti.com/C2000/docs/cla_software_dev_guide/debugging.html
Here's a forum post about debugging with local variables.
Hi Lori,
The red boxes don’t have special meaning for this case.
Per talked on email, we want to get your support about below questions.
This thread also includes some detailed information from customer side. Please let us know if you have any question. Thanks!
BR,
Fengyu
Does TI's cla compilation not support local variables
The CLA supports local variables. The memory available for data and variables is limited by the size of the CLA data RAMs and message RAM.
Refer to compiler guide (www.ti.com/lit/spru514) CLA compiler: 10.2.5 Memory Model - Sections
Local variables are placed into the CLA "scratchpad" which acts as the CLA C software stack.
It is expected that the .scratchpad is allocated in the application's linker command file.
Please check that the .scratchpad section is correctly allocated in the linker .cmd file.
It is not necessary to specify a size for the .scratchpad section. The linker does this for you.
function calls that don't know multiple parameters
Refer to compiler guide (www.ti.com/lit/spru514) CLA compiler: 10.2.6 Function Structure and Calling Conventions
Yes, multiple arguments are supported. Registers and the scratchpad are used to transfer variables between the functions.
This includes returning structures.
To debug further, try debugging this function in a small project that will allow stepping through the code.
This will help narrow the problem. is it (a) a problem with the function, or (b) the integration of he function into the application.
Regards,
Lori