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.

CC2642R: GATT_ExchangeMTU Change MTU Failed

Part Number: CC2642R
Other Parts Discussed in Thread: SYSCONFIG

SDK Version: Simplelink_cc13xx_cc26xx_sdk_7_10_00_98 (latest version) 

Hardware: Homemade Minimum System Board :

5287.原理图 蓝牙模块-CC2642_V1.3.pdf

Symptom:

Using TI's simple_central and simple_peripheral tests, the host scans to the slave, and once the connection is established, it invokes GATT_ExchangeMTU to update the MTU:

static void SimpleCentral_startSvcDiscovery(void)
{

    bStatus_t status;
    attExchangeMTUReq_t req;

    // Initialize cached handles
    svcStartHdl = svcEndHdl = 0;

    discState = BLE_DISC_STATE_MTU;

    // Discover GATT Server's Rx MTU size
    req.clientRxMTU = scMaxPduSize - L2CAP_HDR_SIZE;
    // ATT MTU size should be set to the minimum of the Client Rx MTU
    // and Server Rx MTU values
    //VOID GATT_ExchangeMTU(scConnHandle, &req, selfEntity);
    status = GATT_ExchangeMTU(simpleBLEConnHandle, &req, selfEntity);
    if(status == 0){
        sprintf(printbuf,"Request was queued successfully.\r\n");
    }else{
        sprintf(printbuf,"Error:status=%d.\r\n",status);
    }
    PRINT_LOG;

}

The ATT_MTU_UPDATED_EVENT received in the SimpleCentral_processGATTmsg(gattMsgEvent_t *pMsg) function is very rare, mostly not received. In the event that ATT_MTU_UPDATED_EVENT is not received, the connection is automatically disconnected.

The return status of the GATT_ExchangeMTU() function is 0, that is, successful, and the value of the ATT MTU size I am trying to update is 65, which is the maximum value of the engineering default variable MTU.

Simple_peripheral Change MTU with a phone connection is normal every time. This issue should not be related to simple_peripheral.

  • Hi Alex,

    Does the function call the GATT_MSG_EVENT in simple_central.c file?

    Does the customer have this issue only with his board?

    regards,

  • GATT_MSG_EVENT is definitely called.

    I'm not sure what the problem is.

    An early project on my side that implemented the same central functionality, using the CC2640R2 chip, SDK version simplelink_cc2640r2_sdk_1_40_00_45, does not have this problem.

  • Hi Alex,

    What I need to know is if the GATT_MSG_EVENT is triggered byt the GATT_Exchange_MTU function?

    Also does the Secure Connections BLE Feature is enabled?

    It should be nice to have a look at the user's guide in the BLE5-Stack > GATT > MTU section to know exactly how works the MTU size.

    regards,

  • 1.GATT_ExchangeMTU() triggers GATT_MSG_EVENT. The problem I have is that sometimes, after the connection is established, central calls GATT_ExchangeMTU(). SimpleCentral_processGATTMsg will receive an ATT_EXCHANGE_MTU_RSP after approximately 30 seconds. The connection is then disconnected (GAP_LINK_TERMINATED_EVENT received by SimpleCentral_processGapMsg). 

    2.Where do I check if the Secure Connect BLE feature is enabled? 

  • Hello Alex, 

    What is the value MAX PDU size value set in sysconfig? (BLE>General configuration)

    What is the value of the MTU in the event ATT_EXCHANGE_MTU_RSP? 

    You can check the secure connection in sysconfig as well.

    regards,

  • In sysconfig, the Max size of PDU (bytes) is 69.

    In the ATT_EXCHANGE_MTU_RSP event, I added the following code to print in the central SimpleCentral_processGATTMsg function:

    When failed, print ATT_EXCHANGE_MTU_RSP, MTU Size: 0

    When successful is, print ATT_EXCHANGE_MTU_RSP, MTU Size: 65

  • Hello Alex,

    Do you mean that the function passes successfully but not every time?

    Do you have a context when the function leads to disconnect the device?

    regards,

  • Yes, not every time.

    What context do you need, I can add printing to the code.

  • Hi Alex, 

    Does costumer try to change the MTU size several times in the same connection?

    What is the default MTU size? 

    Why they need to change it to 65?

    Is it the first thing they did just after the connection?

    Both boards are customer ones? 

    Do they tried to change the GATT_ExchangeMTU localisation in the code, trigger the function at the end of a timer for instance?

    A Bluetooth Low Energy traces should help to understand how is reproducible this issue and what is really going on.

    Regards, 

  • I only change the MTU size once in the same connection.

    The default MTU size is 23.

    I now need to transfer more than 23 bytes at a time, so I need to change the MTU.

    Both of the boards were designed by us.

    The MTU will not be changed immediately after the connection, but a timer will be started, timed for 6 seconds, and the time will not change until after.

    I would like to know if you have tested and experienced this

  • Hi Alex,

    For information, the engineer handling this thread is out of the office today due to US holidays. Please bear with me as I may have missed a few details in the discussion.

    If not already done, I would recommend to collect Bluetooth traces using a Bluetooth sniffer and compare the content of the packets exchanged in the working and the non-working cases.

    Please share such traces if you need help with their analysis.

    Best regards,

  • Hi Alex,

    As Clement mentioned, are you able to take some BLE Sniffer logs of the behavior over the air This will help us understand what packet sizes are being used for the actual BLE transmission.

    Best Regards,

    Jan