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.

F035 Flash API Build Problems



Hello

I am trying to use the F035 Flash API with a TMS570, using Code Composer Studio.

I am trying to use the "pf035a_api_eabi_vfp.lib" file, as my Build options are set to:
    -mv7R4
    -abi = eabi
    -float Support = VFPv3D16

So according to what I've read, this should be the correct library file to use.

When I build my project the compiler comes back with an error saying that the
object files have incompatible enumeration types (pf035a_api_eabi_vfp.lib = packed) 

In my Build Properties under Runtime Model Options I have my --enum_type set to "int".

If I change my --enum_type to "packed", the project builds successfully. Is there a way I can build my
project without having to change my enum types. (i.e. I do not wish to use packed enums) 

Regards
Kieran

  • Kieran,

    In general, you cannot combine object files with different enumeration types (in this case the library is built for packed enum types and the project is set for int enum type). This post has some workaround suggestions which may help you.

  • Thanks for that.

    One of the solutions in that post partly solves my problem. The solution was to keep the project build option as "packed" enums but add an attribute to each enum that needs to be 32 bit, like so:

    enum { X, Y } __attribute__(unpacked)) enumType;

    The only problem with this solution is that it makes my enums "unpacked", instead of "int". There still seems to be a difference between "unpacked" and "int" enums. Is there a way to make this attribute an "int" type?

    Many Thanks

    Kieran

  • The only difference between "int" and "unpacked" is that with "int" any attempt to create enum values that are outside the range of type int will be rejected as an error.  As long as the enum values are small enough to fit in the int range they will be represented as type int.

     

  • I was going to post this on a seperate thread, but this is the only problem with changing my enums from int to unpacked. It is not so much a functional difference it is a MISRA checker difference, and I think the compiler might be misrepoting a MISRA warning.

    My an example of my code is as follows:

    typedef enum { enum1,  enum2 }  enumType;

    void function (void)                                                                                                                                                                                                                                                                                     {                          

       enumType Variable1;

        Variable1 = enum1;

    }

    This generates the following MISRA warning:

    (MISRA-C:2004 10.1/R) The value of an expression of integer type shall not be implicitly converted to a different underlying type if it is not a conversion to a wider integer type of the same signedness 

    Does this seem right?

    Regards

    Kieran

  • For reference, the MISRA warning is being discussed in this post: http://e2e.ti.com/support/development_tools/compiler/f/343/t/74393.aspx