Part Number: TMS320F28388D
Other Parts Discussed in Thread: SYSCONFIG, C2000WARE,
Hi Experts,
I am posting this on behalf of the customer. Here it is below.
I am trying to read and then average a ADC value on the CLA, then pass the averaged value though a shared CLA/CPU variable to the CPU. I will share in a moment how i declared the variables in the .c, .cla, and shared.h.
but first; the compilation issue i get is when I try to average the new ADC value
tempDouble = HWREGH(ADCCRESULT_BASE + 0x0U + lastRRPointer_s);
tempDouble = (0.1 * tempDouble) + (C28CLA_secondary.AC target="_blank">secondary.AC2DCMON * 0.9);
C28CLA_secondary.AC2DCMON = tempDouble;
give the compilation error: error #99923: "../CLA1.cla", line 352: CLA does not permit function calls in background tasks. Try inlining function.
the compilation error claims that it is occuring on line 352 (the first line of code with the HWREGH macro) and by the way - this error only shows up when the last line is present - if its just the first 2 lines of code then there is no compilation error
Here is my variable declaration code in case it helps;
main.c is;
#ifdef __cplusplus
#pragma DATA_SECTION("CLADataLS0")
#else
#pragma DATA_SECTION(C28CLA_secondary,"CLADataLS0")
#endif //__cplusplus
struct C28CLA_secondary_struct C28CLA_secondary; //Secondary signals coming from the CLA. These signals are grouped together as "secondary" given their less than high speed nature. This group represents signals updated at a about the emission loop speed.
shared.h is;
struct C28CLA_secondary_struct {
volatile double AC1DCMON;
volatile double AC2DCMON;
} extern C28CLA_secondary;
well and actually nothing in the .cla (because its declared in the .h. I hope that is correct lol)
I am not using a function call.
I was using Ti’s function MACRO for access hardware registers. HOWEVER – even If I remove the MACRO-FUNCTION call for accessing hardware registers, and replace that code with a hard coded value, then I still get the same compilation error.
The original line of code; (HWREGH is a macro-function)
C28CLA_secondary.AC1DCMON = (0.9 * C28CLA_secondary.AC1DCMON) + (0.1 * HWREGH(ADCCRESULT_BASE + 0x0U + lastRRPointer_s));
Code with macro-function removed and it still gives compilation error
C28CLA_secondary.AC1DCMON = (0.9 * C28CLA_secondary.AC1DCMON) + (0.1 * 123);
Thank you in advance!
Best regards,
Jonathan