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/TMDSSOLARUINVKIT: TMDSSOLARUINVKI, #F28035, #SFRA

Part Number: TMDSSOLARUINVKIT

Tool/software: Code Composer Studio

I have a TMDSSOLARUINVKIT, and i try to add SFRA without GUI to project. but i have a problem
Building target: "SolarMicroInv_F2803x.out"
Invoking: C2000 Linker
"C:/ti/ccs901/ccs/tools/compiler/ti-cgt-c2000_18.1.5.LTS/bin/cl2000" 
-v28 -ml -mt --cla_support=cla0 --float_support=softlib -O4 --opt_for_speed=2 --advice:performance=all 
--define=_DEBUG --define=FLASH --define=LARGE_MODEL -g --diag_warning=225 -z -m"SolarMicroInv_F2803x.map" 
--stack_size=0x380 --warn_sections -i"C:/ti/controlSUITE/libs/app_libs/SFRA/v1_10_00_00/IQ/lib"
 -i"C:/ti/ccs901/ccs/tools/compiler/ti-cgt-c2000_18.1.5.LTS/lib" 
 -i"C:/ti/ccs901/ccs/tools/compiler/ti-cgt-c2000_18.1.5.LTS/include" --priority --reread_libs 
 --xml_link_info="SolarMicroInv_F2803x_linkInfo.xml" --rom_model -o "SolarMicroInv_F2803x.out" 
 "C:/ti/controlSUITE/libs/app_libs/solar/v1.2/IQ/lib/Solar_Lib_IQ.lib" 
 "C:/ti/controlSUITE/libs/math/IQmath/v160/lib/IQmath.lib" "../F28035_FLASH_SolarMicroInv.CMD"
 "./ADC_SOC_Cnf.obj" "./DSP2803x_CodeStartBranch.obj" "./DSP2803x_CpuTimers.obj" "./DSP2803x_GlobalVariableDefs.obj"
 "./DSP2803x_usDelay.obj" "./PWM_1ch_UpDwnCnt_Cnf.obj" "./PWM_MicroInvLineClamp_Cnf.obj" "./SciCommsGui_32bit.obj" 
 "./SolarMicroInv-DevInit_F2803x.obj" "./SolarMicroInv-Main.obj" 
 "C:/ti/controlSUITE/device_support/f2803x/v126/DSP2803x_headers/cmd/DSP2803x_Headers_nonBIOS.cmd"
 "C:/ti/controlSUITE/device_support/f2803x/v126/DSP2803x_common/lib/SFO_TI_Build_V6b.lib" 
 -l"C:/ti/controlSUITE/libs/app_libs/SFRA/v1_10_00_00/IQ/lib/SFRA_IQ_Lib.lib" 
 -l"C:/ti/controlSUITE/libs/utilities/flash_api/2803x/v100/lib/rts2800_ml.lib" -llibc.a 
<Linking>
>> ../SFRA_IQ_INIT.c, line 68: INTERNAL ERROR: no match for UMULT
 
 
This may be a serious problem.  Please contact customer support with a
description of this problem and a sample of the source files that caused this
INTERNAL ERROR message to appear.
 
Cannot continue compilation - ABORTING!
 
 
>> Compilation failure
 
>> Compilation failure
 
>> Compilation failure
makefile:155: recipe for target 'SolarMicroInv_F2803x.out' failed
fatal error: Failed linktime optimization
gmake: *** [SolarMicroInv_F2803x.out] Error 1
gmake: Target 'all' not remade because of errors.
**** Build Finished ****
When, I add SFRA code from  www.ti.com/lit/ug/spruhz5a/spruhz5a.pdf  in chapter 3.4 
 
1.  #include "SFRA_IQ_Include.h" on SolarMicroInv-Main.c of SolarMicroInv_F2803x file
1.2 Add Link SFRA Library: (SFRA_IQ_Lib.lib) to the project, SFRA lib is located at :  
     controlSUITE\development\libs\app_libs\SFRA\include 
1.3 Add Link Part of C2000 linker : (SFRA_IQ_Lib.lib) by SFRA lib is located at :  
     ..\controlSUITE\development\libs\app_libs\SFRA\v1_10_00_00\SFRA_IQ\lib   
1.4 Add Link Part of C2000 linker : (rts2800_ml.lib) by SFRA lib is located at :  
     ..\controlSUITE\libs\utilities\flash_api\2803x\v100\lib\rts2800_ml.lib  
