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.

CC2745R10-Q1: After calling GATTServApp_ProcessCharCfg() without exchanging MTU, it will run to hardfault in Basic BLE project

Part Number: CC2745R10-Q1

Hi team,

Like the title mentions, if I don't exchange the MTU, after calling GATTServApp_ProcessCharCfg(), the device will enter hardfault.

SDK: simplelink_lowpower_f3_sdk_9_20_01_21

Please copy simple_gatt_profile.c into Basic BLE project. The issue will be reproduced.

Thanks.

Best Regards,

Connor.

  • Hi Connor,

    In current BLE stack implementation, it must exchange MTU size before sending greater than (ATT_MTU - 3) Bytes data.

    The BLE stack will allocate a (ATT_MTU - 3) bytes buffer when calling GATTServApp_ProcessCharCfg().

    When you send more than (ATT_MTU - 3) bytes, the data will not be sent due to mismatching ATT_MTU size.

    But it still allocates (ATT_MTU - 3) Bytes from heap, then free the length from SimpleGattProfile_readAttrCB. It caused memory corruption. 

    Regards,
    Kevin

  • Hi Kevin,

    Thank you so much for your reply.

    From my understanding, it should return an Error code rather than entering hard fault/getting memory corruption. Will we fix it in the next SDK?

    Best Regards.

    Connor.

  • Connor,

    Yes, I file a bug, we will fix it in the next sdk

    Regards,
    Kevin