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.

Error on compilation

Other Parts Discussed in Thread: TMS320F2812

I'm getting a error saying expected a field name in my code.

ECanaMboxes.MBOX1.MDH.word.HI_WORD = Page1.root2Ws;   

  • Anuj,

    You are not providing enough information here for someone to help.  How is Page1.root2Ws defined?  What is the exact error message?

    Regards,

    David


  • #include "reg2812.h"
    #include "userVar.h"
    #include "userConst.h"
    #include "macro.h"

        extern void delay(void);
        extern void System_Control_Loop(void);
        struct ECAN_REGS ECanaShadow;

        #pragma CODE_SECTION(canComm,".text");
        void canComm(void);
        
        #pragma CODE_SECTION(receive_data,".text");
        void receive_data(void);
     
        #pragma CODE_SECTION(syncronization,".text");
        void syncronization(void);

        #pragma CODE_SECTION(transmit_parameters,".text");
        void transmit_parameters(void);
            
        #pragma CODE_SECTION(decodeFrames,".text");
        void decodeFrames(void);
        
           #pragma CODE_SECTION(encodeFrames,".text");
        void encodeFrames(void);    
        
        #pragma CODE_SECTION(boostup,".text");
        void boostup(void);

        #pragma CODE_SECTION(trans_para,".text");
         void trans_para();
        
        #pragma CODE_SECTION(receive,".text");
        void receive(void);
        
        #pragma CODE_SECTION(transmit,".text");
        void transmit(void);
        
        



    void canComm(void)
    {
        
        EALLOW;

       syncronization();
       
        encodeFrames();
       
      transmit_parameters();
       
         receive_data();
     
         decodeFrames();
     }

    void syncronization()
    {
    receive();
    transmit();
    }


    void receive()
    {
    if (ECanaRegs.CANRMP.bit.RMP27==1)
    {
    ledAddress=0xffff;
    }
    }

    void transmit()
    {
             ECanaMboxes.MBOX14.MDL.all = 0xa0a0;
         ECanaMboxes.MBOX14.MDH.all = 0x0000;
         ECanaShadow.CANTRS.all = 0;
          ECanaShadow.CANTRS.bit.TRS14= 1;
        ECanaRegs.CANTRS.all = ECanaShadow.CANTRS.all;
           if (ECanaRegs.CANTA.bit.TA14==1)
        {
             ledAddress=0x0000;
        }
           }

    void encodeFrames(void)
    {  
    /* Write to the mailbox RAM field (original message) of MBOX0 -5 */
        
            ECanaMboxes.MBOX0.MDL.word.LOW_WORD = Page1.factorIl;
         ECanaMboxes.MBOX0.MDL.word.HI_WORD = Page1.factorIm;
         ECanaMboxes.MBOX0.MDH.word.LOW_WORD = Page1.factorVg;
             ECanaMboxes.MBOX0.MDH.word.HI_WORD = Page1.factorVdc;    

             ECanaMboxes.MBOX1.MDL.word.LOW_WORD = Page1.KpI;
         ECanaMboxes.MBOX1.MDL.word.HI_WORD = Page2.KpVdc;
         ECanaMboxes.MBOX1.MDH.word.LOW_WORD = Page1.WsLs;
         ECanaMboxes.MBOX1.MDH.word.HI_WORD = Page1.root2Ws;    
     
         ECanaMboxes.MBOX2.MDL.word.LOW_WORD = Page1.fluxFactor;
         ECanaMboxes.MBOX2.MDL.word.HI_WORD = Page1.fluxFeed;
         ECanaMboxes.MBOX2.MDH.word.LOW_WORD = Page6.VgConv;
             ECanaMboxes.MBOX2.MDH.word.HI_WORD = Page2.TsByLs;
        
         ECanaMboxes.MBOX3.MDL.word.LOW_WORD = Page6.check;
         ECanaMboxes.MBOX3.MDL.word.HI_WORD = Page6.updateconfig;
        
              ECanaMboxes.MBOX4.MDL.nib.nib1=Page6.configuration;
              ECanaMboxes.MBOX4.MDL.nib.nib2=Page6.derating;
              ECanaMboxes.MBOX4.MDL.nib.nib3=Page6.harmonic;
              ECanaMboxes.MBOX4.MDL.nib.nib4=Page6.balancing;
              ECanaMboxes.MBOX4.MDL.nib.nib5=Page6.neutral;
              ECanaMboxes.MBOX4.MDL.nib.nib6=Page6.reactive;
              ECanaMboxes.MBOX4.MDL.nib.nib7=Page6.targetpf;
              ECanaMboxes.MBOX4.MDL.nib.nib8=Page6.loadsidect;
              ECanaMboxes.MBOX4.MDH.word.LOW_WORD = Page6.dac1;
              ECanaMboxes.MBOX4.MDH.word.LOW_WORD = Page6.dac2;
              ECanaMboxes.MBOX4.MDH.word.HI_WORD =  Page6.harmonicorder;
              ECanaMboxes.MBOX5.MDL.nib.nib1 = Page6.control;
        }

    void transmit_parameters()
    {
     if(ECanaRegs.CANRMP.bit.RMP26==1)
    {
     Page6.transVar=ECanaMboxes.MBOX26.MDL.all;
    }
     trans_para(Page6.transVar);
    }

    void trans_para()
    {
    if(Page6.transVar1==0x1000)
    {
          ECanaShadow.CANTRS.all = 0;
          ECanaShadow.CANTRS.bit.TRS0= 1;
          ECanaRegs.CANTRS.all = ECanaShadow.CANTRS.all;
    }
    else
    {
    if(Page6.transVar1==0x2000)
    {
          ECanaShadow.CANTRS.all = 0;
          ECanaShadow.CANTRS.bit.TRS1= 1;
          ECanaRegs.CANTRS.all = ECanaShadow.CANTRS.all;
    }
    else
    {
    if(Page6.transVar1==0x3000)
    {
          ECanaShadow.CANTRS.all = 0;
          ECanaShadow.CANTRS.bit.TRS2= 1;
          ECanaRegs.CANTRS.all = ECanaShadow.CANTRS.all;
    }
    else
    {
    if(Page6.transVar1==0x4000)
    {
          ECanaShadow.CANTRS.all = 0;
          ECanaShadow.CANTRS.bit.TRS3= 1;
          ECanaRegs.CANTRS.all = ECanaShadow.CANTRS.all;
    }

    else
    {
    if(Page6.transVar1==0x5000)
    {
          ECanaShadow.CANTRS.all = 0;
          ECanaShadow.CANTRS.bit.TRS4= 1;
          ECanaRegs.CANTRS.all = ECanaShadow.CANTRS.all;
    }
    else
    {
    if(Page6.transVar1==0x6000)
    {
          ECanaShadow.CANTRS.all = 0;
          ECanaShadow.CANTRS.bit.TRS5= 1;
          ECanaRegs.CANTRS.all = ECanaShadow.CANTRS.all;
    }
    }
    }
    }
    }
    }
    }

    void receive_data(void)
    {
    if(ECanaRegs.CANRMP.bit.RMP19==1)
    {
    ledAddress=0x0000;
    }
    else
    {
    if(ECanaRegs.CANRMP.bit.RMP20==1)
    {
    ledAddress=0x0001;
    }
    else
    {
    if(ECanaRegs.CANRMP.bit.RMP21==1)
    {
    ledAddress=0x0010;
    }
    else
    {  
    if(ECanaRegs.CANRMP.bit.RMP22==1)
    {
    ledAddress=0x0100;
    }
    else
    {  
    if(ECanaRegs.CANRMP.bit.RMP23==1)
    {
    ledAddress=0x1000;
    }
    else
    {  
    if(ECanaRegs.CANRMP.bit.RMP24==1)
    {
    ledAddress=0x1001;
    }
    }
    }
    }
    }
    }
    }

    void decodeFrames(void)
    {
    /* deframe the receiving mailboxes into different variables alraedy declared*/
        Page1.Vg1          = ECanaMboxes.MBOX19.MDL.word.LOW_WORD;
    if(Page1.Vg1==0x0016)
    {
    ledAddress=0x002A;
    }
    else
    {
    ledAddress=0x00fe;
    }
        Page1.Vg2           = ECanaMboxes.MBOX19.MDL.word.HI_WORD;

    if(Page1.Vg2==0x0017)
    {
    ledAddress=0x0032;
    }
    else
    {
    ledAddress=0x00fe;
    }
        Page1.Vg3           = ECanaMboxes.MBOX19.MDH.word.LOW_WORD;

    if(Page1.Vg3==0x0018)
    {
    ledAddress=0x003a;
    }
    else
    {
    ledAddress=0x00fe;
    }

        Page6.Vfg1          = ECanaMboxes.MBOX20.MDL.word.LOW_WORD;

    if(Page6.Vfg1==0x0019)
    {
    ledAddress=0x0043;
    }
    else
    {
    ledAddress=0x00fe;
    }
        Page6.Vfg2          = ECanaMboxes.MBOX20.MDL.word.HI_WORD;

    if(Page6.Vfg2==0x001a)
    {
    ledAddress=0x004b;
    }
    else
    {
    ledAddress=0x00fe;
    }

        Page6.Vfg3              = ECanaMboxes.MBOX20.MDH.word.LOW_WORD ;

    if(Page6.Vfg3==0x001b)
    {
    ledAddress=0x0053;
    }
    else
    {
    ledAddress=0x00fe;
    }

        Page1.Ig1               = ECanaMboxes.MBOX21.MDL.word.LOW_WORD;

    if(Page1.Ig1==0x001c)
    {
    ledAddress=0x005c;
    }
    else
    {
    ledAddress=0x00fe;
    }

        Page1.Ig2             = ECanaMboxes.MBOX21.MDL.word.HI_WORD;

    if(Page1.Ig2==0x0001d)
    {
    ledAddress=0x0064;
    }
    else
    {
    ledAddress=0x00fe;
    }

        Page1.Ig3       = ECanaMboxes.MBOX21.MDH.word.LOW_WORD;

    if(Page1.Ig3==0x001e)
    {
    ledAddress=0x006c;
    }
    else
    {
    ledAddress=0x00fe;
    }
     
       Page1.Ign           = ECanaMboxes.MBOX21.MDH.word.HI_WORD;

    if(Page1.Ign==0x001f)
    {
    ledAddress=0x0074;
    }
    else
    {
    ledAddress=0x00fe;
    }
        Page6.Ilf1             = ECanaMboxes.MBOX22.MDL.word.LOW_WORD;

    if(Page6.Ilf1==0x0020)
    {
    ledAddress=0x007D;
    }
    else
    {
    ledAddress=0x00fe;
    }
        Page6.Ilf2             = ECanaMboxes.MBOX22.MDL.word.HI_WORD;

    if(Page6.Ilf2==0x0021)
    {
    ledAddress=0x0085;
    }
    else
    {
    ledAddress=0x00fe;
    }
        
        Page6.Ilf3      = ECanaMboxes.MBOX22.MDH.word.LOW_WORD;

    if(Page6.Ilf3==0x0022)
    {
    ledAddress=0x008D;
    }
    else
    {
    ledAddress=0x00fe;
    }
        Page6.Vdc          = ECanaMboxes.MBOX23.MDL.word.LOW_WORD;

    if(Page6.Vdc==0x0023)
    {
    ledAddress=0x0096;
    }
    else
    {
    ledAddress=0x00fe;
    }
            Page2.Temperature           = ECanaMboxes.MBOX24.MDL.word.HI_WORD;
        

    if(Page2.Temperature==0x0024)
    {
    ledAddress=0x009e;
    }
    else
    {
    ledAddress=0x00fe;
    }    
        Page6.ImMax         = ECanaMboxes.MBOX24.MDH.word.LOW_WORD;
        
     if(Page6.ImMax==0x0025)
    {
    ledAddress=0x00A6;
    }
    else
    {
    ledAddress=0x00fe;
    }    
    }

    the one with red background is showing error and this variable is declared as follows:

    //******************************************************************************
    // FILE NAME         : userVar.h
    // DATE                : 10.05.2012
    // PROJECT            : STACK testing
    // PROJECT CODE        : APC
    // AUTHORS            : Arnab
    // DESCRIPTION        : Header file for user variables
    // CONTROLLER CARD    : (DIGITAL CONTROLLER)
    //******************************************************************************
    // STACK area for TMS320F2812 is defined from 0x000400h to 0x000450h
    // ---------------------------------------------------------------------------------------------------------------------------------
    //     Define signed int as int16 and Define signed long as int32
    // ---------------------------------------------------------------------------------------------------------------------------------
    typedef    int    int16;
    typedef    long    int32;

    // ---------------------------------------------------------------------------------------------------------------------------------
    //     The structures defined externally (initi.c) is given here
    // ---------------------------------------------------------------------------------------------------------------------------------
    extern     volatile struct USER_VARIABLE_PAGE1 Page1;
    extern     volatile struct USER_VARIABLE_PAGE2 Page2;
    extern     volatile struct USER_VARIABLE_PAGE3 Page3;
    extern     volatile struct USER_VARIABLE_PAGE4 Page4;
    extern     volatile struct USER_VARIABLE_PAGE5 Page5;
    extern     volatile struct USER_VARIABLE_PAGE6 Page6;

    // ---------------------------------------------------------------------------------------------------------------------------------
    //     define general variables in page 1 (Kept at 00 0100h to 00 013fh locations)
    // ---------------------------------------------------------------------------------------------------------------------------------
    struct USER_VARIABLE_PAGE1
        {
    // ---------------------------------------------------------------------------------------------------------------------------------
    //    Page1 Temporary variables
    // ---------------------------------------------------------------------------------------------------------------------------------
            int16    pg1temp1;                  //100h
            int16    pg1temp2;               //101h
    // ---------------------------------------------------------------------------------------------------------------------------------
    //     Address of the flag used
    // ---------------------------------------------------------------------------------------------------------------------------------
            int16    intFlag;                   //102h
            int16    startFlag;                 //103h
            int16    softwareFault;             //104h
            int16    falseStart;                //105h
            int16    dcVoltageBuildup;          //106h   
            int16    preChargeOver;             //107h
            int16    hardwareFault;             //108h
            int16    contFlag;                   //109h
    // ---------------------------------------------------------------------------------------------------------------------------------
    //     Address of the flag used
    // ---------------------------------------------------------------------------------------------------------------------------------
            int16    factorVdc;                //10Ah
            int16    factorVg;                //10Bh
            int16    factorIl;                //10Ch
            int16    factorIm;                //10Dh
            int16    factorTemp;                //10Eh

            int16    Vg1;                    //10Fh
            int16    Vg2;                    //110h
            int16    Vg3;                    //111h
            
            int16    Vgalpha;                //112h
            int16    Vgbeta;                    //113h

            int16    Imr;                    //114h
            int16    Imy;                    //115h
            int16    Imb;                    //116h
            int16    Imn;                    //117h
            
            int16    Imalpha;                //118h
            int16    Imbeta;                    //119h

            int16    Imd;                    //11Ah
            int16    Imq;                    //11Bh
                            
            int16    Ig1;                    //11Ch                               
            int16    Ig2;                    //11Dh      
            int16    Ig3;                    //11Eh
            int16    Ign;                    //11Fh
            int16    Igrid;                    //120h
            
            int16    Ilalpha;                //121h
            int16    Ilbeta;                 //122h

            int16    Ild;                    //123h
            int16    Ilq;                    //124h
                
            int16    fluxFeed;                //125h
            int16    fluxFactor;                //126h

            int16    alphaFg;                //127h
            int16    betaFg;                    //128h

            int16    IlqFilter_;                //129h
                           
            int16    unbalanceFactor;        //12Ah
            int16    reactiveFactor;         //12Bh
            int16    harmonicsFactor;        //12Ch
            int16    neutralFactor;            //12Dh
            
            int16    root2Ws;                //12Eh
            int16    WsLs;                    //12Fh
    // ---------------------------------------------------------------------------------------------------------------------------------
    //     Address of the flag used
    // ---------------------------------------------------------------------------------------------------------------------------------
            int16    WeRef;                    //130h
            int16    Vm;                        //131h
            int16    row;                    //132h
            int16    speedStep;                //133h
            int16     cosRow;                    //134h
            int16    sinRow;                    //135h
            int16    deltaT;                    //136h
    // ---------------------------------------------------------------------------------------------------------------------------------
            int16    ImdRef;                    //137h
            int16    ImdRef_;                //138h

            int16    Imd0Error;                //139h
            int16    Imd1Error;                //13Ah
            
            int16    KpI;                    //13Bh                    
            
            int16    ImqRef;                    //13Ch
            
            int16    Imq0Error;                //13Dh
            int16    Imq1Error;                //13Eh
            
            int16    VinvdRef;               //13Fh                
        };

                    
    //--------------------------------------------------------------------------------
    // define general variables in page 2(kept at 0140h to 017fh)
    //--------------------------------------------------------------------------------
    struct USER_VARIABLE_PAGE2
        {
            int16    pg2temp1;                  //140h
            
            int16    piImd;                   //141h
                        
            int16    VinvqRef;               //142h
            int16    piImq;                   //143h

            int16    VinvalphaRef;           //144h
            int16    VinvbetaRef;            //145h
            
            int16    Temperature;            //146h
    // ---------------------------------------------------------------------------------------------------------------------------------
    //     Address of the flag used
    // ---------------------------------------------------------------------------------------------------------------------------------
            int16    VrRef;                   //147h
            int16    VyRef;                   //148h
            int16    VbRef;                   //149h
            int16    Vcomm;                   //14Ah
            
            int16    VrRef_;                   //14Bh
            int16    VyRef_;                   //14Ch
            int16    VbRef_;                   //14Dh
            int16    VnRef_;                   //14Eh
    // ---------------------------------------------------------------------------------------------------------------------------------
    //     Address of the flag used
    // ---------------------------------------------------------------------------------------------------------------------------------
            int16    Vdc;                       //14Fh        

            int16    VdcRef;                   //150h
            int16    VdcRefLo;               //151h
            
            int16    Vdc0Error;              //152h
            int16    Vdc1Error;              //153h
            
            int16    KpVdc;                  //154h

    // ---------------------------------------------------------------------------------------------------------------------------------
    //     Address of the flag used
    // ---------------------------------------------------------------------------------------------------------------------------------
            int16    IldRef;                  //155h
            int16    IlqRef;                  //156h
            
            int16    Iharmonics_d;           //157h
            int16    Iharmonics_q;           //158h
            
            int16    TsByLs;                  //159h
        
            int16    cos45;                  //15Ah
            int16    sin45;                  //15Bh                

            int16    sinRow_;                  //15Bh
            int16    sinRowOld;              //15Ch

            int16    cosRow_;                  //15Dh
            int16    cosRowOld;              //15Eh
            
    // ---------------------------------------------------------------------------------------------------------------------------------
    //     Address of the flag used
    // ---------------------------------------------------------------------------------------------------------------------------------
            int16    Ws;                      //15Fh
            int16    WsConstant;             //161h
            int16    deltaV;                  //162h

    // ---------------------------------------------------------------------------------------------------------------------------------
    //     Address of the flag used
    // ---------------------------------------------------------------------------------------------------------------------------------
            int16    ImdEstimate;            //163h
            int16    ImqEstimate;            //164h
            int16    FF_d;                      //165h
            int16    FF_q;                      //166h

    // ---------------------------------------------------------------------------------------------------------------------------------
    //     Address of the flag used
    // ---------------------------------------------------------------------------------------------------------------------------------
            int16    Ild_High;                  //167h
            int16    Ilq_High;                  //168h

            int16    Ild2_alpha;             //169h
            int16    Ilq2_beta;                 //16Ah

            int16    cos2Row;                  //16Bh
            int16    sin2Row;                  //16Ch

            int16    cos4Row;                  //16Dh
            int16    sin4Row;                  //16Eh
    // ---------------------------------------------------------------------------------------------------------------------------------
            int16    cosBRow;                  //16Fh
            int16    sinBRow;                 //170h

            int16    IldB;                     //171h
            int16    IlqB;                     //172h

            int16    IldB_Ref;                 //173h
            int16    IlqB_Ref;                 //174h

            int16    factorB;                 //175h
    // ---------------------------------------------------------------------------------------------------------------------------------
            int16    cos6Row;                 //176h
            int16    sin6Row;                 //177h

            int16    Ild5;                     //178h
            int16    Ilq5;                     //179h        
            
            int16    Ild5_Ref;                 //17Ah
            int16    Ilq5_Ref;                 //17Bh
            int16    factor5;                 //17Ch

            int16    Ild7;                     //17Dh        
            int16    Ilq7;                     //17Eh
            
            int16    prechargeLevel;         //17Fh                
        };
                
            
    //-----------------------------------------------------------------------------
    // define general variables in page 3 (Kept at 0180h to 01BFh locations)
    //-----------------------------------------------------------------------------
    struct USER_VARIABLE_PAGE3
        {
            int16    pg3temp1;                  //180h
            int16    pg3temp2;               //181h
            int32    pg3temp3;               //182-3h

            int16    Ild7_Ref;                //184h
            int16    Ilq7_Ref;                //185h
            
            int16    factor7;                //186h
            
    // ---------------------------------------------------------------------------------------------------------------------------------
    //
    // ---------------------------------------------------------------------------------------------------------------------------------
            int16    cos12Row;                //187h
            int16    sin12Row;                //188h

            int16    Ild11;                    //189h
            int16    Ilq11;                    //18Ah

            int16    Ild11_Ref;                //18Bh
            int16    Ilq11_Ref;                //18Ch
            
            int16    factor11;                //18Dh
            
            int16    Ild13;                    //18Eh
            int16    Ilq13;                    //18Fh

            int16    Ild13_Ref;                //190h
            int16    Ilq13_Ref;                //191h
            
            int16    factor13;                //192h
            
    // ---------------------------------------------------------------------------------------------------------------------------------
    //
    // ---------------------------------------------------------------------------------------------------------------------------------
            int16    cos18Row;                //193h
            int16    sin18Row;                //194h

            int16    factor17;                //195h

            int16    Ild17;                    //196h
            int16    Ilq17;                    //197h

            int16    Ild17_Ref;                //198h
            int16    Ilq17_Ref;                //199h
            
            int16    factor19;                //19Ah
            
            int16    Ild19;                    //19Bh
            int16    Ilq19;                    //19Ch

            int16    Ild19_Ref;                //19Dh
            int16    Ilq19_Ref;                //19Eh
            
    // ---------------------------------------------------------------------------------------------------------------------------------
    //
    // ---------------------------------------------------------------------------------------------------------------------------------
            int16    cos24Row;                //19Fh
            int16    sin24Row;                //1A0h

            int16    factor23;                //1A1h

            int16    Ild23;                    //1A2h
            int16    Ilq23;                    //1A3h

            int16    Ild23_Ref;                //1A4h
            int16    Ilq23_Ref;                //1A5h
            
            int16    factor25;                //1A6h
            
            int16    Ild25;                    //1A7h
            int16    Ilq25;                    //1A8h

            int16    Ild25_Ref;                //1A9h
            int16    Ilq25_Ref;                //1AAh
            
    // ---------------------------------------------------------------------------------------------------------------------------------
    //
    // ---------------------------------------------------------------------------------------------------------------------------------
            int16    cos30Row;                //1ABh
            int16    sin30Row;                //1ACh

            int16    factor29;                //1ADh

            int16    Ild29;                    //1AEh
            int16    Ilq29;                    //1AFh

            int16    Ild29_Ref;                //1B0h
            int16    Ilq29_Ref;                //1B1h
            
            int16    factor31;                //1B2h
            
            int16    Ild31;                    //1B3h
            int16    Ilq31;                    //1B4h

            int16    Ild31_Ref;                //1B5h
            int16    Ilq31_Ref;                //1B6h

    // ---------------------------------------------------------------------------------------------------------------------------------
    //
    // ---------------------------------------------------------------------------------------------------------------------------------
            int16    cos36Row;                //1B7h
            int16    sin36Row;                //1B8h

            int16    factor35;                //1B9h

            int16    Ild35;                    //1BAh
            int16    Ilq35;                    //1BBh

            int16    Ild35_Ref;                //1BCh
            int16    Ilq35_Ref;                //1BDh
            };    
    //-----------------------------------------------------------------------------
    // define general variables in page 4 (Kept at 01C0h to 01FFh locations)
    //-----------------------------------------------------------------------------
    struct USER_VARIABLE_PAGE4
        {
            int32    pg4temp1;                  //1C0-1h
            int32    pg4temp2;               //1C2-3h
            int32    pg4temp3;               //1C4-5h
                
            int16    factor37;                //1C6h
            int16    Ild37;                    //1C7h
            int16    Ilq37;                    //1C8h

            int16    Ild37_Ref;                //1C9h
            int16    Ilq37_Ref;                //1CAh

    // ---------------------------------------------------------------------------------------------------------------------------------
    //
    // ---------------------------------------------------------------------------------------------------------------------------------
            int16    cos42Row;                //1CBh
            int16    sin42Row;                //1CCh

            int16    factor41;                //1CDh

            int16    Ild41;                    //1CEh
            int16    Ilq41;                    //1CFh

            int16    Ild41_Ref;                //1D0h
            int16    Ilq41_Ref;                //1D1h
            
            int16    factor43;                //1D2h
            
            int16    Ild43;                    //1D3h
            int16    Ilq43;                    //1D4h

            int16    Ild43_Ref;                //1D5h
            int16    Ilq43_Ref;                //1D6h

            int16    Ild_final;                //1D7h
            int16    Ilq_final;                //1D8h
    // ---------------------------------------------------------------------------------------------------------------------------------
    //
    // ---------------------------------------------------------------------------------------------------------------------------------
    // Two byte variables of page 5 is defined here
    // ---------------------------------------------------------------------------------------------------------------------------------
            int32    compensationFactor1;    //1D9-Ah
            int32    compensationFactor2;    //1DB-Ch
            int32    compensationFactor3;    //1DD-Eh
            int32    compensationFactor4;    //1DF-0h
            
            int32    VgrFilter;                //1E0-1h
            int32    VgyFilter;                //1E2-3h
            int32    VgbFilter;                //1E4-5h
            int32    VdcFilter;                //1E6-7h
                    
            int32    rowHiLo;                //1E8-9h
            int32    WeRefHiLo;                //1EA-Bh
            int32    Fgalpha;                //1EC-Dh
            int32    Fgbeta;                    //1EE-Fh
            
            int32    I_VdcHi;                //1F0-1h
            
            int32    I_Imd;                    //1F2-3h
            int32    I_Imq;                    //1F4-5h

            int32    IldFilter;                //1FE-Fh
        };

    //-----------------------------------------------------------------------------
    // define general variables in page 5 (Kept at 0200h to 023Fh locations)
    //-----------------------------------------------------------------------------
    struct USER_VARIABLE_PAGE5
        {
            int32    pg5temp1;                  //200-1h
            int32    pg5temp2;               //202-3h
            int32    pg5temp3;               //204-5h

            int32    IlqFilter;              //206-7h

            int32    IldB_Filter;            //208-9h
            int32    IlqB_Filter;            //20A-Bh
            
            int32    Ild5_Filter;            //20C-Dh
            int32    Ilq5_Filter;            //20E-Fh
            
            int32    Ild7_Filter;            //210-1h
            int32    Ilq7_Filter;            //212-3h

            int32    Ild11_Filter;           //214-5h
            int32    Ilq11_Filter;           //216-7h
            
            int32    Ild13_Filter;           //218-9h
            int32    Ilq13_Filter;           //21A-Bh
        
            int32    Ild17_Filter;           //21C-Dh
            int32    Ilq17_Filter;           //21E-Fh
            
            int32    Ild19_Filter;           //220-1h
            int32    Ilq19_Filter;           //222-3h

            int32    Ild23_Filter;           //224-5h
            int32    Ilq23_Filter;           //226-7h
            
            int32    Ild25_Filter;           //228-9h
            int32    Ilq25_Filter;           //22A-Bh

            int32    Ild29_Filter;           //22C-Dh
            int32    Ilq29_Filter;           //22E-Fh
            
            int32    Ild31_Filter;           //230-1h
            int32    Ilq31_Filter;           //232-3h

            int32    Ild35_Filter;           //234-5h
            int32    Ilq35_Filter;           //236-7h
            
            int32    Ild37_Filter;           //238-9h
            int32    Ilq37_Filter;           //23A-Bh

            int32    Ild41_Filter;           //23C-Dh
            int32    Ilq41_Filter;           //23E-Fh
        };

    //-----------------------------------------------------------------------------
    // define general variables in page 6 (Kept at 0240h to 027Fh locations)
    //-----------------------------------------------------------------------------
    struct USER_VARIABLE_PAGE6
        {
            int32    Ild43_Filter;           //240-1h
            int32    Ilq43_Filter;           //242-3h
            int32    WsFilter;                  //244-5h
            int16   mainFlag;
            int16   transVar;
            int16   transVar1;
            int16   temp;
            int16   temp1;
            int16   temp2;
            int16   temp3;
            int16   mb10_ack;
            int16   control;
            int16   VgConv;
            int16   configuration;
            int16   derating;
            int16   harmonic;
            int16   balancing;
            int16   neutral;
            int16   reactive;
            int16   targetpf;
            int16   loadsidect;
            int16   dac1;
            int16   dac2;
            int16   harmonicorder;
            int16   Vgpu;
            int16   Vfg3;
            int16   Vfg2;
            int16   Vfg1;
            int16   Vdcpu;
            int16   Tpu;
            int16   status;
            int16   Impu;
            int16   Ilpu;
            int16   Ilf3;
            int16   check;
            int16   updateconfig;
            int16   ImMax;
            int16   Vdc;
            int16   Ilf1;
            int16   Ilf2;
            
            
        };
        
    //----------------------------------------------------------------------------

  • Hi Anuj,

    Thank you for your code, from what you've shared with us I can tell you're on the TMS320F2812 but beyond that I'm having issues identifying where to search for your problem. If you remove the line where you change ECanaMboxes.MBOX1.MDH.word.HI_WORD do you still get the same compiler error? Then secondly do you still get a compiler error if you write a static value or a value you know is accessible to MDH?

    In the future could you share large chunks of code in attachments? It makes it easier for us to parse the actual issue without having to do so much searching up and down.

    Additionally I would like to bring to your attention this errata: (link) There are two known issues with CAN related to register contention and sequential read fails.

    Thanks,
     Louis 

  • yes i'm getting more errors if i remove the line the errors are as follows:


    "../cdInFlash.cmd", line 66: warning: no matching section
    "../register.cmd", line 50: warning: memory range not found: CPU_TIMER1 on page
       1
    "../register.cmd", line 50: error: run placement fails for object
       "CpuTimer1RegsFile", size 0x0 (page 1)
    "../register.cmd", line 51: warning: memory range not found: CPU_TIMER2 on page

       1
    >> Compilation failure
    "../register.cmd", line 51: error: run placement fails for object
       "CpuTimer2RegsFile", size 0x0 (page 1)

     undefined    first referenced
      symbol          in file     
     ---------    ----------------
     _ECanaMboxes ./main.obj      
     _ECanaRegs   ./main.obj      

    error: unresolved symbols remain
    error: errors encountered during linking; "2812_inv.out" not built
    gmake: *** [2812_inv.out] Error 1
    gmake: Target `all' not remade because of errors.

  • Anuj,

    It is very unclear what error you were getting originally from what you are posting.  You're saying if you comment out the 'red' line that causes the error message, you get even more error messages?  Did your project ever build correctly?  I mean, how did you get to the point you are at?  If the code built correctly before you made some changes, go back to the version that built correctly and then slowly make the changes until you get an error.  That will identify what the problem is.  If your code never built correctly, then you have something fundamentally setup wrong in your project.  The linker errors you show in your last post suggest to me that you have not put the DSP281x peripheral registers linker command file in your project.

    I took the CAN register write code and tested in my own project.  It builds no problem.  See attached file foo.c.

    Regards,

    David