2. Create and add module structure in SolarMicroInv-Main.c of SolarMicroInv_F2803x file
#define SFRA_ISR_FREQ 200000
#define SFRA_FREQ_START 100
#define SFRA_FREQ_LENGTH 100
//SFRA step Multiply = 10^(1/No of steps per decade(40))
#define FREQ_STEP_MULTIPLY (float)1.059253
3.Declare Arrays for FRA Data Storage in SolarMicroInv-Main.c
// SFRA lib Object
SFRA_IQ SFRA1;
// SFRA Variables
int32 Plant_MagVect[SFRA_FREQ_LENGTH];
int32 Plant_PhaseVect[SFRA_FREQ_LENGTH];
int32 OL_MagVect[SFRA_FREQ_LENGTH];
int32 OL_PhaseVect[SFRA_FREQ_LENGTH];
float32 FreqVect[SFRA_FREQ_LENGTH];
//Flag for reinitializing SFRA variables
int16 initializationFlag;
//extern to access tables in ROM
extern long IQsinTable[];
4. Initializing the module in SolarMicroInv-Main.c
// Do SFRA Object Initialization here
    //SFRA Object Initialization
    //Specify the injection amplitude
    SFRA1.amplitude=_IQ26(0.01);
    //Specify the length of SFRA
    SFRA1.Vec_Length=SFRA_FREQ_LENGTH;
    //Specify the SFRA ISR Frequency
    SFRA1.ISR_Freq=SFRA_ISR_FREQ;
    //Specify the Start Frequency of the SFRA analysis
    SFRA1.Freq_Start=SFRA_FREQ_START;
    //Specify the Frequency Step
    SFRA1.Freq_Step=FREQ_STEP_MULTIPLY;
    //Assign array location to Pointers in the SFRA object
    SFRA1.FreqVect=FreqVect;
    SFRA1.GH_MagVect=OL_MagVect;
    SFRA1.GH_PhaseVect=OL_PhaseVect;
    SFRA1.H_MagVect=Plant_MagVect;
    SFRA1.H_PhaseVect=Plant_PhaseVect;
    initializationFlag = 0;
    /**** TEST: Attempt to cause initialization of SFRA_IQ before sweep ****/
    SFRA_IQ_INIT(&SFRA1);
5. Using the module
if(CloseIloopInv==1)
    {
        cntlPI_BusInv.Ref   =Bus_Volt_notch.Out;
        cntlPI_BusInv.Fbk   =inv_bus_ref;
        CNTL_PI_IQ_MACRO(cntlPI_BusInv)
        inv_Iset=cntlPI_BusInv.Out;
        inv_ref_cur_inst = _IQ24mpy(inv_Iset, InvSine);
        cntl3p3z_InvI_vars.Ref=SFRA_IQ_INJECT(inv_ref_cur_inst);
        cntl3p3z_InvI_vars.Fdbk=inv_meas_cur_inst;
        CNTL_3P3Z_IQ_ASM(&cntl3p3z_InvI_coeff,&cntl3p3z_InvI_vars);
        duty_inv_pu=_IQ24div((cntl3p3z_InvI_vars.Out+inv_meas_vol_inst),vbus_meas_inst);
        duty_inv_pu= (duty_inv_pu>_IQ24(1.0))?_IQ24(1.0):duty_inv_pu;
        duty_inv_pu= (duty_inv_pu<_IQ24(-1.0))?_IQ24(-1.0):duty_inv_pu;
        SFRA_IQ_COLLECT(&cntl3p3z_InvI_vars.Out,&cntl3p3z_InvI_vars.Fdbk);
    }
