Hi,
I work on code generation using Matlab 2018b + Code Composer V6, I generate C code using Embedded coder with ert.tlc target file, my target is a C2000 TMS320F28335.
My Simulink model uses different interfaces (I2C, SPI, ...) and especially an ADC_INA block named "ADC" which is configured correctly. When I try to generate my model using all blocks except ADC, the code is generated without error.
When I generate code including the ADC interface, I get an error when generating the source file ADC.c : "ADC.c line 29: error: identifier "adcInitFlag" is undefined".
Indeed, when I look into ADC.c, at the beginning of the Start function I can see a condition :
if (adcInitFlag == 0) {
InitAdc();
}
And since I see no declaration of adcInitFlag in the function, of course it returns an error.
My question is : since I can set this "init flag" nowhere in my model, how can I avoid this error ?
In the past I generated code on the same model using Matlab 2013a instead, and this condition on adcInitFlag didn't exist, so I never got the error. Could it have been added since 2013 ?
Thank you for your help,
Best regards,
François