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.

CC2340R5-Q1: How can we mitigate the consistent ripples observed in our application after transmitting BLE Advertisement payloads and subsequently disabling the BLE advertisement until the next cycle?

Part Number: CC2340R5-Q1
Other Parts Discussed in Thread: SYSCONFIG, CC2340R5

Tool/software:

In our application loop, we expect one BLE advertisement every 5 seconds. To conserve power, we disable the BLE advertisement before exiting the loop and call the sleep() function to introduce a delay between consecutive BLE advertisements.

Our system needs to be highly power-efficient, and we anticipate that the sleep() call will put the BLE CC2340 into sleep mode, thus reducing the overall system current consumption to approximately 10 microamps between each BLE advertisement.

However, we are observing ripples between each BLE advertisement transmission. We are uncertain about what we are missing or what causes the BLE controller to enter sleep mode.

The attached picture illustrates our application's behavior between consecutive BLE advertisement transmissions.

The average current observed in the system is approximately a constant 166 microamps which will cause our battery to losses its capacity to deliver energy.

The code snippet provided facilitates the enabling and disabling of advertisements, as well as handling them. Additionally, it ensures synchronization across various system tasks by utilizing a semaphore to complete the advertisement process, and by confirming that the actions to enable and disable BLE advertisements are properly executed within the TI BLE stack.

Does CC23400R5 stack has APIs that allow the BLE processor to transition to low power mode and revert back immediately after those APIs are called.

-----------------------------------------------------------------------------------------------------------------------------------------------------
void appEnableBle(char *pData)
{
bStatus_t status;
char* cpyData = pData;
status = Broadcaster_adv_enable();
if(SUCCESS == status)
{
sem_post(&blesem);
}
}


void appDisableBle(char *pData)
{
bStatus_t status;
char* cpyData = pData;
status = Broadcaster_adv_disable();
if(SUCCESS == status)
{
sem_post(&blesem);
}
}


loop <repeated Ble Transimssion>

bleStatus = BLEAppUtil_invokeFunctionNoData(appEnableBle);
if (SUCCESS == bleStatus)
{
/* Wait for Enable advertisement operation to complete */
sem_wait(&blesem);
}
/* Wait for advertisement to complete */
sem_wait(&bleAdv);

/* disable Advertisement */
bleStatus = BLEAppUtil_invokeFunctionNoData(appDisableBle);
if (SUCCESS == bleStatus)
{
/* Wait for Disable advertisement operation to complete */
sem_wait(&blesem);
}
sleep(5);
End loop <repeated Ble Transimssion>

Advertisement Handler

void Broadcaster_AdvEventHandler(uint32 event, BLEAppUtil_msgHdr_t *pMsgData)
{
BLEAppUtil_AdvEventData_t *advData = (BLEAppUtil_AdvEventData_t*) pMsgData;
static uint8_t i=0;
static uint8_t j=0;
bStatus_t status;
uint8_t debug1 = 0;
uint8_t debug2 = 0;
switch (event)
{
case BLEAPPUTIL_ADV_START_AFTER_ENABLE:
{
debug1 = advData->pBuf->advHandle;
break;
}

case BLEAPPUTIL_ADV_END_AFTER_DISABLE:
{
debug2 = advData->pBuf->advHandle;
break;
}

case BLEAPPUTIL_ADV_END:
{
if (bleDataAvailable)
{
for (i = 0; i < B_ADDR_LEN; i++)
{
advData1[i + USER_ADV_DATA_OFFSET] = data[i];
}
for (j = 0; j < bleDataLength; j++)
{
advData1[i + USER_ADV_DATA_OFFSET] = bleDataarr[j];
i++;
}
for (j = i; j < sizeof(advData1); j++)
{
advData1[j + USER_ADV_DATA_OFFSET] = 0x00;
}
bleDataAvailable = 0;
GapAdv_prepareLoadByHandle(broadcasterAdvHandle_1,
GAP_ADV_FREE_OPTION_DONT_FREE);
GapAdv_loadByHandle(broadcasterAdvHandle_1, GAP_ADV_DATA_TYPE_ADV,
sizeof(advData1), advData1);
sem_post(&bleAdv);
}

break;
}

default:
{
break;
}
}
}

Thanks 

