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.

CCS/TMS320F28027F: using IQmath and Solar_Lib_IQ problems with incompatible declarations

Part Number: TMS320F28027F
Other Parts Discussed in Thread: CONTROLSUITE

Tool/software: Code Composer Studio

Hi everyone,

I am trying to use some of the functions from the Solar_Lib_IQ library with the TMS320F28027F (well the LaunchPad XL for the now). I have included in my CCS project both Solar_IQ.h and IQmathLib.h but I have some building problems, I guess is because some redundancy during the type definition.

The exact problem is "this declaration has no storage class or type specifier" and it gives it when I first try to use some variables using types from the Solar_IQ library (lines 34, 35,36):

30 //IQ math variables
31 SPLL_1ph_SOGI_IQ spll1;
32 SPLL_1ph_SOGI_IQ_LPF_COEFF spll_lpf_coef1;
33
34 spll_lpf_coef1.B0_lf=B0_LPF;
35 spll_lpf_coef1.B1_lf=B1_LPF;
36 spll_lpf_coef1.A1_lf=A1_LPF;

SPLL_1ph_SOGI_IQ_LPF_COEFF is a struct type part of the Solar_IQ library, B0_LPF is a constant defined as _IQ23 type in the IQmath library.

Any suggestions on how to solve this problem ?? Thanks you very much in advance

Following my list of included libraries at main.h and also in the include directory tree, just in case you are able to find someone incompatible:

#include "DSP28x_Project.h"     // Device Headerfile and Examples Include File
#include "f2802x_common/include/clk.h"
#include "f2802x_common/include/flash.h"
#include "f2802x_common/include/gpio.h"
#include "f2802x_common/include/pie.h"
#include "f2802x_common/include/pll.h"
#include "f2802x_common/include/pwm.h"
#include "f2802x_common/include/wdog.h"
#include "f2802x_common/include/sci.h"
#include "f2802x_common/include/timer.h"
#include "f2802x_common/include/adc.h"
#include "f2802x_common/include/spi.h"
#include "f2802x_common/include/f2802x_globalprototypes.h"
#include "IQ/include/Solar_IQ.h"  //This one includes all the solar functions.
#include "include/IQmathLib.h"  //This one includes all the IQmath functions.
#include <stdbool.h>

  • you need to re-arrange and also make sure you declare a math type.. 

    #ifndef MATH_TYPE
    #define MATH_TYPE IQ_MATH
    #endif

    #include "include/IQmathLib.h"  //This one includes all the IQmath functions. 

    #include "IQ/include/Solar_IQ.h"  //This one includes all the solar functions.

    see if this resolves the issue, alternatively you can look at example code that uses this lib at

    C:\ti\controlSUITE\development_kits\TMDSSOLARUINVKIT_v100

  • Thanks  Manish for your tips,

    I got the IQ_math to work. But I realized that what I really need is to make use of the hardware multiplier, since the software multiplication is very slow for my application.  I have configured in the properties of the project CCS Build/Processor Options the "Specify floating point support -float support" to fpu32.

    But I am having a lot of building errors because the driver library (driverlib.lib) specifies ISA revision "C2800" and it says that it is not compatible with the other ISA revision defined previously. Maybe Am I using the wrong .cmd file??  Here is the console response:

    'Building target: SPLL_V0.out'

    'Invoking: C2000 Linker'

    "C:/ti/ccsv6/tools/compiler/c2000_6.2.7/bin/cl2000" -v28 -ml -mt --float_support=fpu32 -g --define="_FLASH" --define="LARGE_MODEL" --define="_DEBUG" --verbose_diagnostics --diag_warning=225 --display_error_number --diag_wrap=off --output_all_syms --cdebug_asm_data -z -m"SPLL_V0.map" --stack_size=0x300 --warn_sections -i"C:/ti/ccsv6/tools/compiler/c2000_6.2.7/lib" -i"C:/ti/controlSUITE/device_support/f2802x/v220/f2802x_headers/cmd" -i"C:/ti/ccsv6/tools/compiler/c2000_6.2.7/include" --reread_libs --display_error_number --diag_wrap=off --xml_link_info="SPLL_V0_linkInfo.xml" --entry_point=code_start --rom_model -o "SPLL_V0.out" "../F2802x_Headers_nonBIOS.cmd" "./Config.obj" "./DAC_functions.obj" "./Math_functions.obj" "./PID_functions.obj" "./main.obj" "../C28x_FPU_Lib.lib"  -l"C:\ti\controlSUITE\device_support\f2802x\v220\f2802x_common\lib\driverlib.lib" -l"C:\ti\controlSUITE\device_support\f2802x\v220\f2802x_common\cmd\F2802x_generic_flash.cmd" -l"libc.a"

    <Linking>

    error #16008-D: file "C:\ti\controlSUITE\device_support\f2802x\v220\f2802x_common\lib\driverlib.lib<wdog.obj>" specifies ISA revision "C2800", which is not compatible with ISA revision "C28FPU32" specified in a previous file or on the command line

    error #16008-D: file "C:\ti\controlSUITE\device_support\f2802x\v220\f2802x_common\lib\driverlib.lib<sci.obj>" specifies ISA revision "C2800", which is not compatible with ISA revision "C2700" specified in a previous file or on the command line

    error #16008-D: file "C:\ti\controlSUITE\device_support\f2802x\v220\f2802x_common\lib\driverlib.lib<pwm.obj>" specifies ISA revision "C2800", which is not compatible with ISA revision "C2700" specified in a previous file or on the command line

    error #16008-D: file "C:\ti\controlSUITE\device_support\f2802x\v220\f2802x_common\lib\driverlib.lib<pll.obj>" specifies ISA revision "C2800", which is not compatible with ISA revision "C2700" specified in a previous file or on the command line

    error #16008-D: file "C:\ti\controlSUITE\device_support\f2802x\v220\f2802x_common\lib\driverlib.lib<pie.obj>" specifies ISA revision "C2800", which is not compatible with ISA revision "C2700" specified in a previous file or on the command line

    error #16008-D: file "C:\ti\controlSUITE\device_support\f2802x\v220\f2802x_common\lib\driverlib.lib<gpio.obj>" specifies ISA revision "C2800", which is not compatible with ISA revision "C2700" specified in a previous file or on the command line

    error #16008-D: file "C:\ti\controlSUITE\device_support\f2802x\v220\f2802x_common\lib\driverlib.lib<flash.obj>" specifies ISA revision "C2800", which is not compatible with ISA revision "C2700" specified in a previous file or on the command line

    error #16008-D: file "C:\ti\controlSUITE\device_support\f2802x\v220\f2802x_common\lib\driverlib.lib<cpu.obj>" specifies ISA revision "C2800", which is not compatible with ISA revision "C2700" specified in a previous file or on the command line

    error #16008-D: file "C:\ti\controlSUITE\device_support\f2802x\v220\f2802x_common\lib\driverlib.lib<clk.obj>" specifies ISA revision "C2800", which is not compatible with ISA revision "C2700" specified in a previous file or on the command line

    error #16008-D: file "C:\ti\controlSUITE\device_support\f2802x\v220\f2802x_common\lib\driverlib.lib<adc.obj>" specifies ISA revision "C2800", which is not compatible with ISA revision "C2700" specified in a previous file or on the command line

    error #16008-D: file "C:\ti\controlSUITE\device_support\f2802x\v220\f2802x_common\lib\driverlib.lib<F2802xX_asmfuncs.obj>" specifies ISA revision "C2800", which is not compatible with ISA revision "C2700" specified in a previous file or on the command line

    error #16008-D: file "C:\ti\controlSUITE\device_support\f2802x\v220\f2802x_common\lib\driverlib.lib<F2802xX_GlobalVariableDefs.obj>" specifies ISA revision "C2800", which is not compatible with ISA revision "C2700" specified in a previous file or on the command line

    error #16008-D: file "C:\ti\controlSUITE\device_support\f2802x\v220\f2802x_common\lib\driverlib.lib<F2802xX_DefaultIsr.obj>" specifies ISA revision "C2800", which is not compatible with ISA revision "C2700" specified in a previous file or on the command line

    warning #10063-D: entry-point symbol other than "_c_int00" specified:  "code_start"

    error #10010: errors encountered during linking; "SPLL_V0.out" not built

    >> Compilation failure

    gmake: *** [SPLL_V0.out] Error 1

    gmake: Target `all' not remade because of errors.

    **** Build Finished ****

  • TMS320F28027F is fixed point device hence does not have a floating point hardware multiplier, you cannot use the fpu32 option, you will need to use IQmath for this device, or consider upgrading to a device that has FPU

  • Ok, I see. I think I misunderstood the 32x32 MAC operations.

    I am just trying to do a multiplication of two signed 16-bit integers as fast as possible.

    Right now I am using the following function that I used to use in STM32F2 family, but I am not sure if it is faster than the normal multiplication A*B or the _IQ16mpy. What do you think? Is there any way to speed up the multiplication?

    Thanks again for the help.

    void main()

    {

    int16_t A,B, result;

    int32_t temp=0;

    mul_q15_q15_q31(A, B,&temp);

    result=(int16_t)(temp>>16);

    }

    void mul_q15_q15_q31(int16_t Op1, int16_t Op2, int32_t *Out)

    {

    int32_t temp;

    temp = (int32_t)Op1*(int32_t)Op2;

    if (temp>=0x40000000)   /* Overflow (-1*-1) */

    {

     temp=0x7fffffff;

    }

    else

    {

     temp=temp<<1;       /* One bit left shift to remove redondant sign bit */

    }

    *Out=temp;

    }

  • The IQ math lib is usefull when you want to maintain the decimal point, i.e. it will make sure you get the results correctly scaled after the multiply,

    Q point is a way to implement control code by emulating the decimal point.

    What you are doing above should work, and IQmath is not necessarily faster in all the cases but it will take care of the shifts etc for you and with that it will be easier to use IQmath function than just multiple and shift in code,

    your code will be more maintainable and also if you did decide on switching to FPU based device you do not need to change the code, you can just change the IQmath switch.