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.

CC1352P: Warning - #552-D variable “frontendPins” was set but never used.

Part Number: CC1352P

We have a custom board and therefore a custom .syscfg file (attached).

As such, we have added rfDriverCallbackCustom() as well as initAntennaSwitch().  These functions are modeled off the ones generated for the Launchpad and work fine.

The problem is that the generated ti_driver_config.c includes its own initRfFrontend() which is never called or used.  This unused function has a couple of static variable that are initialized so the linker is creating the "set but never used" warning.

Seems as though this snippet of code should be excluded from ti_driver_config.c when using a custom board.

static PIN_Handle frontendPins;
static PIN_State frontendState;

void initRfFrontend(void)
{
    static bool initialized = false;

    if (!initialized) {
        PIN_Config frontendConfig[] = {
            CONFIG_RF_24GHZ | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX,      /* Path disabled */
            CONFIG_RF_HIGH_PA | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX,      /* Path disabled */
            PIN_TERMINATE
        };
        frontendPins = PIN_open(&frontendState, frontendConfig);
        initialized = true;
    }
}

/cfs-file/__key/communityserver-discussions-components-files/158/ZFR183x_5F00_PWB.zip

  • It doesn't matter to see "set but never used" warning in the linker.

  • Hi Bill.

    Thanks for the feedback, I have notified the Software Development Teams so that the issue can be fixed. 

    Regards, Vegard

  • Our coding standards require our products to compile without errors or warning.

    While in this case ignoring this warning causes no issues, I have seen too many times getting into trouble when ignoring warnings. 

  • Hi Vegard,

    I tried adding warning #552 to the Suppress Diagnostic list  in Build-->ARM Compiler-->Advanced Options--Diagnostic Options.

    It works when applied to the entire project or to other individual files that I have, but not for the individual file ti_drivers_config.c 

    I'm guessing this is because ti_drivers_config.c is a generated file and gets deleted before each build.

    Do you know if there is a way to suppress this warning, but only for this file?

    Thanks,

    -Bill

  • Hi Bill,

    Bill Kuckuk said:

    It works when applied to the entire project or to other individual files that I have, but not for the individual file ti_drivers_config.c 

    I'm guessing this is because ti_drivers_config.c is a generated file and gets deleted before each build.

    This is exactly the reason.

    Bill Kuckuk said:
    Do you know if there is a way to suppress this warning, but only for this file?

    Unfortunately there does not appear to be a workaround. The file must exist before the build to apply file specific options to it. 

    ki

  • Ki,

    Thanks for the follow up.  As I stated in the first post, the real fix will be to exclude this code in the TI_driver_config.c when building a custom board. Until then, I'll need to ignore the warning.

    - Bill