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.
Hello,
We found an issue with the background task in CLA. In our setup we have one EPWM triggered CLA Task (Task 1) and one SW Triggered Task (CLA Task 2) working in parallel with a Background Task continuously running (at 10kHz). CLA Load was checked and is under 50%.
When the background task is interrupted by a SW Triggered CLA task (via CLA_forceTasks API call)
the background task’s context is lost and data is corrupted. However if it is interrupted by a CLA Task triggered by e.g. EPWM it will store it’s context
correctly and behave as expected.
Hi Vlad,
Our CLA expert will be able to answer your question shortly, thank you for your patience.
Hi,
Do you have background task enabled in the CCS compile settings?
And is the background task defined in the background interrupt attribute?
__attribute__((interrupt("background"))) void Cla1BackgroundTask ( void )
{
}
Reagrds,
Veena
Hello, yes background task interrupt attribute is present. We also are using the enable background task API
Ok,
Let me try to reproduce the issue at my end. Will get back to you soon
Regards,
Veena
Hi,
Apologies for the delay. I was OOO last 2 weeks.
The context save and restore is done by the task which preempts the background task. If you look at the generated assembly code, you can see the register save and restores instruction at the start and end of every CLA task, except the background task. Whether the task gets triggered due to EPWM or software ideally should not matter. Is there any chance the application code is writing to the stack memory of CLA while the task is running?
Regards,
Veena