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.

TMS320F280039C: #include "f28x_project.h" causes working F28003x projects to fail

Part Number: TMS320F280039C
Other Parts Discussed in Thread: C2000WARE

I have a project that uses definitions from  "f28x_project.h" I am using the latest c2000Ware from C2000ware_MotorControl_SDK_4_02_01_00 and I get the errors below.  Next I tried to take an example that works, compiled it, and then added the #include "f28x_project.h" to the file and got the same errors.  Is there a problem with the definitions.

"/Users/xxxx/ti/C2000Ware_MotorControl_SDK_4_02_01_00/c2000ware/device_support/f28003x/headers/include/f28003x_nmiintrupt.h", line 159: error #41: expected an identifier
"/Users/xxxx/ti/C2000Ware_MotorControl_SDK_4_02_01_00/c2000ware/device_support/f28003x/headers/include/f28003x_nmiintrupt.h", line 170: error #41: expected an identifier
"/Users/xxxx/ti/C2000Ware_MotorControl_SDK_4_02_01_00/c2000ware/device_support/f28003x/headers/include/f28003x_nmiintrupt.h", line 180: error #41: expected an identifier
"/Users/xxxx/ti/C2000Ware_MotorControl_SDK_4_02_01_00/c2000ware/device_support/f28003x/headers/include/f28003x_lin.h", line 236: error #41: expected an identifier
"/Users/xxxx/ti/C2000Ware_MotorControl_SDK_4_02_01_00/c2000ware/device_support/f28003x/headers/include/f28003x_lin.h", line 236: error #80: expected a type specifier
"/Users/xxxx/ti/C2000Ware_MotorControl_SDK_4_02_01_00/c2000ware/device_support/f28003x/headers/include/f28003x_lin.h", line 236: error #170: a function type is not allowed here
"/Users/xxxx/ti/C2000Ware_MotorControl_SDK_4_02_01_00/c2000ware/device_support/f28003x/headers/include/f28003x_lin.h", line 236: warning #109-D: signed bit field of length 1
"/Users/xxxx/ti/C2000Ware_MotorControl_SDK_4_02_01_00/c2000ware/device_support/f28003x/common/include/f28003x_globalprototypes.h", line 92: error #41: expected an identifier
"/Users/xxxx/ti/C2000Ware_MotorControl_SDK_4_02_01_00/c2000ware/device_support/f28003x/common/include/f28003x_globalprototypes.h", line 92: error #80: expected a type specifier
"/Users/xxxx/ti/C2000Ware_MotorControl_SDK_4_02_01_00/c2000ware/device_support/f28003x/common/include/f28003x_globalprototypes.h", line 92: error #91: function returning function is not allowed
9 errors detected in the compilation of "/Users/xxxx/ti/C2000Ware_MotorControl_SDK_4_02_01_00/solutions/servo_drive_with_can/common/source/servo_drive_with_can.c".
gmake: *** [servo_drive_with_can.obj] Error 1

One of the problems appears to be a conflict with the LIN support-- there is a field Calle "IDLE" which conflicts with the driver lib "IDLE()" function. There also is a conflict with "ERROR" as a variable in a structure.

How can I fix this?  My project is porting from a '049 processor and it uses definitions from f28x_project.

Regards

  • I searched for an example from C2000Ware that uses the f28x_project file and it crashes in the same way so it appears there is a bug in that h file.

  • Hi,

    The subject matter expert is out of office today. Please expect a delayed response.

    Thanks

    Srikanth

  • I believe I've seen similar issues before and found that it appeared to be sensitive to the order of the #includes. I'm checking our other SDK solutions that use both driverlib and the device support header files, and it looks like they all make to to #include f28x_project.h before any of the driverlib header files get #included. Can you see if that makes a difference for you?

    Whitney

  • Whitney,

    This fix works for an example project!  I will try it on my actual code and see if that fixes everything.  Thank you for the quick response.

    Regards

  • Whitney,

    It helped on some of my files but I have a file that fails even if I put the include for "f28x_project.h" as the first thing that gets included.  Are there any other things I can do?

  • I figured out the problem.  It is not the header order that makes the difference.  You need to add a define in Properties->Build->C2000 Compiler->Predefined Symbols for _DUAL_HEADERS. 

    I figured this out because the definition for IDLE is changed based on that definition.  Do you know the meaning of _DUAL_HEADERS? 

  • Glad you found a solution. I had forgotten _DUAL_HEADERS was applicable to this device, but yes, _DUAL_HEADERS should be used when you are using both the driverlib and the device_support header files in one project. It uses some #ifdefs to rename some things to avoid conflicts between the two sets of header files.

    Whitney