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.

TMS320F28035: Meaning of compiler error: "error: expected a field name"?

Part Number: TMS320F28035

I'm receiving a compiler error:

"../RampCompareToInputV.c", line 376: error: expected a field name
EPwm1Regs.TBCTL.bit.CLKDIV = clkdiv;
                                       ^

Code snippet:

Uint16 InitEPwmx(Uint8 x, Uint16 clkdiv, Uint16 hspclkdiv, Uint16 tbprd, Uint8 mux_outa, Uint8 mux_outb){

    EALLOW;
    EPwm1Regs.TBCTL.bit.CLKDIV = clkdiv;

    EDIS;

}

  • Hi,

    Have you included the globalvariabledefs.c and the headers/include folder in the CCS project?

    These structs and its fields are defined in device_Epwm.h header file. Did you by any chance, added a macro named TBCTL/bit/clkdiv in your project?

    Regards,

    Veena

  • Veena,

    That wasn't the issue. After your feedback, I found a whoa-duh problem. I had the following macro definitions for setting up my clock at the top of the file:

    #define CLKDIV 3
    #define HSPCLKDIV 0
    #define TBPRD 126

    The pre-processor, obviously replaced 3 for CLKDIV, 0 for HSPCLKDIV, and 126 for TBPRD and then sent it to the compiler. My BAD! I'm sorry to have bothered you.

    Dan