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,
I have a general question regarding register protections when low priority CLA tasks got interrupts by other CLA tasks. The chip is F28004x/F28003x series. Is there some examples how to protect registers when CLA tasks alternates. Just try to avoid malfunction of CLA. Please advise. Thank you.
Best regards,
Pengyuan
Hi,
Do you mean the CLA core registers or peripheral registers?
Regards,
Veena
Hello Veena,
Thank you for following up. I mean the CLA core registers. For a scenario, I am using task 8 as background task. If any other task (1~7) interrupt the background task 8, will calculation results or status of task 8 (prior to the interrupt) will be automatically stored in CLA core registers or somewhere else? Will those parameters will be automatically restored after the interruption complete. Or, it has to be manually operate (store/load). In this case, do you have any example? Thank you.
Best regards,
Pengyuan
Please make sure you have enabled CLA background task in the project compiler settings.
This will make compiler insert the required register context and save and restore instructions
Regards,
Veena
Hello Veena,
Thank you for the information. I am trying to understand precisely. So assuming that I enable the CLA background task in settings, the temporary information in registers used by task 8 (background task) will be automatically stored and restored when other tasks (1~7) interrupt the task 8 or complete the executions. Is that correct? Thank you again.
Best regards,
Pengyuan
Hello Veena,
Thank you for the information. I am trying to understand precisely. So assuming that I enable the CLA background task in settings, the temporary information in registers used by task 8 (background task) will be automatically stored and restored when other tasks (1~7) interrupt the task 8 or complete the executions. Is that correct? Thank you again.
Best regards,
Pengyuan
Yes, Compiler inserts the register save and restore instructions at the start and end of the tasks.
Reagrds,
Veena
Hello Kamath,
May I have another question? Is there any disassembly code/examples can show what happens when the CLA restores resistors used by task8 after the interrupt (task1~7 for example) is completed. Just try to understand the mechanism since the CLA does not have stack. Thank you so much.
Best regards,
Pengyuan
Hi,
You can enable the following compiler flag which will retain the generated assembly file in the build folder
You may find the .asm file corresponding to every .c and .cla file
CLA tasks also has stack and is part of scratchpad section
Regards,
Veena