Hi Champs,
I ask this for our customer.
Customer use asm("IACK #0x0002") to trigger CLA task2. The contents of CLA task2 are as follows. The content of this code is very simple, just clear some variables. Adding u16ClaClrState1 = 101 is only used to determine whether the CLA task is triggered.
When optimization is not turned on, the variable u16ClaClrState is not assigned the value FALSE. At this time, they can read u16ClaClrState1 = 101, which can be considered the CLA task is triggered successfully, but u16ClaClrState is always TRUE; it is suspected that the CLA task has not finished running. It looks like the for loop was interrupted while it was executing.
When the optimization level is adjusted to -O2, the variable u16ClaClrState1=101, can prove that the CLA task 2 is successfully triggered, and the u16ClaClrState is successfully assigned to FALSE, indicating that the CLA task can finish to run the for loop under O2 optimization.
I checked the TRM, and I found that CLA tasks cannot be nested. I understand that it means that CLA tasks cannot be interrupted by other CLA tasks during execution. So what other reasons can cause CLA to be interrupted like this? Could you please give me some suggestoins?
And the assembly code of this code in the case of optimization_off and optimization_O2 is as follows, for your reference:
-O 0ff:
-O2
Best Regards,
Julia