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.

CCS3.3(last) F28335 Compile error: expected a field name

Other Parts Discussed in Thread: TMS470R1B1M

I've modified project from DSP2833x samples and get this error.

void IoSysClockInitialize()
{
// PLL
//------------------------------------------------------------
if( SysCtrlRegs.PLLSTS.bit.MCLKSTS != 0) asm ("ESTOP0");
if( SysCtrlRegs.PLLSTS.bit.DIVSEL != 0) { EALLOW; SysCtrlRegs.PLLSTS.bit.DIVSEL = 0; EDIS; }
EALLOW;
SysCtrlRegs.PLLSTS.bit.MCLKOFF = 1;
SysCtrlRegs.PLLCR.bit.DIV = PLL_DIV;
EDIS;
while(SysCtrlRegs.PLLSTS.bit.PLLLOCKS != 1) ;
EALLOW;
SysCtrlRegs.PLLSTS.bit.MCLKOFF = 0;
EDIS;
EALLOW;
SysCtrlRegs.PLLSTS.bit.DIVSEL = 2;
EDIS;

}

The compiler gives this error on all strings related to 2-bit declared field SysCtrlRegs.PLLSTS.bit.DIVSEL. All other fields are OK.

The error occurs in case of removal this code out of  /DSP2833x_common/source/DSP2833x_SysCtrl.c.

The header file with  definition of  structure PLLSTS_BITS, union PLLSTS_REG and  declaration of  extern volatile struct SYS_CTRL_REGS SysCtrlRegs; is included to the compiled  file.

The file with implementation  and section mapping of all registers also compiled.

 

 

 

  • I've just changed name of DIVSEL field to DIVSELECT  in struct PLLSTS_BITS declaration and my I/O code, and the error has disappeared !

    What's wrong with field name DIVSEL ? Is it kinda reserved word ? I'm a little bit confused !

  • I'm working on a different IC (SM470R1B1M) but stumbled upon the same problem. After some troubleshooting, I found that in two of the vendor-provided header files, the same field name was defined differently. In my case, the "tms470r1b1m_bit_definitions.h" and "iotms470r1b1m.h" files have several field names with conflicting definitions(e.g. TXFUNC in CANTIOC bits).

    Once I changed the names, or remove one of the include files, the error went away.

  • I'm also working on a diffferent IC (F28335) but got this error from something else worth mentioning (IMHO).  We have some third-party middleware which defines the GPIO registers they use (read, "not all of them") with the classic fixed-address macro:

    #define GPATOGGLE        *(uint32_t volatile *) 0x6FC6
    

    When you mix that with the GPIO_DATA_REGS struct in the TI example GPIO header file (xxx_Gpio.h), you will get the "expected a field name" error for this statement:

    GpioDataRegs.GPATOGGLE.all = 0x0148;

    I found this by retaining the .asm file (--keep_asm) and turning on the C source interlist option (--c_src_interlist).  Search on the error and you will see the unwanted replacement.  (I basically removed the #define macro to fix this.)

    HTH.