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.

CC2640: CC2640 as peripheral, ADV automatic stop

Part Number: CC2640

SDK version : 2.2.1.18

Hi all,

Recently, we found about thousand device have no advertising problem,

we have found that it can be solved while we call enable advertising API every 300ms,

the API is as follows:

GAPRole_SetParameter(GAPROLE_ADVERT_ENABLED, sizeof(uint8_t), &ADV_enable);

According to what we knows, SDK 2.2.2 fixed  ADV stops problem

  • [BLESTACK-1133] ADV stops unexpectedly due to conflict with CM0 and CM3

but our device has been mass-produced, we think the risk of switching SDK is too high,

Question :

If we call GAPRole_SetParameter(GAPROLE_ADVERT_ENABLED, sizeof(uint8_t), &ADV_enable); every 300ms,

will it cause any influence on TI-RTOS?

  • Hello,

    If you call GAPRole_SetParameter(GAPROLE_ADVERT_ENABLED,  sizeof(uint8_t), &ADV_enable) every 300 ms, it may have an effect on your application if you have another thread that has disabled advertising in order to change an advertising parameter.

    ------------Potentially Problematic Sequence of Events -------------- 

    Thread 1: Callback to change advertising interval gets called

    Thread 1: Disable advertising before changing advertising interval

    Thread 2: 300 ms timer to call GAPRole_SetParameter(GAPROLE_ADVERT_ENABLED, sizeof(uint8_t), &ADV_enable); gets triggered. Advertising re-enabled. Returns to thread 1

    Thread 1: Tries to change advertising interval. Unable to do so because advertising is not disabled.

    You could consider using a lock or a semaphore to ensure that you don't run into a scenario like this. You will have to identify all the times you disable advertising, and ensure that you cannot re-enable advertising until you are sure the application is ready. You can learn more about this in the Real-Time OS SimpleLink Academy Training