#endif // (INCR_BUILD == 3)
6.Background Task: Call the background function in a slow task: 
void A1(void)
//--------------------------------------------------------
{
    if(PVInverterState_Old!=PVInverterState)
    {
        switch(PVInverterState)
        {
        case Idle:  strcpy(cPV_State,"Idle");
                break;
        case CheckGrid: strcpy(cPV_State,"CheckGrid");
                    break;
        case CheckPV:   strcpy(cPV_State,"CheckPV");
                    break;
        case MonitorDCBus:  strcpy(cPV_State,"MonitorDCBus");
                    break;
        case EnableMPPT:    strcpy(cPV_State,"EnableMPPT");
                    break;
        case PVInverterActive:  strcpy(cPV_State,"PVInverterActive");
                    break;
        case ResetState1:   strcpy(cPV_State,"ResetState1");
                    break;
        case ResetState2:   strcpy(cPV_State,"ResetState2");
                    break;
        case FaultState:if(FaultFlag==OverVoltageDCBus)
                            strcpy(cPV_State,"FaultState: DC Bus Over Voltage");
                        else if (FaultFlag==UnderVoltageDCBus)
                            strcpy(cPV_State,"FaultState: DC Bus Under Voltage");
                        else if (FaultFlag==OverVoltageGrid)
                            strcpy(cPV_State,"FaultState: Over Voltage Grid");
                        else if (FaultFlag==UnderVoltageGrid)
                            strcpy(cPV_State,"FaultState: Under Voltage Grid");
                        else if (FaultFlag==OverCurrentFlag)
                            strcpy(cPV_State,"FaultState: Grid Current Over");
                        else
                            strcpy(cPV_State,"FaultState");
                    break;
        }
    }
    PVInverterState_Old=PVInverterState;
    if(PVInverterState==Idle)
        Gui_GridFreq=ACFreq<<16;
    else
        Gui_GridFreq=(long)(spll2.fo)>>3;
    SFRA_IQ_BACKGROUND(&SFRA1);
    //-------------------
    //the next time CpuTimer0 'counter' reaches Period value go to A2
    A_Task_Ptr = &A2;
    //-------------------
}
7.Linker Command File Changes (*.CMD):
 PAGE 0 :
    RAML3     : origin = 0x009000, length = 0x001000     /* RAM (L3) */
>>
    RAML3     : origin = 0x008000, length = 0x002000     /* RAM (L0-L3) */
-----------------------------------------------------------------------------
 PAGE 1:
ADD dataRAM1 : origin = 0x009000, length = 0x001000    /* on-chip RAM block L3 */
-----------------------------------------------------------------------------
SECTION:
{
    ..
    ramfuncs          : LOAD = FLASHD, 
                       RUN = RAML3,
                       LOAD_START(_RamfuncsLoadStart),
                       LOAD_END(_RamfuncsLoadEnd),
                       RUN_START(_RamfuncsRunStart),
                       PAGE = 0
   {
    --library=Solar_Lib_IQ.lib<CNTL_2P2Z_IQ_ASM.obj>
    --library=Solar_Lib_IQ.lib<CNTL_3P3Z_IQ_ASM.obj>
    --library=IQmath.lib<IQ24div.obj>
    --library=IQmath.lib<IQ23sin.obj>
    --library=IQmath.lib<IQ23cos.obj>
    --library=IQmath.lib<IQ15rsmpy.obj>
    --library=IQmath.lib<IQ15rmpy.obj>
    --library=IQmath.lib<IQ15div.obj>
    --library=IQmath.lib<IQ4div.obj>
    --library=IQmath.lib<IQ15sqrt.obj>
    --library=IQmath.lib<IQ15isqrt.obj>
   }
}
 ADD SFRA library
ramfuncs          : LOAD = FLASHD, 
                       RUN = RAML3,
                       LOAD_START(_RamfuncsLoadStart),
                       LOAD_END(_RamfuncsLoadEnd),
                       RUN_START(_RamfuncsRunStart),
                       PAGE = 0
   {
    --library=Solar_Lib_IQ.lib<CNTL_2P2Z_IQ_ASM.obj>
    --library=Solar_Lib_IQ.lib<CNTL_3P3Z_IQ_ASM.obj>
    --library=Solar_Lib_IQ.lib<NOTCH_FLTR_IQ_ASM.obj>
    --library=SFRA_IQ_Lib.lib<SFRA_IQ_INJECT.obj>
    --library=SFRA_IQ_Lib.lib<SFRA_IQ_COLLECT.obj>
    --library=SFRA_IQ_Lib.lib<SFRA_IQ_BACKGROUND.obj>
    --library=IQmath.lib<IQ24div.obj>
    --library=IQmath.lib<IQ23sin.obj>
    --library=IQmath.lib<IQ23cos.obj>
    --library=IQmath.lib<IQ15rsmpy.obj>
    --library=IQmath.lib<IQ15rmpy.obj>
    --library=IQmath.lib<IQ15div.obj>
    --library=IQmath.lib<IQ4div.obj>
    --library=IQmath.lib<IQ15sqrt.obj>
    --library=IQmath.lib<IQ15isqrt.obj>
   }
-------------------------------------------------------------------
/* ADD */
... 
dataRAM : > dataRAM1, PAGE = 1
SFRA_IQ_Data : > dataRAM1, PAGE = 1
-------------------------------------------------------------------
/* ADD */
...
SFRA_Data : > dataRAM1, ALIGN = 64, PAGE=1
cntl_coeff_RAM : > dataRAM, PAGE=1
cntl_var_RAM : > RAMM1, PAGE =1
------------------------------------------------------------------
Thank you for all suggestion.