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.

CC2640: PREPARE_QUEUE_FULL using BLE Stack 2.2.1 and ProjectZero

Part Number: CC2640


I am trying to write a 251 byte characteristic from my ios device to my CC2640.

I am using a modified SimpleLink Academy ProjectZero.

I have set a predefined symbol in BLE stack project of MAX_PDU_SIZE = 255

All other threads regarding PREPARE_QUEUE_FULL seem to relate to different BLE stacks and/or sample projects, with hints that this issue would be addressed in future stacks.

In my case, I can confirm that the ios device sends the characteristic using my sniffer.

After a few packets, the BLE stack sends back a PREPARE_QUEUE_FULL error:

In searching the stack code, I find in att.h:

#define ATT_ERR_PREPARE_QUEUE_FULL       0x09 //!< Too many prepare writes have been queued

But, this in not used anywhere in the stack code.

How can I increase the PREPARE_QUEUE ?

Do I have to negotiate with ios device on size limits, if so, how do I use GATT_ExchangeMTU() and with what input values to it?

Thanks,

Dale

  • Sorry, but I had to move on. I decided to have my ios App send out the characteristic split into three 86 byte portions and then reassembled them in my CC2640 project code (looks like 90 bytes was the limit before you have to change the defaults to write to the CC2640 with larger characteristics).

    I am still interested in the answer to this since there must be a way, but I could not find the resources to accomplish this at my skill level.

    Dale
  • Hello Dale,

    iOS devices up to iPhone 6S typically perform an Exchange MTU with client setting of 158 bytes. iPhone 7 is much larger.

    For changing the size of the Prepare Write Queue, see the section "5.3.4.3 Queued Writes" in the SWRU393 SDG.
    "Adjust the Prepare Write queue with GATTServApp_SetParameter with parameter
    GATT_PARAM_NUM_PREPARE_WRITES. There is no specified limit, but it is bounded by the available
    HEAPMGR space. Refer to the API definition in gattservapp.h."

    Best wishes