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.

Bios 6 SEM compile error?

Guru 15580 points
Other Parts Discussed in Thread: SYSBIOS

I have created a static SEM as follows:

var ti_sysbios_knl_Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore');

var instti_sysbios_knl_Semaphore0Params0 = new ti_sysbios_knl_Semaphore.Params();

instti_sysbios_knl_Semaphore0Params0.instance.name = "OsSem";

Program.global.OsSem = ti_sysbios_knl_Semaphore.create(null, instti_sysbios_knl_Semaphore0Params0);

and am attempting to use its address in an EDMA3 LLD driver initialization as follows:

initCfg.drvSemHandle = &OsSem;               // OsSem added statically in the .tcf file with an initial count of 1

However, I get the following error message during compilation:

"C:/PROGRA~2/TEXASI~1/bios_6_30_02_42/packages/ti/sysbios/knl/Semaphore.h")

"../edma_arm.c", line 300: error: a value of type "const ti_sysbios_knl_Semaphore_Handle *" cannot be assigned to an entity of type "void *"

Plus a whole raft of these:

"C:/PROGRA~2/TEXASI~1/bios_6_30_02_42/packages/ti/sysbios/ipc/Semaphore__prologue.h", line 33: warning: #warn "The ti.sysbios.ipc.Semaphore module is being deprecated. Please switch to ti.sysbios.knl.Semaphore."

"C:/PROGRA~2/TEXASI~1/bios_6_30_02_42/packages/ti/sysbios/ipc/Event__prologue.h", line 33: warning: #warn "The ti.sysbios.ipc.Event module is being deprecated. Please switch to ti.sysbios.knl.Event."

"C:/PROGRA~2/TEXASI~1/bios_6_30_02_42/packages/ti/sysbios/ipc/Semaphore.h", line 599: warning: incompatible redefinition of macro "Semaphore_Instance" (declared at line 596 of "C:/PROGRA~2/TEXASI~1/bios_6_30_02_42/packages/ti/sysbios/knl/Semaphore.h")

"C:/PROGRA~2/TEXASI~1/bios_6_30_02_42/packages/ti/sysbios/ipc/Semaphore.h", line 600: warning: incompatible redefinition of macro "Semaphore_Handle" (declared at line 597 of "C:/PROGRA~2/TEXASI~1/bios_6_30_02_42/packages/ti/sysbios/knl/Semaphore.h")

........

Can someone give me a hand figuring out what is wrong?

Thx,

