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.

CC2642R: Execute "user" code right after wake up for rf event

Part Number: CC2642R
Other Parts Discussed in Thread: CC2541

Hello.

In the BLE sdk for cc2541 you can execute user code right after a wake up. In hal_sleep.c you have:

// Flag to indicate if wake is due to impending radio event.
static uint8 wakeForRF;


        if ( (wakeForRF == TRUE) && !(IRCON & 0x80) )

        {
          wakeForRF = FALSE;
        }


Right after this you know if the wakeup is for a radio event (advertising or connection event?) and you can execute a limited amount of code:

if ( (wakeForRF == TRUE)

{

// do stuff...

}

We are looking for this in the recent ble5 sdk but can not find sth. similar. Where do we have to look?

Best Regards

  • In the CC26xx SDK, the power management is done in power driver. When there is msg waiting to be sent over the air, then in the next adv/conn event, the radio core will wake up and send that for you.

    You don't need to worry about configuring the power state when you are using any SDK for CC26xx.
  • Hello Christin

    What we want to do is execute some of our own code at the point when mcu (not the radio core) wakes up to set up for a radio event (and only when it wakes up for a radio event). This was possible in the cc2541 BLE SDK, but we can not find such an option in BLE5 SDK.
    Can you help us?

    Best Regards
  • In the BLE5 SDK, you can register a callback to the radio driver when it wakes up and setting up the radio core. Then you can do what you want in the callback.

    To see the example you can take a look at CC1352R1_LAUNCHXL_fxn.c and CC1352R1_LAUNCHXL.c file.
    ex: C:\ti\simplelink_cc13x2_26x2_sdk_2_40_00_81\examples\rtos\CC1352R1_LAUNCHXL\drivers\rfDualModeTx

    The event mask you should use is RF_GlobalEventRadioSetup
  • Thank you I will look into it.