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.

CCS/CC2640R2F: cc2640r2f

Part Number: CC2640R2F

Tool/software: Code Composer Studio

Hello!

I have my app based on cc2640r2 simple peripheral example using blestack on custom board. It works fine with ble 5 ( i have a phone with ble 5 and a laptop with ble 4 and a few more devices with ble 4 ). But if i try to use ble 4 device - it can't connect with my application. Trying to fix it i found an intresting thing - if i don't call my simple periodic task 

if (events & SBP_PERIODIC_EVT)
{
Util_startClock(&periodicClock);

// Perform periodic application task
SimplePeripheral_performPeriodicTask();
}

, or if i would call it with a few simple actions inside - all parts of cc2640r2 application would work fine with all my ble 4 and ble 5 external devices, but if it perfoms my task - i can work with my cc2640r2 device only using ble 5 devices..

How can i fix this problem?

And i have a problem with GAPROLE_WAITING - when i connect with phone to cc2640r2 device and then disconnect - gap task goes into GAPROLE_WAITING and stops simple_peripheral task clock - so the task stoping to performing, if i connect again - simple peripheral task would start. Why do i have such a problem?

Best regards, Dmitriy.

  • Hi Dmitriy,

    Assigning an expert to comment.

  • Hi Dmitry,

    What version of the SimpleLink CC2640R2 SDK are you using? What peer devices (smart phones) have you tested with?

    Bluetooth 4 and Bluetooth 5 devices are compatible (unless you are using Bluetooth 5 features such as LE Coded PHY, LE 2M PHY or extended advertising.)

    What are you doing inside SimplePeripheral_performPeriodicTask()? Is it possible it is starving the Bleutooth task?

  • Hi Marie!

    I am using CC2640R2 v3.20 with 3.55 xdc tools via ccs 9.1 . Peer smart phones are - xiaomi mi 9se( ble 5 ), xiaomi redmi 6 ( ble 4.2 ), laptop lenovo thinkpad t580 ( ble 4.2). For phones i use BLE scanner app, and for laptop Bluetooth LE explorer.

    I can say after testing that i found one problem - i lost ble 4 compatible after going from dynamic array allocation in my task to static. I made about 2.5 kb static allocated buffer. 

    Now i made it to 1 kb and ble 4.2 can connect again. ROV doesn't say that there was eny errors, stack overrun, any heap problems etc.. Is it possible to inderstang how many free RAM space i have  to implement my task without crashing gaprole and icall tasks?

    But the problem with gaprole waiting is still actual. I mean that problem that after pressing disconnect in BLE scanner app - cc2640r2 goes to gaprole waiting, stopping simple_peripheral task clock and don't start it until i try to connect again. Also sometimes it takes about 3-5 attempts to re-connect cc2640r2 from phone app.

    Best regards, Dmitiry.

  • Hi Dmitriy,

    In your other thread we were discussing memory issues, I think this could be the same root cause. Let me know if the suggestions I gave there helps for this issue as well. 

  • Hello, Marie!

    Unfortunately, the problem remains actual. I mean the problem with gaprole( when disconnect ble - the simple app of cc2640r2 stops to execution and when connecting - starts again ), but the other problem is resolved, thanks!

    If i commit in that case like:

    case GAPROLE_WAITING:
    // Util_stopClock(&periodicClock);

    All would work, but i don't know is it ok to do such things..

    Best regards, Dmitriy.

  • Hi Dmitriy,

    The intention is for simple peripheral to start advertising again when the connection is terminated (see GAP_LINK_TERMINATED_EVENT in peripheral.c). If I were you I would investigate why the state machine in peripheral.c seems to be broken..