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.
Hi,
my customer find that they will have infinite big value for MR1 for the code below in CLA:
The variable is part of the struct defined in H file
And it's initialized in CPU code below:
If I switch the struct sequence and make lfILCoefK after lfILCoefB, the error will be MR0, which means that the data pass from lfILCoefK to MR0 is wrong.
But I've no idea why it's like this, since we have specify it's float32 for the variable, so it should not be related to different data length for the same data type between CPU and CLA.
Hi Howard Zou,
Is the CLA code snippet hand created assembly or compiler generated assembly. If it is compiler generated assembly, please could you send the C code snippet?
Also, is the inifinite large value seen in MR1 after line marked in red with number 2 or number 5 above?
Thanks,
Ashwini
Hi Howard Zou,
One quick question, why is the type set to int32, int16 and float32 instead of the standard types with the underscore t such as int32_t, float32_t etc
Can you post what int32, float32 and int16 types are defined as?
Thanks,
Ashwini
Hi Howard,
Thanks for the information. I will sync up with the experts, please give me a few days to get their inputs.
Thanks,
Ashwini
Hi Howard,
Can you check what addresses were assigned to the struct variables on C28 and CLA side i.e. what memory location does @_Cpu2ClaVar.lfIlCoefB correspond to on both the c28x and the CLA. You can check the disassembly window, you may have to unload symbols after you have halted to see the raw address ( to do this use this option in CCS - Run->Load->Remove all symbols).
Also, do the struct members look correct from the C28 and CLA side after they have been initialized? You can add the struct to the Expressions Window and switch between C28 and CLA debug context to check the state of the struct from each of the core's context.
Thanks,
Ashwini
Ashwini,
below is the screenshot we captured from CCS, we can see the struct variable address are the same in both CLA debug and CPU debug context.
do the struct members look correct from the C28 and CLA side after they have been initialized?
Yes, but since these variables are initialized in CPU, I don't know why we need to switch between CPU debug context and CLA debug context.
Hi Howard,
Thanks for posting the snapshots. The values of the struct members are different in the two snapshots. For example, _Cpu2ClaVar member IQ10IoutRef is 512 in C28 snapshot and -709962838 in the CLA snapshot.
Can you add a mdebugstop instruction at the start of the CLA assembly functions so that the CLA halts and then check to see if the CPU2CLA struct members look identical from C28 and CLA side and have expected values.
If the struct members are identical on C28 and CLA side and do not have expected values maybe something is causing the datastructure to be corrupted on the C28 side as only C28 can write to it.
Thanks,
Ashwini
Hi Ashwini,
I add a mdebugstop at the start of the CLA assembly functions and then check the CPU2CLA struct members as below:
Hi,
Here is a suggestion to help debug this:
When the CLA halts at the mdebugstop step through the code and make sure that the value loaded into the MR registers matches the value in the data structure. If it does, then the CLA code is correct and you will need to check on the C28 side if something is corrupting the data structure as only C28 can write to the CPU2CLA memory. One way to check if code on the C28 side is causing a buffer overrun and corrupting the datastructure is to disable optimization and set watchpoint for write access to the members of the data structure.
Hope this helps.
Thanks,
Ashwini