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.

Changing the Handling of Enum Variables Between A15, IPU, and DSP on AM571x: Issues with 'packed' vs 'int'

Other Parts Discussed in Thread: SYSBIOS

We exchange certain data between the A15, IPU, and DSP of the AM571x. Among these data, there are enum-type variables that, depending on the compilation options of each core, can occupy memory space as an int or be "packed" with a size adjusted to the values that enum can have.

The issue is that the DSP compiles enum-type variables as "int," and we haven't found a way to change it. This led us to change the "Designate enum type" option from "packed" to "int" in the IPUs, but then we encountered warnings from libraries already compiled with the "packed" option.

Description    Resource    Path    Location    Type
#16027-D object files have incompatible enumeration types ("C:/src/protech-p51rc/am57x/cortex-m4/libElementsM4/Debug/libElementsM4.lib<cfgFab.obj>" = packed, "./Alive.obj" = 32-bit)    ipu1_core0             C/C++ Problem
#16027-D object files have incompatible enumeration types ("C:/src/protech-p51rc/am57x/cortex-m4/libElementsM4/Debug/libElementsM4.lib<commands.obj>" = packed, "./Alive.obj" = 32-bit)    ipu1_core0             C/C++ Problem
#16027-D object files have incompatible enumeration types ("C:/src/protech-p51rc/am57x/cortex-m4/libElementsM4/Debug/libElementsM4.lib<counters.obj>" = packed, "./Alive.obj" = 32-bit)    ipu1_core0             C/C++ Problem
#16027-D object files have incompatible enumeration types ("C:/src/protech-p51rc/am57x/cortex-m4/libElementsM4/Debug/libElementsM4.lib<goose.obj>" = packed, "./Alive.obj" = 32-bit)    ipu1_core0             C/C++ Problem
#16027-D object files have incompatible enumeration types ("C:/src/protech-p51rc/am57x/cortex-m4/libElementsM4/Debug/libElementsM4.lib<libElemVers.obj>" = packed, "./Alive.obj" = 32-bit)    ipu1_core0             C/C++ Problem
#16027-D object files have incompatible enumeration types ("C:/src/protech-p51rc/am57x/cortex-m4/libElementsM4/Debug/libElementsM4.lib<notify.obj>" = packed, "./Alive.obj" = 32-bit)    ipu1_core0             C/C++ Problem
#16027-D object files have incompatible enumeration types ("C:/src/protech-p51rc/am57x/cortex-m4/libElementsM4/Debug/libElementsM4.lib<percmvs.obj>" = packed, "./Alive.obj" = 32-bit)    ipu1_core0             C/C++ Problem
#16027-D object files have incompatible enumeration types ("C:/src/protech-p51rc/am57x/cortex-m4/libElementsM4/Debug/libElementsM4.lib<setpoints.obj>" = packed, "./Alive.obj" = 32-bit)    ipu1_core0             C/C++ Problem
#16027-D object files have incompatible enumeration types ("C:/src/protech-p51rc/am57x/cortex-m4/libElementsM4/Debug/libElementsM4.lib<signals.obj>" = packed, "./Alive.obj" = 32-bit)    ipu1_core0             C/C++ Problem
#16027-D object files have incompatible enumeration types ("C:/src/protech-p51rc/am57x/cortex-m4/libElementsM4/Debug/libElementsM4.lib<timeSync.obj>" = packed, "./Alive.obj" = 32-bit)    ipu1_core0             C/C++ Problem
#16027-D object files have incompatible enumeration types ("C:/src/protech-p51rc/am57x/cortex-m4/libElementsM4/Debug/libElementsM4.lib<volcmvs.obj>" = packed, "./Alive.obj" = 32-bit)    ipu1_core0             C/C++ Problem
#16027-D object files have incompatible enumeration types ("C:/src/protech-p51rc/am57x/cortex-m4/libEvtM4/Debug/libEvtM4.lib<libEvt.obj>" = packed, "./Alive.obj" = 32-bit)    ipu1_core0             C/C++ Problem
#16027-D object files have incompatible enumeration types ("C:/src/protech-p51rc/am57x/cortex-m4/libFaultM4/Debug/libFaultM4.lib<libFault.obj>" = packed, "./Alive.obj" = 32-bit)    ipu1_core0             C/C++ Problem
#16027-D object files have incompatible enumeration types ("C:/src/protech-p51rc/am57x/cortex-m4/libRingBufM4/Debug/libRingBufM4.lib<libRingBuf.obj>" = packed, "./Alive.obj" = 32-bit)    ipu1_core0             C/C++ Problem
#16027-D object files have incompatible enumeration types ("C:\src\protech-p51rc\am57x\cortex-m4\ipu1\ipu1_core0\src\ipc\ipc.aem4<Ipc.obj>" = packed, "./Alive.obj" = 32-bit)    ipu1_core0             C/C++ Problem
#16027-D object files have incompatible enumeration types ("C:\src\protech-p51rc\am57x\cortex-m4\ipu1\ipu1_core0\src\sysbios\sysbios.aem4<BIOS.obj>" = packed, "./Alive.obj" = 32-bit)    ipu1_core0             C/C++ Problem
#16027-D object files have incompatible enumeration types ("C:\ti\bios_6_83_00_18\packages\ti\targets\arm\rtsarm\lib\ti.targets.arm.rtsarm.aem4<Assert.oem4>" = packed, "./Alive.obj" = 32-bit)    ipu1_core0             C/C++ Problem
#16027-D object files have incompatible enumeration types ("C:\ti\bios_6_83_00_18\packages\ti\targets\arm\rtsarm\lib\ti.targets.arm.rtsarm.aem4<Core-label.oem4>" = packed, "./Alive.obj" = 32-bit)    ipu1_core0             C/C++ Problem
#16027-D object files have incompatible enumeration types ("C:\ti\bios_6_83_00_18\packages\ti\targets\arm\rtsarm\lib\ti.targets.arm.rtsarm.aem4<Core-mem.oem4>" = packed, "./Alive.obj" = 32-bit)    ipu1_core0             C/C++ Problem
#16027-D object files have incompatible enumeration types ("C:\ti\bios_6_83_00_18\packages\ti\targets\arm\rtsarm\lib\ti.targets.arm.rtsarm.aem4<Core-params.oem4>" = packed, "./Alive.obj" = 32-bit)    ipu1_core0             C/C++ Problem
#16027-D object files have incompatible enumeration types ("C:\ti\bios_6_83_00_18\packages\ti\targets\arm\rtsarm\lib\ti.targets.arm.rtsarm.aem4<Core-smem.oem4>" = packed, "./Alive.obj" = 32-bit)    ipu1_core0             C/C++ Problem
#16027-D object files have incompatible enumeration types ("C:\ti\bios_6_83_00_18\packages\ti\targets\arm\rtsarm\lib\ti.targets.arm.rtsarm.aem4<Diags.oem4>" = packed, "./Alive.obj" = 32-bit)    ipu1_core0             C/C++ Problem
#16027-D object files have incompatible enumeration types ("C:\ti\bios_6_83_00_18\packages\ti\targets\arm\rtsarm\lib\ti.targets.arm.rtsarm.aem4<Error.oem4>" = packed, "./Alive.obj" = 32-bit)    ipu1_core0             C/C++ Problem
#16027-D object files have incompatible enumeration types ("C:\ti\bios_6_83_00_18\packages\ti\targets\arm\rtsarm\lib\ti.targets.arm.rtsarm.aem4<Gate.oem4>" = packed, "./Alive.obj" = 32-bit)    ipu1_core0             C/C++ Problem
#16027-D object files have incompatible enumeration types ("C:\ti\bios_6_83_00_18\packages\ti\targets\arm\rtsarm\lib\ti.targets.arm.rtsarm.aem4<GateNull.oem4>" = packed, "./Alive.obj" = 32-bit)    ipu1_core0             C/C++ Problem
#16027-D object files have incompatible enumeration types ("C:\ti\bios_6_83_00_18\packages\ti\targets\arm\rtsarm\lib\ti.targets.arm.rtsarm.aem4<GateThread.oem4>" = packed, "./Alive.obj" = 32-bit)    ipu1_core0             C/C++ Problem
#16027-D object files have incompatible enumeration types ("C:\ti\bios_6_83_00_18\packages\ti\targets\arm\rtsarm\lib\ti.targets.arm.rtsarm.aem4<Log.oem4>" = packed, "./Alive.obj" = 32-bit)    ipu1_core0             C/C++ Problem
#16027-D object files have incompatible enumeration types ("C:\ti\bios_6_83_00_18\packages\ti\targets\arm\rtsarm\lib\ti.targets.arm.rtsarm.aem4<LoggerBuf.oem4>" = packed, "./Alive.obj" = 32-bit)    ipu1_core0             C/C++ Problem
#16027-D object files have incompatible enumeration types ("C:\ti\bios_6_83_00_18\packages\ti\targets\arm\rtsarm\lib\ti.targets.arm.rtsarm.aem4<Memory.oem4>" = packed, "./Alive.obj" = 32-bit)    ipu1_core0             C/C++ Problem
#16027-D object files have incompatible enumeration types ("C:\ti\bios_6_83_00_18\packages\ti\targets\arm\rtsarm\lib\ti.targets.arm.rtsarm.aem4<Registry.oem4>" = packed, "./Alive.obj" = 32-bit)    ipu1_core0             C/C++ Problem
#16027-D object files have incompatible enumeration types ("C:\ti\bios_6_83_00_18\packages\ti\targets\arm\rtsarm\lib\ti.targets.arm.rtsarm.aem4<Startup.oem4>" = packed, "./Alive.obj" = 32-bit)    ipu1_core0             C/C++ Problem
#16027-D object files have incompatible enumeration types ("C:\ti\bios_6_83_00_18\packages\ti\targets\arm\rtsarm\lib\ti.targets.arm.rtsarm.aem4<SysMin.oem4>" = packed, "./Alive.obj" = 32-bit)    ipu1_core0             C/C++ Problem
#16027-D object files have incompatible enumeration types ("C:\ti\bios_6_83_00_18\packages\ti\targets\arm\rtsarm\lib\ti.targets.arm.rtsarm.aem4<System.oem4>" = packed, "./Alive.obj" = 32-bit)    ipu1_core0             C/C++ Problem
#16027-D object files have incompatible enumeration types ("C:\ti\bios_6_83_00_18\packages\ti\targets\arm\rtsarm\lib\ti.targets.arm.rtsarm.aem4<Text.oem4>" = packed, "./Alive.obj" = 32-bit)    ipu1_core0             C/C++ Problem
#16027-D object files have incompatible enumeration types ("C:\ti\bios_6_83_00_18\packages\ti\targets\arm\rtsarm\lib\ti.targets.arm.rtsarm.aem4<Timestamp.oem4>" = packed, "./Alive.obj" = 32-bit)    ipu1_core0             C/C++ Problem
#16027-D object files have incompatible enumeration types ("C:\ti\bios_6_83_00_18\packages\ti\targets\arm\rtsarm\lib\ti.targets.arm.rtsarm.aem4<TimestampNull.oem4>" = packed, "./Alive.obj" = 32-bit)    ipu1_core0             C/C++ Problem
#16027-D object files have incompatible enumeration types ("C:\ti\ipc_3_50_04_08\packages\ti\pm\lib\release\ti.pm_null.aem4<IpcPower_null.oem4>" = packed, "./Alive.obj" = 32-bit)    ipu1_core0             C/C++ Problem
#16027-D object files have incompatible enumeration types ("C:\ti\ipc_3_50_04_08\packages\ti\trace\lib\release\ti.trace_smp.aem4<SysMin.oem4>" = packed, "./Alive.obj" = 32-bit)    ipu1_core0             C/C++ Problem
#16027-D object files have incompatible enumeration types ("C:\ti\pdk_am57xx_1_0_17\packages\ti\csl\lib\am571x\m4\release\ti.csl.aem4<mcspi.oem4>" = packed, "./Alive.obj" = 32-bit)    ipu1_core0             C/C++ Problem
#16027-D object files have incompatible enumeration types ("C:\ti\pdk_am57xx_1_0_17\packages\ti\csl\lib\am571x\m4\release\ti.csl.aem4<qspi.oem4>" = packed, "./Alive.obj" = 32-bit)    ipu1_core0             C/C++ Problem
#16027-D object files have incompatible enumeration types ("C:\ti\pdk_am57xx_1_0_17\packages\ti\csl\lib\am571x\m4\release\ti.csl.aem4<uart.oem4>" = packed, "./Alive.obj" = 32-bit)    ipu1_core0             C/C++ Problem
#16027-D object files have incompatible enumeration types ("C:\ti\pdk_am57xx_1_0_17\packages\ti\drv\spi\lib\am571x\m4\release\ti.drv.spi.aem4<QSPI_v1.oem4>" = packed, "./Alive.obj" = 32-bit)    ipu1_core0             C/C++ Problem
#16027-D object files have incompatible enumeration types ("C:\ti\pdk_am57xx_1_0_17\packages\ti\drv\spi\lib\am571x\m4\release\ti.drv.spi.aem4<SPI_drv.oem4>" = packed, "./Alive.obj" = 32-bit)    ipu1_core0             C/C++ Problem
#16027-D object files have incompatible enumeration types ("C:\ti\pdk_am57xx_1_0_17\packages\ti\drv\spi\lib\am571x\m4\release\ti.drv.spi.aem4<SPI_soc.oem4>" = packed, "./Alive.obj" = 32-bit)    ipu1_core0             C/C++ Problem
#16027-D object files have incompatible enumeration types ("C:\ti\pdk_am57xx_1_0_17\packages\ti\drv\spi\lib\am571x\m4\release\ti.drv.spi.aem4<SPI_v1.oem4>" = packed, "./Alive.obj" = 32-bit)    ipu1_core0             C/C++ Problem
#16027-D object files have incompatible enumeration types ("C:\ti\pdk_am57xx_1_0_17\packages\ti\drv\uart\lib\am571x\m4\release\ti.drv.uart.aem4<UART_ascii_utils.oem4>" = packed, "./Alive.obj" = 32-bit)    ipu1_core0             C/C++ Problem
#16027-D object files have incompatible enumeration types ("C:\ti\pdk_am57xx_1_0_17\packages\ti\drv\uart\lib\am571x\m4\release\ti.drv.uart.aem4<UART_drv.oem4>" = packed, "./Alive.obj" = 32-bit)    ipu1_core0             C/C++ Problem
#16027-D object files have incompatible enumeration types ("C:\ti\pdk_am57xx_1_0_17\packages\ti\drv\uart\lib\am571x\m4\release\ti.drv.uart.aem4<UART_soc.oem4>" = packed, "./Alive.obj" = 32-bit)    ipu1_core0             C/C++ Problem
#16027-D object files have incompatible enumeration types ("C:\ti\pdk_am57xx_1_0_17\packages\ti\drv\uart\lib\am571x\m4\release\ti.drv.uart.aem4<UART_stdio.oem4>" = packed, "./Alive.obj" = 32-bit)    ipu1_core0             C/C++ Problem
#16027-D object files have incompatible enumeration types ("C:\ti\pdk_am57xx_1_0_17\packages\ti\drv\uart\lib\am571x\m4\release\ti.drv.uart.aem4<UART_v1.oem4>" = packed, "./Alive.obj" = 32-bit)    ipu1_core0             C/C++ Problem
#16027-D object files have incompatible enumeration types ("C:\ti\pdk_am57xx_1_0_17\packages\ti\osal\lib\tirtos\m4\release\ti.osal.aem4<HwiP_tirtos.oem4>" = packed, "./Alive.obj" = 32-bit)    ipu1_core0             C/C++ Problem
#16027-D object files have incompatible enumeration types ("C:\ti\pdk_am57xx_1_0_17\packages\ti\osal\lib\tirtos\m4\release\ti.osal.aem4<RegisterIntr_tirtos.oem4>" = packed, "./Alive.obj" = 32-bit)    ipu1_core0             C/C++ Problem
#16027-D object files have incompatible enumeration types ("C:\ti\pdk_am57xx_1_0_17\packages\ti\osal\lib\tirtos\m4\release\ti.osal.aem4<SemaphoreP_tirtos.oem4>" = packed, "./Alive.obj" = 32-bit)    ipu1_core0             C/C++ Problem
#16027-D object files have incompatible enumeration types ("C:\ti\pdk_am57xx_1_0_17\packages\ti\osal\lib\tirtos\m4\release\ti.osal.aem4<Utils_tirtos.oem4>" = packed, "./Alive.obj" = 32-bit)    ipu1_core0             C/C++ Problem

