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.

TMS320F28P650DH: fminf/fmaxf functions in CLA

Part Number: TMS320F28P650DH
Other Parts Discussed in Thread: C2000WARE

Tool/software:

Hi Experts,

I am asking it for my customer. 

In the CLA, using the fminf/fmaxf functions triggers warnings but does not cause errors, and the functionality appears to work normally:

 "E:/workspace/git/1-215/dsp/KL_PCS_F28P65x_cpu1/src/module/control/INV/MBD/PWM_Gen/PWM_Gen.h", line 358: warning #225-D: function "fminf" declared implicitly "E:/workspace/git/1-215/dsp/KL_PCS_F28P65x_cpu1/src/module/control/INV/MBD/PWM_Gen/PWM_Gen.h", line 721: warning #225-D: function "fmaxf" declared implicitly

I tried adding preprocessor directives, as shown in Figure 1, but the warnings persist.

The compiler configuration is shown in Figure 2.

How can these warnings be resolved? Additionally, I am concerned that these warnings might cause issues under certain circumstances. I would appreciate an official explanation. Thank you!

Best Regards,

Dean

  • Hi Dean,

    I'm looking into your query and will respond back shortly.

    Regards,

    Ozino

  • Could you please let me know if there has been any progress on this issue? I sincerely hope a solution can be found. Thank you very much.

  • Hi Dean,

    Thanks for your patience. It looks like you will need a #include to the CLAmath library in order to access these functions. See below screenshot of how you can do this.

    Regards,

    Ozino

  • Hi Ozino, thanks for your reply. this method indeed eliminates the warning, but I noticed that CCS actually recognizes #ifndef __TMS320C28XX_CLA__ #include <math.h>. However, my function is confirmed to run in the CLA, so it should include <CLAmath.h> instead of <math.h>. Wouldn't this cause issues during actual execution?

    #ifndef PWM_Gen_h_
    #define PWM_Gen_h_
    #ifndef PWM_Gen_COMMON_INCLUDES_
    #define PWM_Gen_COMMON_INCLUDES_
    #include "rtwtypes.h"
    #endif                                 /* PWM_Gen_COMMON_INCLUDES_ */
    
    #include <stddef.h>
    #include "PWM_Gen_types.h"
    
    #ifndef __TMS320C28XX_CLA__
    #include <math.h>
    #else
    #include <CLAmath.h>
    #endif
    
    void MW_InitSysPll(uint16_T clock_source, uint16_T imult, uint32_T refdiv,
                       uint32_T odiv, uint16_T divsel, uint32_T dccbase);
    
    /* user code (top of header file) */
    /* Model 'PWM_Gen' */
    #include "params_TaskINVControl.h"
    #include "signal_io_TaskINVControl.h"
    #include "PWM_Gen_private.h"
    
    
    
    
    //Step function moved from c file
    #if CLA_ENABLE
    #pragma CODE_SECTION(PWM_Gen,"Cla1Prog")
    #endif 
    /* Output and update for referenced model: 'PWM_Gen' */
    static inline void PWM_Gen(void)
    {
        ......
        fmax...used here
        fmin...used here
        
    }

  • HI Dean, 

    It should not cause any issues for any files that are due to run on the CLA. You can reference our C2000Ware and DigitalPower SDK examples to see the impact of running code on the CLA.

    Regards,

    Ozino