• Resolved

Projaect with SYSBios and with Peripherials

Dear support,

We work with Piccolo F28035PN card and build application with SYSBIOS that use CAN peripherials. We added to the project DSP2803x_Headers_BIOS.cmd and DSP2803x_GlobalVariableDefs.c files. And get the following error:

#148 declaration is incompatible with "void (*Flash_CallbackPtr)() C" (declared at line 29 of "...\DSP2803x_headers\include\DSP2803x_BootVars.h") DSP2803x_GlobalVariableDefs.c ‪/PiccoloTestApplWithSysBios‬ line 399 C/C++ Problem

the problem disappears if we comment the following section in DSP2803x_GlobalVariableDefs.c:

#ifdef __cplusplus
#pragma DATA_SECTION("FlashCallbackVar");
#else
#pragma DATA_SECTION(Flash_CallbackPtr, "FlashCallbackVar");
#endif
void (*Flash_CallbackPtr) (void);

 Could you help us with it? We don't understand the reason of this error. DSP2803x_BootVars.h has the same declaration as DSP2803x_GlobalVariableDefs.c.

The project without SYSBIOS using doesn't get this error.

Thanks,Sabina

  • Guru 135060 points

    Sabina,

    Can you provide a small reproducible test case that demonstrates this issue? Please zip up the complete project folder and attach it here. Also include any source/header files that you have modified (DSP2803x_BootVars.h, DSP2803x_GlobalVariableDefs.c etc) from the default ones provided in ControlSuite.

    ____________________________________________________________________________

    Search the wikis for common questions: CGTCCSv6
    Track a known bug with SDOWP. Enter the bug id in the "Find Record ID" box

  • In reply to AartiG:

    2021.PiccoloTestApplWithSysBios.zip

    Dear support,

    I attached my project. the file that was changed is DSP2803x_GlobalVariableDefs.c (zip includes it).

    File DSP2803x_BootVars.h was not changed. i take it from ControlSuite as is.

    Thanks for your helps,

    Sabina

  • Guru 135060 points

    In reply to Sabina Greenberg101872:

    Sabina,

    The error is appearing because the project has the "Treat C files as C++ files" option enabled. When mixing C and C+ files the extern "C" syntax should be applied to function declarations to avoid conflicts due to name mangling.

    If the DSP2803x_GlobalVariableDefs.c file is modified as below, it should build without error. Let us know if this helps.

    #ifdef __cplusplus
    extern "C" {
    #endif

    #ifdef __cplusplus
    #pragma DATA_SECTION("FlashCallbackVar");
    #else
    #pragma DATA_SECTION(Flash_CallbackPtr, "FlashCallbackVar");
    #endif

    void (*Flash_CallbackPtr) (void);
    #ifdef __cplusplus
    }
    #endif

    ____________________________________________________________________________

    Search the wikis for common questions: CGTCCSv6
    Track a known bug with SDOWP. Enter the bug id in the "Find Record ID" box

  • In reply to AartiG:

    Thanks a lot! it helped!

    Regards, Sabina