I have tried to recompile the IPU libraries with enums as "int" and not "packed," and I am missing the following ones that I haven't been able to change:

I have two options from here for which I need assistance:

  1. Know how to change the DSP project so that it compiles enum-type variables as "packed" and not as "int." In this case, I will also need to know how to recompile the libraries and other components (Sys/Bios, etc.) on which it depends with the same "packed" configuration.

  2. Know how to recompile the libraries and other components (Sys/Bios, etc.) that I'm missing for the IPUs if we switch from "packed" to "int" in the "Designate enum type" option.

For GCC on the A15, it's easier for us to use "packed" or "int."

  • Hi,

    C6000 compiler doesn't support packed enum type. The only option is not using enum type but designated data type.

  • Hello, thanks for your response. After reviewing everything for a few days, I believe the solution might be to rebuild the Product Development Kit (PDK) and Image Processor Controller (IPC) libraries, assigning a minimum "int" size to the "enum" types. Do you know how I can assign the "int" size in the PDK and IPC? I found information in the forum on how to rebuild both libraries, but I couldn't find details on changing the size of the "enum" types.

  • IPC in SDK has been validated between A15/M4/C66x DSP. There is no issue related to date type with TI IPC support between cores. I don't think there is any enum usage in TI IPC shared memory structure between cores.

    Could you be more specific about the enum type issue you have with the data you are trying to exchange between cores?

    Is this custom data structure defined in your application and shared between cores?

  • Yes, it's a custom data structure defined in our application and shared between cores. The issue arises because the DSP compiles the enums as "int," while the IPUs compile them as "packed." If we change them to "int," we get warnings that the binaries are compiled in one way and the libraries/components in another. Ideally, we need to standardize everything as "int" or everything as "packed."

    An alternative is to add unnecessary labels with a value of -1 or something similar to all the enums to ensure that they all compile as "int." It would be much better if we could compile our applications and the libraries or components they depend on in the same way. Since the DSP can only compile enums as "int," we would need the IPU and A15 to also compile them as "int" (which is not a problem). Consequently, we would need to recompile libraries/components that the IPU depends on as "int" to avoid warnings.

    Thank you very much for your time, Stanley.

  • Hi Javier,

    For any shared structure between cores, I recommend you to look at how TI IPC handles the common structure.

    We don't rely on how compiler interpret certain data type. It has to be always consistent.

    So, enum data type is not recommended to be used for shared structure.

    The shared memory structure usually can be defined as array of char so the field and size is fixed across the cores.

    In the application, you can defined the structure application will use and fill it with the data read from shared memory.

    Regards,
    Stanley