Ilanchezhian T 

  • Greetings,

    I would like to understand your application better, and some of the design choices you are making. Why do you need to disable/re-enable advertising every time? Is it not possible for you to set the advertising interval to be 5s? Between the advertising emissions, if there is nothing to do in your application code, the SW should automatically enter standby. The radio will then wake up the device at the right time to make sure your advertising interval is correct.

    What is your power policy set to in SysConfig?

    Best,
    Achyut Ray

  • Hello Achyut Ray, thank you for responding to our question. Below are my answers to your inquiries.

    Is it not possible for you to set the advertising interval to be 5s? Why do you need to disable/re-enable advertising every time?

    Our application is designed for high power efficiency, operating on a 3V, 600mA battery that should last for over five years. Consequently, the minimum duty cycle for data updates is set to once every 30 seconds. Additionally, our sensor data does not fluctuate rapidly, eliminating the need for frequent updates akin to advertisement packets. Frequent advertising, consuming approximately 16 to 20 mA of peak current at +8dBm, would compromise our battery longevity requirements. Could you please suggest any other best possible way we could achieve our application use case using API's provided with CC2340 SDK.

    The design decision is to consider disabling the advertisement between two consecutive application data intervals (say 30 seconds), with the expectation that turning off BLE advertisement will conserve power.

    if there is nothing to do in your application code, the SW should automatically enter standby

    Our CC2340 does not encounter any external interrupts during the 30-second window for acquisition and data transmission. We have implemented a 30-second delay using the sleep() API provided by the CC2340 SDK. It is expected that the sleep() function will enable the CC2340 MCU to enter standby mode automatically, thereby conserving power during this period.

    What is your power policy set to in SysConfig?

    Our power policy setting in sysconfig is PowerCC23X0_standbyPolicy. 

    If the sleep() API fails to automatically put the CC2340 MCU into standby mode during non-transmission times without external interrupts, you may wonder if there's an alternative API that can handle the application's delay requirements while also enabling low power standby mode.

    With Regards

    Ilanchezhian T 

     

  • Hello Ilanchezhian,

    Thanks for the additional information. Could we please try the following?

    1. To verify the energy profile, could you please flash the basic_ble example (<SDK>\examples\rtos\LP_EM_CC2340R5\ble5stack\basic_ble) and set the advertising interval to 5 seconds. Please follow the following guide as reference to optimize power consumption: Optimizing Bluetooth Low Energy Power Consumption.
    2. I would suggest to avoid disabling/enabling the adv and use the advertisement interval as shown in the previous guide step 2.
    3. If you want to modify the advertisement parameter during runtime, please take a look at the following training material on how to do it: https://dev.ti.com/tirex/explore/node?devtools=LP-EM-CC2340R5&node=A__AWGBpOjezYNvPbjzZTCkqw__SIMPLELINK-ACADEMY-CC23XX__gsUPh5j__LATEST
    4. Could you please confirm if you are using a TI launchpad or if this is a custom board?

    BR,

    David.

  • Hi David ,

    1. Could you please confirm if you are using a TI launchpad or if this is a custom board? 
      1. We are currently utilizing our custom board for development purposes. However, for the initial firmware prototype development, we utilized a TI Launchpad.
    2. I would suggest to avoid disabling/enabling the adv and use the advertisement interval as shown in the previous guide step 2
      1. We have tried increasing the advertisement interval, but we observe that the BLE transmission occurs for every set advertisement. Is there a method to ensure the advertisement callback is still triggered in the firmware, and is it possible within the stack to skip sending out the BLE advertisement packet from the BLE Radio for each firmware callback trigger?
      2. Please be aware that we are operating the BLE in TX only mode, which is used solely for advertising.
    3. To verify the energy profile, could you please flash the basic_ble example (<SDK>\examples\rtos\LP_EM_CC2340R5\ble5stack\basic_ble) and set the advertising interval to 5 seconds
      1. I will test that example in the evaluation kit and inform you of the results. Meanwhile, could you elaborate on how advertisement is managed in the stack, and if the system activates for each advertisement interval, would it not consume power to transmit the BLE packets?

    Thanks and Regards

    Ilan 

  • Hello Ilanchezhian,

    Thanks, let me know how it goes with the EV board.

    May I ask what are you trying to accomplish with this? Do you want to skip sending some packets between advertisement intervals depending on an additional condition?

    Is there a method to ensure the advertisement callback is still triggered in the firmware, and is it possible within the stack to skip sending out the BLE advertisement packet from the BLE Radio for each firmware callback trigger

    I would suggest to take a look at this application note (Figure 6-14. Beacon Event and Table 6-2. Beacon Event, State Analysis), where you can see what is happening during an advertisement event from a system perspective. In addition, may I ask if you want to use only one channel to advertise ("we observe that the BLE transmission occurs for every set advertisement"? You can configure to use one of the three adv channels (37, 38, 39) instead of all of them.

    BR,

    David.