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.

CC2652P: CC2652P: rfDriverCallback issue

Part Number: CC2652P
Other Parts Discussed in Thread: SYSCONFIG

Dear TI,

We have custom designed out custom board based on CC2652p MCU.

We are BLE for our application. We have antenna switch between 2.4Ghz and 20 DBM PA, which is controlled by a gpio.

I have added this GPIO in the syscfg under RF pin Selection of RF Driver.

If I declare GlobalCallBack function as rfDriverCallback, Compilation(linking) error is thrown.

If I declare as NULL, compilation passes, but RF is not working.

I tried editing the syscfg files, which gets overwritten on next compilation. How do I edit ti_drivers_config.c file to add the rfDriverCallback function?

Or is there a better way to solve this?

Regards,

Shilpa

  • Hi Shilpa,

    In your case I don't think you need to modify the files generated by SysConfig (but you can follow this guide to disable SysConfig)

    If I am correct, the compilation failure should provide you a good hint :) If not, you can review the code generated inside the file ti_drivers_config.c :

    /*
     *  ======== RF_globalCallbackFunction ========
     *  This function is called by the driver on global driver events.
     *  It will call specific callback functions to further handle the triggering events.
     */
    static void RF_globalCallbackFunction(RF_Handle client, RF_GlobalEvent events, void *arg)
    {
        rfDriverCallback(client, events, arg);
    }
    
    /*
     *  ======== rfDriverCallback ========
     *  Handle events triggered by the RF driver for custom / application specific behavior.
     */
    void __attribute__((weak)) rfDriverCallback(RF_Handle client, RF_GlobalEvent events, void *arg)
    {
        /* ======== PLEASE READ THIS ========
        *
        * This function is declared weak for the application to override it.
        * A new definition of 'rfDriverCallback' is required if you want to
        * handle the events listed in '.globalEventMask'.
        *
        * Please copy this function definition to create your own, but make
        * sure to remove '__attribute__((weak))' for your definition.
        *
        * According to '.globalEventMask', this function will be triggered by:
        *   - RF_GlobalEventRadioPowerDown
        * 
        * An example of how to handle these events would be:
        * 
        *   --- Code snippet begin ---
        * 
        *   if(events & RF_GlobalEventRadioPowerDown) {
        *       // Perform action for this event
        *   }
        * 
        *   --- Code snippet end ---
        */
    }

    I hope this will help,

    Kind regards,

  • Thanks for the reply.

    My compilataion is solved by removing the globalevent callaback and made the rfDriverCallback to NULL.

    WIth this configuration also. BLE works on Launchpad.

    For our custom board, we have generated syscfg from Custom board configuration, where the BLE and RF configurations are exactly same.

    But BLE is not working on our custom board with this configuration.

    whereas, we modified few interface PINs on the original syscfg of "simplle_periphearal_oad_offchip" application and flashed the binaries to our custom board.

    BLE works fine. Since we cannot use some of the GPIOS on the original sysycfg, we had to go for Custom board.

    What could be the issue here? How can we configure all the gpios on the original LAUNCHPAD syscfg.

    Regards,

    Shilpa

  • Hi Shilpa,

    I understand the issue related to the rfDriverCallback is solved. As a result, I am going to ask you to mark this thread as resolved and open a new thread to address the other issues. I ask you in order to keep the forum easy to read for every one.

    Thanks and regards,