GetSet Storage class SIL Error - Duplicate and Undefined references in xil_interface.c and GetSet.c file
Show older comments
Hello All,
I am currently facing an issue during Software-in-the-Loop (SIL) testing with Simulink. The problem arises due to duplicate and undefined references between the generated xil_interface.c file and my custom SCA_Intfc.c/SCA_Intfc.h implementation.
Here is the situation:
- In normal builds, SCA_Intfc.c provides definitions for getter and setter functions declared in SCA_Intfc.h.
- During SIL testing, xil_interface.c also generates definitions for the same getter/setter functions, leading to multiple definition errors.
- To resolve this, I attempted conditional compilation using #define SIL_MODE and #ifndef SIL_MODE to disable definitions in SCA_Intfc.c during SIL. However, this resulted in undefined reference errors.
For reference, my SCA_Intfc.h file contains function declarations such as: float get_f32SpoolSetPoint_z_elef32SpoolSetPoint_um(void); void set_sca_OutDataGrp_z_ele1f32DerivativeVal_z(float val); ... and similar getter/setter prototypes.
My questions are:
- What is the recommended way to avoid duplicate definitions between xil_interface.c and SCA_Intfc.c during SIL testing?
- Should xil_interface.c be the sole provider of these function definitions in SIL, or should SCA_Intfc.c remain the source of truth?
- Is there a specific storage class configuration or code generation setting that ensures xil_interface.c only defines these functions in SIL mode instead of reading it from SCA_Intfc.c?
I would appreciate your guidance on the correct integration strategy to resolve this conflict.
Accepted Answer
More Answers (0)
Categories
Find more on Texas Instruments C2000 Processors in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!