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.

LAUNCHXL-CC26X2R1: SDK: simple_peripheral project inter-task running and message event delivery issues

Part Number: LAUNCHXL-CC26X2R1
Other Parts Discussed in Thread: ENERGYTRACE

Hi team,

I encountered some problems when debugging this project:

1. When the APP task task reaches setting GapAdv_create #2, it will jump to execute SimplePeripheral_advCallback (this function is the callback passed to the BLE stack) and enqueue APP_ADV_EVT.

My understanding of this step is: the BLE stack has a higher priority than the APP task, so after GapAdv_enable, the BLE stack can interrupt the running of the APP task, so that SimplePeripheral_advCallback can be executed first. Then it was enabled twice, so APP_ADV_EVT was executed twice.

Is this my understanding correct? Or how do APP task and BLE stack operate?

2. ble_log shows that APP_PERIODIC_EVT will be executed after the initialization is completed, but no action to start the periodic clock during the initialization process was found in the code. May I ask where this APP_PERIODIC_EVT event is turned on?

3.Regarding the APP_PERIODIC_EVT event enqueue function, does it mean there is no task execution?

Thanks & Regards,

Yolande

  • Hello Yolande,

    Thanks for reaching out.

    Could you please specify the version of the SDK you are using?

    Yes, in addition the SimplePeripheral project includes two sets of advertisements, therefore the two GAP event start after enable. I am not sure if this is what you are referring to. Please let me know.

    Regarding the PERIODIC_EVT question, I would suggest looking at the clocks explanation given at the User Guide here, especially the functional example graph.

    BR,

    David.

  • Hi David,

    1, SDK Version: Simplelink_cc13xx_cc26xx_sdk_7_10_00_98.

    2, refers to these two broadcasts. After the first broadcast has set the parameters and enabled, when the second broadcast parameter is set (without enabled), stack executes the ADVcallback function of the first broadcast call, and then after the second broadcast is set and started. After the second broadcast starts, stack executes the ADVcallback function again. This is what I have observed, so what logic is this?

    3, enable periodic broadcast is not carried out by APP tsak by opening the timed clock, then the queue APP event?

    Supplements:

    The project does not have a cycle broadcast turned on, but has a cycle broadcast function.

    Thanks & Best regards,

    Yolande

  • Hello Yolande,

    Apologize for the confusion, I edited my response but I guess it did not properly updated. My answer on periodic adv is wrong, your question is not related to that. However, were you able to review this?

    Regarding the PERIODIC_EVT question, I would suggest looking at the clocks explanation given at the User Guide here, especially the functional example graph.

    BR,

    David.

  • Hi David,

    1.Can you tell me how the APP task and BLE stack work  and which one has a higher priority 。

    2.Where was this APP_PERIODIC_EVT event started? 

    Thanks & Best regards,

    Yolande

  • Hello Yolande,

    1. To you first question, SimplePeripheral_advCallback is executed in as software interrupt context therefore having higher priority than the other tasks.

    2. The APP_PERIODIC_EVT is created using Util_constructClock() at SimplePeripheral_init(), but is not started immediately, it waits for a call to start, which in this case it Util_startClock(). You can see this function is called in GAP_LINK_ESTABLISHED_EVENT for example and also inside SimplePeripheral_clockHandler() function to start the next period of events.

    BR,

    David.

  • Hi David,

    We're sorry! I was busy with other things so that I didn't respond in a timely manner.

    1, the normal situation given in the clock section of the user guide start clock to the process of executing the post event. GAP_LINK_ESTABLISHED_EVENT events and SimplePeripheral_clockHandler() are not executed in the SDK simple_peripheral project Util_startClock() in the function, also performs APP_PERIODIC_EVT;

    2, the phenomenon is that after the board is powered up, no action is performed. Discover that there will always be an APP_PERIODIC_EVT execution. The attachment is BLE_LOG, please see the analysis!

    ble_log_peripheral_event.txt

    Thanks & Best regards,

    Yolande

  • Hello Yolande,

    I am looking into this, however can you please confirm if you have done any modifications to the original project?

    simple_peripheral_CC26X2R1_LAUNCHXL_tirtos7_ticlang

    BR,

    David.

  • Hi David,

    I have not made any changes, please help to analyze the cause of this phenomenon.

    Thanks & Best regards,

    Yolande

  • Hello Yolande,

    Please allow me until Monday to analyze the logs and reproduce it on my side.

    Apologies for the delay.

    David.

  • Hi David,

    I am looking forward to hearing from you .

    Thanks & Best regards,

    Yolande

  • Hello Yolande,

    I have gone through the project, the logs and results from reproducing it from my side.

    The behaviour is expected, the task that calls SP_PERIODIC_EVT runs every 5000 ms, while the device is also constantly advertising. You can double check this is the case by using a Bluetooth sniffer, EnergyTrace or the SimpleLink Connect mobile app. If you start a connection, for example, you will then see a new event status. This periodic task can be configured to do something else other than what is doing now at the example. Is the device not advertising in your case?

    BR,

    David.