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.

CC2564C: Audio quality getting bad when we get BTPS_ERROR_INSUFFICIENT_BUFFER_SPACE

Part Number: CC2564C
Other Parts Discussed in Thread: CC2564

Hi

I am using the CC2564 module interfacing with the STM32F413 MCU.

In my application the device need to connect with a phone and need make a phone call by using CVSD.

We have observed that sometimes the function HFRE_Send_Audio_Data() keep giving an error with BTPS_ERROR_INSUFFICIENT_BUFFER_SPACE. And when we get this error the audio quality getting bad.

We have tried two different methods to remove this buffer overflow issue 

1. We have tried to call a function SCO_Purge_Buffer(BluetoothStackID, SCO_Connection_Handle, SCO_PURGE_MASK_TRANSMIT_ABORT_BIT); when we get this error (BTPS_ERROR_INSUFFICIENT_BUFFER_SPACE). But this function gives an error BTPS_ERROR_INVALID_PARAMETER. 

Why is this function gives an error BTPS_ERROR_INVALID_PARAMETER?

2. If we get an error BTPS_ERROR_INSUFFICIENT_BUFFER_SPACE then wait for the etSCO_Transmit_Buffer_Empty_Indication Event before trying to send any more data.

This method also not helping to stop giving the BTPS_ERROR_INSUFFICIENT_BUFFER_SPACE. Once it starts giving an error then it will keep coming for sometime.

Is there any other option to avoid this BTPS_ERROR_INSUFFICIENT_BUFFER_SPACE error ?