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.

CC2651R3SIPA: How to periodically wake up from standby mode to active mode

Expert 2440 points
Part Number: CC2651R3SIPA
Other Parts Discussed in Thread: ENERGYTRACE

Tool/software:

Hi All

How do I periodically wake up the CC2651R3SIPA from standby mode to active mode using the RTC?

There is a timer in the RF core.
I think the RTC is used for periodic operation in standby mode.

I am concerned that if the RTC is used for periodic operation,
the CPU will also wake up when an RTC event occurs, increasing power consumption.

Is it possible to send advertisements using only the BLE module without waking up the CPU in standby mode?

Best Regards,

Ito

  • Hello Ito,

    I look into your descried event, and send over an example, note that the example will likely be out of an empty project so you will need to adapt it into an BLE environment. 

    Thanks,
    Alex F

  • Hi Alex,

    Thank you for your help.
    I'm looking forward to it.

    Best Regards,

    Ito

  • Hello K.Z

    I hope you are doing well. So first is that we likely cannot directly modify the RTC with the application, reference the following threads about this:

    https://e2e.ti.com/f/1/t/467792/

    https://e2e.ti.com/f/1/t/478380/

    However as an alternative we can try to use the Timer/GPTimer, for this I would recommend referencing the timerled example as it already has the environment setup with the timer. This should also be possible to implement in the BLE project as well! 

    Is it possible to send advertisements using only the BLE module without waking up the CPU in standby mode?

    -I am not entirely sure here, will need to ask another team member about if this is possible for BLE. 

    Thanks,
    Alex F

  • Hi Alex F

    Thank you for your help.

    Is it possible to send advertisements using only the BLE module without waking up the CPU in standby mode?

    I am waiting for answer here.

    I have one more question.

    Please let me know if advertisement transmission is possible with RF core CPU only.
    Although the customer is probably asking the main cpu question,
    I believe that by running only the rf core cpu, current consumption can be reduced.

    Best Regards,

    Ito

  • Hi K.Z

    If the customer is running BLE example then the power management handles going to low power mode. See, document below.

    https://www.ti.com/lit/an/swra478d/swra478d.pdf

    Customer needs to understand what would add to current consumption such as open UART port or external circuitry.

    -kel

  • Hello K.Z

    Is it possible to send advertisements using only the BLE module without waking up the CPU in standby mode?

    -No it is not possible to do this, the device has to wake up to handle and process the data.

    Thanks,
    Alex F

  • Hi Alex,

    Thank you for your reply.

    Please let me know if advertisement transmission is possible with RF core CPU only.

    How about the answer to this question.

    Best Regards,

    Ito

  • Hello K.Z

    In proprf, the application needs to setup the radio command, and "start" it, once started the radio will continuously send a command (if setup to do so). 

    In this case you are using BLE which I believe needs a bit more processing/setup, and I do not think its possibly just with the RF core only. 

    Thanks,
    Alex F

  • Hi Alex,

    I have checked the TimerLED sample code and I can confirm that it is waking up with GPIO interrupts.
    I also think that when the timer peripheral is activated, it is prevented from transitioning to the standby mode.
    From this, I think that the timer peripheral does not operate in the standby mode.

    [Question]
    How do I periodically wakeup from the standby state to the active state?
    BLE is stopped in standby mode.

    Best Regards,

    Ito

  • Hi K.Z.

    If you are running a Bluetooth example program example simple peripheral, the power management does the work going to standby mode if there is no event like advertising. You would not know if it is in standby mode, if you do not have the proper test equipment like what is described from the document I shared. You can also try EnergyTrace at CCS.

    -kel

  • Hi kel,

    Thank you for your reply.

    If you are running a Bluetooth example program example simple peripheral, the power management does the work going to standby mode if there is no event like advertising.

    Where is the Bluetooth example program example simple peripheral?
    I will check with Enegy trace using it.

    Best Regards,

    Ito

  • Hello Ito,

    If you are looking for simple peripheral example:

    C:\ti\simplelink_cc13xx_cc26xx_sdk_7_41_00_17\examples\rtos\LP_CC2651R3SIPA\ble5stack

    SLA Bluetooth Low Energy 5 Connections

    Thanks,
    Alex F

  • Hi Alex,

    Last question,
    I don't know how to wake up from standby mode.
    Is it not possible to wake up from standby mode with the Timer?
    I understand that cannot wake up with RTC.

    Best Regards,

    Ito

  • Hi K.Z.

    If you are using BLE example program like simple peripheral, this is how the power management works below.

    No event - goes automatically from active mode to standby mode.

    With event - goes automatically from standby mode to active mode.

    Example of events are Bluetooth advertising, application events.

    The events are processed at the RTOS Task. Example application event is the SBP_PERIODIC_EVT in the code below which occurs every 5 seconds if simple peripheral is connected to smartphone.

    static void SimplePeripheral_taskFxn(UArg a0, UArg a1)
    {
      // Initialize application
      SimplePeripheral_init();
    
      // Application main loop
      for (;;)
      {
        uint32_t events;
    
        // Waits for an event to be posted associated with the calling thread.
        // Note that an event associated with a thread is posted when a
        // message is queued to the message receive queue of the thread
        events = Event_pend(syncEvent, Event_Id_NONE, SBP_ALL_EVENTS,
                            ICALL_TIMEOUT_FOREVER);
    
        if (events)
        {
          ICall_EntityID dest;
          ICall_ServiceEnum src;
          ICall_HciExtEvt *pMsg = NULL;
    
          // Fetch any available messages that might have been sent from the stack
          if (ICall_fetchServiceMsg(&src, &dest,
                                    (void **)&pMsg) == ICALL_ERRNO_SUCCESS)
          {
            uint8 safeToDealloc = TRUE;
    
            if ((src == ICALL_SERVICE_CLASS_BLE) && (dest == selfEntity))
            {
              ICall_Stack_Event *pEvt = (ICall_Stack_Event *)pMsg;
    
              if (pEvt->signature != 0xffff)
              {
                // Process inter-task message
                safeToDealloc = SimplePeripheral_processStackMsg((ICall_Hdr *)pMsg);
              }
            }
    
            if (pMsg && safeToDealloc)
            {
              ICall_freeMsg(pMsg);
            }
          }
    
          // If RTOS queue is not empty, process app message.
          if (events & SBP_QUEUE_EVT)
          {
            while (!Queue_empty(appMsgQueue))
            {
              sbpEvt_t *pMsg = (sbpEvt_t *)Util_dequeueMsg(appMsgQueue);
              if (pMsg)
              {
                // Process message.
                SimplePeripheral_processAppMsg(pMsg);
    
                // Free the space from the message.
                ICall_free(pMsg);
              }
            }
          }
    
          if (events & SBP_PERIODIC_EVT)
          {
            //Util_startClock(&periodicClock);
    
            // Perform periodic application task
            SimplePeripheral_performPeriodicTask();
          }
    
    #if 0
          if(events & SBP_SCTASK_EVT)
          {
              //riza
              MyData_SetParameter_int(MYDATA_DATA_ID,
                                  MYDATA_DATA_LEN,
                                  adcValue_avg);
              //MyData_SetParameter(MYDATA_DATA_ID,
              //                    MYDATA_DATA_LEN,
              //                    &adcValue_avg);
    
          }
    #endif
        }
      }
    }

    RTC and Timer can become events, if you just know how to make it an event that will be processed by RTOS task. But anyway you do not need to use RTC or timer for Bluetooth advertising.

    -kel

  • Hi Kel,

    Thank you for your reply.

    Can I also use SBP_PERIODIC_EVT as a reference for creating events with RTCs and timers?

    Best Regards,

    Ito

  • Hi K.Z

    You can post an event or queue to the RTOS task. C functions at simple peripheral to do so.

    Event_post(syncEvent, SBP_SCTASK_EVT);

    SimplePeripheral_enqueueMsg()

    For example at your timer interrupt can call the c functions above to process the event.

    I can't find learning resource about it at the moment, but you can learn it by reviewing code.

    -kel