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.

CC2340R5: CC2340 MvGatt_ChangeCB Missing Data on Fast Writes

Part Number: CC2340R5
Other Parts Discussed in Thread: CC2541

Tool/software:

I am experiencing an issue with the BLE Stack, when we have a APP on an IOS / ANDROID device sending fast writes to the device.

Using the Send Write (Without RSP),  it is possible to affectively blast a block of writes to the CC2340 Peripheral Device, which we use for data transfers.
This method has been really affective solution for us with the old CC2541. 

However with the new stack on the CC2340, I can see packet on the radio in sequence, but it looks like by the time the Callback - MvGatt_changeCB() gets processed the data
for the data in the characteristic has been overwritten before we are able to read it using MvGattProfile_getParameter().

I can't work out if it is just the speed of the stack itself - or perhaps if these callbacks are affectively running under RTOS control, the tasks context switching isn't fast enough.

Any TI experts who might be able to help.

Best Regards


Rob

  • Hello Rob,

    Thanks for reaching out.

    What SDK version are you using? are you buffering your profile characteristic data?

    How much data are you sending and how fast?

    BR,

    David.

  • Hi David,

    The SDK is F3 8_10_01_02

    I have now managed to resolve this and worked out what is going on using some IO pins to collect timing data.

    The data block we send is 16 bytes. Typically with a SendWrite method between 3 and 5 blocks can occur in one connection interval.

    It seems the methods used in the example stack are fairly slow. The technique of executing the Call-back xxx_writeAttrBC() to receive the characteristic data, and then raising a notifyApp back to the App to use the data is very slow. I have modified this to utilise a safe ringbuffer method to prevent data loss.

    The data in the profile characteristic data placeholder is getting overwritten by the Callback before the APP methods to handle to notification of data received is executed.

    It is pretty nuts when you look through all the code paths Functions Calls / Stack Overheads / Mallocs / Free when really its faster just to work with the 16 bytes data in safe manor from the outset. I'd personally much rather have all that processor execution cycles free for processing activities.

    Br

    Rob