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.

CCSV5 ARM and DSP compilers: ARM defaults to small enums, and the project option to switch to --enum_type=int doesn't work properly

Hi Team,

can you please state options for this?

Switching the encoding of enums from packed to int using the project options GUI doesn't propagate throughout the entire project and leads to the following linker error:

fatal error: object files have incompatible enumeration types ("./webpage.obj"
   = 32-bit,
   "D:\LD_Sandbox_Head\04_Engineering\01_Source_Code\src\support\hil_server_eve
   \HIL_Server_ARM\Debug\configPkg\package\cfg\client_pea8f.oea8f" = packed)

Since several data structures are transported not only between the processors on the chip, but also to simulation frameworks on PC, enum_type=int is required.

The "trivial" fix manually modifying every single enum is not a good solution, since it requires manually hunting down every single instance in every relevant header.

Thanks,

Thorsten

  • Does the ARM core must have small enums always? enum_type=packed

    Are large enums allowed? enum_type=int

    Customer code can be compiled using large enums. However, configuring SYS/BIOS using configuro there seems to be no option for large enum configuration.

    Thanks,

    Thorsten

     

  • This seems like a BIOS issue of some sort.  You can build all of the source code you control with enum_type=int.  Can you do the same thing with BIOS supplied object files?  Maybe, or maybe not.  I'll draw the attention of some BIOS folks to this thread.  It may make sense to move this thread.

    Thanks and regards,

    -George

  • Thorsten --

    The BIOS, IPC and XDC libs are compiled with default enum type.   So the problem is bigger than just the configuro-generated .c file.

    Why does the customer need the enum size to be int?   Are they sharing some data structures with another processor?   I can probably help you recompile BIOS, etc. with enum type=int, but I think it'd be easier to support and maintain if you use the extra clarifier for the specific enums that need to have the int size.

    -Karl-

  • Hi Karl,

    Since several data structures are transported not only between the processors on the chip, but also to simulation frameworks on PC, enum_type=int is required.

    The "trivial" fix manually modifying every single enum is not a good solution, since it requires manually hunting down every single instance in every relevant header.

    I can't oversee how much work it is to rebuild all related packages and how TI is going to support this after re-compilation. Can you state whether this path is realistic?

    For sure, even if we can re-compile to enum_type=int we need suport from BIOS team in case needed.

    Tha nks for your involvement.

    Thorsten

  • [1]  Use the custom build option and add the "--enum_type=int" to the BIOS.customCCOpts in your .cfg file:

    BIOS.libType = BIOS.LibType_Custom;
    BIOS.customCCOpts = "--neon --endian=little -mv7A8 --abi=eabi -q -ms --opt_for_speed=2  --program_level_compile -o3 -g --optimize_with_debug --enum_type=int";

    BIOS.includeXdcRuntime = true;

    The  "BIOS.includeXdcRuntime" configuration option will build the XDC RTS sources as part of this custom build.

    [2]  If you are using NDK 2.21 or later, you can rebuild the ndk following the instructions on this wiki:

    http://processors.wiki.ti.com/index.php/Rebuilding_The_NDK_Core_Using_Gmake

    You will need to update ndk.bld file to include the --enum_type=int option. 

    Change this line:

    var armOpts = " -ms ";

    to this:

    var armOpts = " -ms --enum_type=int";


    If you are using NDK 2.20, the build instructions are different and are summarized here:

    http://processors.wiki.ti.com/index.php/Rebuilding_the_NDK_Core

    [3]  finally, you need to update the config.bld file used by the configuro command to make sure that you have the --enum_type=1.  The attached slides show how to do this if you are using CCS.  If you are using command line or makefile for the configuro step, you should be able to add this to the command line.

    4137.enum-int.ppt

  • Hello Karl,

    thank you for your support! It seems to work. BIOS.includeXdcRuntime = true; was the key information for me. In addition to your proposed procedure, I had to recompile also the NSP-package. There was a bug in the config.bld of the NSP-package: An include path was missing. After fixing that, NSP recompiled and now the whole project runs with "--enum_type=int" option.