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.

CC2640R2F: Android app on newer phones fails to pair with CC2640R2

Part Number: CC2640R2F
Other Parts Discussed in Thread: CC2640

Tool/software:

Hi

We are doing migration of our product from CC2640 to CC2640R2. We are still using blestack (not ble5stack). The SDK used is simplelink_cc2640r2_sdk_5_30_00_03. BLE chip application is based on host_test_app with some custom code transferred from our old CC2640 app. For development tests we are using nRF Connect phone app from nordic.

Old CC2640 pairs successfully with phone app on both android and IOS, We are able to discover GATT characteristics, read and write values. When move to a new chip it only works properly on iPhone and old android phone (very old Samsung Galaxy S4). When using modern phones it fails to pair with error 34 (0x22) GATT CONN LMP TIMEOUT returned. On the device console we see that it is connecting and disconnects just after. Below are Wireshark sniffer logs and screenshot from the phone app. Any idea what it could be? 

For comparison here are some logs from the old android phone, what I suppose should be the expected behavior.

Regards

Maciej

  • I have some problems with uploading files. 

  • Here are some logs, it seems that images must be jpeg and also it does not accept Wireshark logs, so there should be packed.
      pairing_failed_with_new_android_phone.pcapng.gzpairing_ok_with_old_phone.pcapng.gz


  • also some logs from the old CC2640 based module pairing successfully with Google Pixel 8 Pro

    pairing_with_old_module_pixel_8_pro.pcapng.gz

    Those can be seen as expected behavior for the new module, as there are some errors when connecting new module with and old phone. We don't need to support 10-year old phones!

  • It looks like the connections parameters update failure might be the reason as the log from nrfConnect upd shows that

    iPhone and old Android phone is working because those are not doing that update. It was is working properly on the CC2640 module, but fails on CC2640R2 one.

  • Hello Maciej,

    Apologies for the late replay, I was out of office.

    This is a quick guide about the considerations to have regarding the migration from CC2640 to CC2640R2F. This last guide confirms that the "Connection Parameter Update Request" feature is enabled by default. From the logs, I can see what you have already pointed out, which is that the parameter GAP_UpdateLinkParamReq executed from the central (phone) is not processed correctly by the peripheral. I would have expected that after a LL_CONNECTION_PARAM_REQ, the central would have answer with a LL_CONNECTION_PARAM_RSP which contains the prefer peripheral parameters, and then a LL_REJECT_EXT_IND if not accepted by the masters.

    For sanity check, could you please attempt this process using another cc26 device configured as central using the host_test_app and BTool (<SDK>\tools\blestack\btool) instead of the mobile app?

    In addition, we could try disabling the LL_CONNECTION_PARAM_REQ feature to force L2CAP CONNECTION PARAMETER UPDATE REQUEST. As an example, the simple_peripheral_cc26xx example does this by default by not defining USE_LL_CONN_PARAM_UPDATE in simple_peripheral.c

    BR,

    David.

  • Hello David

    Thanks for reply. First I've tried running simple_peripheral app example basing on the same stack running on launchpad and it connects with my android phone without any problem. I can see that android app does connection parameters update. Then I assume that the problem is not directly in the stack but in our app or the stack settings. I was trying to find differences between simple_peripheral and our app but haven't manage to get our app connecting properly. I've also tried BTool, which connects with CC2640R2 running our app, but it does it without connection parameter update, which is our main problem. Is there a way to trigger that using BTool?

    Regards

    Maciej

  • Just a quick update: copying parts of code that are executed when !defined (USE_LL_CONN_PARAM_UPDATE) to corresponding parts of our app solved the problem with android app not being able to update connection parameters. Looks like a good workaround.

  • Hello Maciej,

    Glad to hear you found a solution. I guess you are enabling the HCI_LE_ReadLocalSupportedFeaturesCmd() when doing this as well as the section of the code inside what would be the function (_processStackMsg) that process incoming msg from stack -HCI_LE_READ_LOCAL_SUPPORTED_FEATURES for the HCI command previously mentioned. "The L2CAP Connection Parameter Update procedure is used to support a delta between the minimum and maximum connection intervals required by some iOS devices."

    BR,

    David.

  • Hello David

    Yes I'm enabling HCI_LE_ReadLocalSupportedFeaturesCmd() and then handling HCI_LE_READ_LOCAL_SUPPORTED_FEATURES cmdOpcode. I'm wondering why simplePeripheralApp works regardless this settings and our app based on hostTestApp example works only with connection parameter update handled by L2CAP layer. 

    Another check I did was to see what method is used by our old CC2640 based module and it looks the same in the sniffer logs as with LL_CONN_PARAM_UPDATE disabled. Makes sense as the old one works properly. Are there any knows issues or reasons why hostTestApp example configured as peripheral is not supporting this LL_CONN_PARAM_UPDATE. Or maybe we are missing something when configuring the peripheral role.

    Other issue is that we are planning to BLE qualify our device basing on TI's QDID. Is there any requirement to support any of the 2 above connection parameters update methods? 

    BR,

    Maciej.

  • Hello Maciej,

    Are not both applications using the code sections defined between USE_LL_CONN_PARAM_UPDATE? In the case of simple peripheral, you can see in the code the description (simple_peripheral.c) that points out what happens if USE_LL_CONN_PARAM_UPDATE is not defined: "This code will disable the use of the LL_CONNECTION_PARAM_REQ control procedure (for connection parameter updates, the L2CAP Connection Parameter Update procedure will be used instead). To re-enable the LL_CONNECTION_PARAM_REQ control procedures, define the symbol USE_LL_CONN_PARAM_UPDATE The L2CAP Connection Parameter Update procedure is used to support a delta between the minimum and maximum connection intervals required by some iOS devices."

    BR,

    David

  • Hello David.

    SimplePeripheral app and HostTestApp differ in that matter. There is no reference to USE_LL_CONN_PARAM_UPDATE in the original HostTestApp. I've enabled L2CAP layer connection parameter update by copying sections of code that are compiled when USE_LL_CONN_PARAM_UPDATE is not defined from SimplePeripheralApp. On the other hand I haven't found any code sections that are compiled when USE_LL_CONN_PARAM_UPDATE is defined, so I assume that Link Layer should be used as default. So if it is default why it fails on HostTestApp based FW. 

    Additionally I have found another connection parameter update define named L2CAP_CONN_UPDATE within code section in peripheral.c in PROFILES directory which made me even more confused:

    #if defined(L2CAP_CONN_UPDATE)
    l2capParamUpdateReq_t updateReq;

    updateReq.intervalMin = pConnParams->minConnInterval;
    updateReq.intervalMax = pConnParams->maxConnInterval;
    updateReq.slaveLatency = pConnParams->slaveLatency;
    updateReq.timeoutMultiplier = pConnParams->timeoutMultiplier;

    status = L2CAP_ConnParamUpdateReq(gapRole_ConnectionHandle, &updateReq, selfEntity);
    #else
    gapUpdateLinkParamReq_t linkParams;

    linkParams.connectionHandle = gapRole_ConnectionHandle;
    linkParams.intervalMin = pConnParams->minConnInterval;
    linkParams.intervalMax = pConnParams->maxConnInterval;
    linkParams.connLatency = pConnParams->slaveLatency;
    linkParams.connTimeout = pConnParams->timeoutMultiplier;

    status = GAP_UpdateLinkParamReq( &linkParams );
    #endif // L2CAP_CONN_UPDATE

    Would be very grateful for any suggestions.

    BR

    Maciej

  • Hello Maciej,

    Sorry I missed this last post, I saw the thread has been solved but I see now not entirely. Please allow me until Monday to inspect this in more detail.

    BR,

    David.

  • Hello David,

    Sorry, I've clicked "resolved" by mistake, but it is resolved now to be true.
    So first of all we need to apply that fix from simplePeripheralApp clearing bit responsible for connection parameter update in LL feature response frame. So in that case master will not send LL connection parameter request. And the reason why it fails without this fix is that we are not handling GAP_LinkParamUpdateRequest in our main MCU app.

    software-dl.ti.com/.../gap_api.html

    We checked that we are receiving that event code but not processing it. But actually we don't need that functionality and we will just indicate that in LL feature response frame that it is not supported. So it was not the stack, not the BLE MCU app, it was our main MCU app. BLE MCU app is based on the hostTestApp and everything must be handled by the main MCU over HCI interface. In simplePeripheralApp it is handled by the BLE MCU app directly by GAP Role profile, that is why it was working. Thank you for your help!

    BR

    Maciej

  • Hello Maciej,

    Glad to hear you have found the answer! it makes sense, thanks for sharing the details.

    Best Regards,

    David.