MikeH

 

 

  • Hi Mike,

    SYS/BIOS moved the Semaphore module from ti.sysbios.ipc to ti.sysbios.knl to avoid some naming confusion with the Ipc product. To make sure it was still backward compatible, everything still works if you have xdc.useModule('ti.sysbios.ipc.Semaphore') in your .cfg file or #include <ti/sysbios/ipc/Semaphore> in your source files.

    So it looks like somewhere there is still a reference to 'ti.sysbios.ipc.Semaphore' in your .cfg file (or a file include by your .cfg file).

    Also check to see that you don't have #include <ti/sysbios/ipc/Semaphore> and #include <ti/sysbios/knl/Semaphore> in your source file. Just use the knl one.

    Regarding the build error, I'm assuming line 300 is

    initCfg.drvSemHandle = &OsSem;

    What is the type of drvSemHandle in the structure?

    Todd

  • Todd,

    ToddMullanix said:
    So it looks like somewhere there is still a reference to 'ti.sysbios.ipc.Semaphore' in your .cfg file (or a file include by your .cfg file).

    I cannot find any references to ti.sysbios.ipc.Semahpore anywhere in my code. I have even disabled the reference to the IPC package in the RTSC build properties window. However, I still get the warnings shown above. Where else should I look?

    ToddMullanix said:

    Regarding the build error, I'm assuming line 300 is

    initCfg.drvSemHandle = &OsSem;

    Yes, that is correct.

    ToddMullanix said:
    What is the type of drvSemHandle in the structure?

    This is from the EDMA3 LLD and code I am using from the TI workshop. It is found in edma3_drv.h.

     

    // used for EDMA3_DRV_open() API and initCfg structure, defined in <edma3_drv.h>

    EDMA3_DRV_InitConfig initCfg;

     

     

    /**\struct      EDMA3_DRV_InitConfig

     * \brief       Used to Initialize the EDMA3 Driver Instance

     *

     * This configuration structure is used to initialize the EDMA3 DRV Instance.

     * This configuration information is passed while opening the DRV instance.

     */

    typedef struct

    {

        /** Region Identification */

        EDMA3_RM_RegionId       regionId;

     

        /**

         * It tells whether the EDMA3 DRV instance is Master or not. Only the shadow

         * region associated with this master instance will receive the EDMA3

         * interrupts (if enabled).

         */

        unsigned short          isMaster;

     

        /**

         * EDMA3 resources related shadow region specific information. Which all

         * EDMA3 resources are owned and reserved by this particular instance are

         * told in this configuration structure.

         * User can also pass this structure as NULL. In that case, default static

         * configuration would be taken from the platform specific configuration

         * files (part of the Resource Manager), if available.

         */

        EDMA3_DRV_InstanceInitConfig    *drvInstInitConfig;

     

        /**

         * EDMA3 Driver Instance specific semaphore handle.

         * Used to share resources (DMA/QDMA channels, PaRAM Sets, TCCs etc)

         * among different users.

         */

        void                    *drvSemHandle;

     

        /**

         * Instance wide global callback function to catch non-channel

         * specific errors from the Channel controller. for eg, TCC

         * error, queue threshold exceed error etc.

         */

        EDMA3_RM_GblErrCallback gblerrCb;

     

        /**

         * Application data to be passed back to the global error callback

         * function

         */

        void                    *gblerrData;

    } EDMA3_DRV_InitConfig;

    I have used this same structure in bios 5 and there is no build error. What has changed in bios 6?

    Thx,

    MikeH

     

     

     

     

     

     

     

     

  • This is totally bizzare. I have removed all references to IPC. I have removed the SEM module and any reference to SEM in my project. However, I still get the following error messages.

    "C:/PROGRA~2/TEXASI~1/bios_6_30_02_42/packages/ti/sysbios/ipc/Semaphore__prologue.h", line 33: warning: #warn "The ti.sysbios.ipc.Semaphore module is being deprecated. Please switch to ti.sysbios.knl.Semaphore."

    "C:/PROGRA~2/TEXASI~1/bios_6_30_02_42/packages/ti/sysbios/ipc/Event__prologue.h", line 33: warning: #warn "The ti.sysbios.ipc.Event module is being deprecated. Please switch to ti.sysbios.knl.Event."

    I am also getting a rather interesting warning, which I have asked for an explanation of on a separate post in the CCS forum. Perhaps this is causing some issue?

    Severity and Description Path Resource Location Creation Time Id

    Invalid project path: Duplicate path entries. ARM_init_SYSBIOS pathentry 1302794757163 13220

    ...and yes, I have tried "cleaning" my workspace by importing this project into a new workspace. The same error code exists in the new workspace.

    I really need to get past this silly error. Your guidance is appreciated.

    Thx,

    MikeH

     

     

     

  • Mike --

    Which file is causing this warning?   In your CCS build window, you should see a compile line like below indicating which .c file is being compiled when the warning occurs.   This would help us zero in on this.  I added '#include <ti/sysbios/ipc/Semaphore.h>' to the hello.c file and CCS tells me that hello.c was the file.

    Thanks,
    -Karl-

    "C:/Program Files/Texas Instruments/C2000 Code Generation Tools 6.0.0B2/bin/cl2000" -v28 -mt -ml -g --include_path="C:/Program Files/Texas Instruments/C2000 Code Generation Tools 6.0.0B2/include" --diag_warning=225 --float_support=fpu32 --preproc_with_compile --preproc_dependency="hello.pp" --cmd_file="./configPkg/compiler.opt"  "../hello.c"
    "C:/PROGRA~1/TEXASI~1/bios_6_32_00_19_eng/packages/ti/sysbios/ipc/Semaphore__prologue.h", line 33: warning: #warn "The ti.sysbios.ipc.Semaphore module is being deprecated. Please switch to ti.sysbios.knl.Semaphore."

     

  • Mike,

    What other packages are you using (e.g. Ndk, Ipc, Syslink)? Can you confirm that you have the correct versions. The warning is really more of a future warning. Granted, it is annoying, but your app should work fine.

    Regarding your compiler error. The compiler is caught a problem with the following line

    Todd

    initCfg.drvSemHandle = &OsSem;

    OsSem is a Semaphore_Handle, so the above line should be

     

    initCfg.drvSemHandle = OsSem;

  • Karl,

    Karl Wechsler said:
    Which file is causing this warning?

    All of them. My console window runs out of lines to display, but it appears that all of the .c files the the complier attempts to compile throw this error:

    4744.compile_errors.txt

    See more info in next post....

     

  • Todd,

    Packages being used:

    ToddMullanix said:

    sSem is a Semaphore_Handle, so the above line should be

    initCfg.drvSemHandle = OsSem;

    That's what I thought. In fact, if I do as you say, I get a new set of errors. But before we get to that. I am confused about the "type" for SEM. When I create a new SEM in XGCONF the following script appears:

    var instti_sysbios_knl_Semaphore0Params0 = new ti_sysbios_knl_Semaphore.Params();

    instti_sysbios_knl_Semaphore0Params0.instance.name = "OsSem";

    Program.global.OsSem = ti_sysbios_knl_Semaphore.create(null, instti_sysbios_knl_Semaphore0Params0);

    Based on the above, it looks like OsSem is a global variable (Program.global), not a handle. Am I wrong?

    The new set of errors appear to be a path/include issue that occurs as soon as I correct the above statement (&OsSem to OsSem). I only have this error when I "correct" the &OsSem statement. All of inlcudes are in place for the edma3_drv.h. so these errors should not happen.

    <Linking>

     

     undefined                   first referenced

      symbol                         in file     

     ---------                   ----------------

     EDMA3_DRV_close             ./edma_arm.obj  

     EDMA3_DRV_create            ./edma_arm.obj  

     EDMA3_DRV_delete            ./edma_arm.obj  

     EDMA3_DRV_enableTransfer    ./edma_arm.obj  

     EDMA3_DRV_freeChannel       ./edma_arm.obj  

     EDMA3_DRV_getPaRAM          ./edma_arm.obj  

     EDMA3_DRV_linkChannel       ./edma_arm.obj  

     EDMA3_DRV_open              ./edma_arm.obj  

     EDMA3_DRV_requestChannel    ./edma_arm.obj  

     EDMA3_DRV_setDestIndex      ./edma_arm.obj  

     EDMA3_DRV_setDestParams     ./edma_arm.obj  

     EDMA3_DRV_setOptField       ./edma_arm.obj  

     EDMA3_DRV_setPaRAM          ./edma_arm.obj  

     EDMA3_DRV_setSrcIndex       ./edma_arm.obj  

     EDMA3_DRV_setSrcParams      ./edma_arm.obj  

     EDMA3_DRV_setTransferParams ./edma_arm.obj  

     SWI_post                    ./edma_arm.obj  

     sampleEdma3GblCfgParams     ./edma_arm.obj  

     sampleInstInitConfig        ./edma_arm.obj  

     

    error: unresolved symbols remain

    error: errors encountered during linking; "ARM_init_SYSBIOS.out" not built

     

    Very confusing......

    Thx,

    MikeH

     

     

  • Mike,

    The Semaphore.create "returns" a Semaphore.Handle (just like the runtime Semaphore_create returns a Semaphore_Handle). The Semaphore.create line is making a global variable called OsSem. The type of OsSem is Semaphore_Handle.

    At the end of the day, the config step makes a linker file, a .h and a .c. In the basement of your project (e.g. debug\configPkg\package\cfg), there is a big generated C file. This is compiled into your project. When I added the Program.global.OsSem = ti_sysbios_knl_Semaphore.create(null, instti_sysbios_knl_Semaphore0Params0); line into an example program, I get the following line in the generated .c

    const ti_sysbios_knl_Semaphore_Handle OsSem = (ti_sysbios_knl_Semaphore_Handle)((ti_sysbios_knl_Semaphore_Handle)&ti_sysbios_knl_Semaphore_Object__table__V[0]);

    Note the type. (All the long names are to avoid name collisions internally). Please do NOT modify this file. It is generated. I know some people like to see the actual code to help understand what is going on.

    Regarding the link errors, it appears that you are not linking in the EDMA3 library. It looks like it is not installed, otherwise you'd see it in the Products and Repositories page that you included. Note: I have not used the EDMA3 library, so I'm not familiar with it.

    Todd

  • Todd,

    ToddMullanix said:
    The Semaphore.create "returns" a Semaphore.Handle

    Yes, stupid of me to think otherwise. Thanks for clarifying.

    ToddMullanix said:
    it appears that you are not linking in the EDMA3 library. It looks like it is not installed, otherwise you'd see it in the Products and Repositories page that you included.

    Yes, that is odd. I have linked to each library in my project directory, and included each header file in my "includes". I'll have to keep chasing this down.

    In the mean time, note that one of my unresolved symbols is SEM_post. How can this happen?

    Thx,

    MikeH

     

  • Todd,

    ToddMullanix said:
    The warning is really more of a future warning. Granted, it is annoying, but your app should work fine.

    So, are you suggesting that I just live with this error (fills my console) or is there some fix?

    Thx,

    MikeH

     

  • Mike,

    No I was not suggesting that. I just wanted to make sure you understood what the warnings were stating.

    Todd

  • Thanks for attaching the .txt file with the error.   It seems like the warnings are coming from ../common/lcd.c file.   What is that file?   Can you look at the .h files that it includes?   Either it is including ti/sysbios/ipc/Semaphore.h or one of the other .h files is probably including ti/sysbios/ipc/Semaphore.h.

    Note that you can increase the size of the build console output  buffer (via Window->Preferences->C/C++->Build Console) if you have problems like this in the future where the warnings/errors swamp the console output buffer.

  • Karl,

    Karl Wechsler said:
    It seems like the warnings are coming from ../common/lcd.c file. 

    Sorry for the confusion. That was meant to show you an example of what was happening for *every* file. The complete list was a bit long to include.

    HOWEVER, it is all moot. I have found a newer version of EDMA3 LLD (C:\Program Files (x86)\Texas Instruments\edma3_lld_02_11_01_02). After installing it and linking it to my project...ALL OF THE SEMAPHORE ERRORS GO AWAY. It also now shows up in my RTSC products and repositories window. Totally bizarre! 

    Anyway, thanks for the help. I'm off to solicit help on my unresolve edma3 symbols.

    This is becoming confusinger and confusinger......:)

    Thx,

    MikeH