cancel
Showing results for 
Search instead for 
Did you mean: 

Using notifications and getting BLE_STATUS_INSUFFICIENT_RESOURCES.

Louis Loving
Senior

We are using an STM32WB55CG and trying to send 207 bytes of data every 40ms. I can see that data length extension has been enabled and the packets are not fragmented. We are getting the error returned BLE_STATUS_INSUFFICIENT_RESOURCES on average about once a second.

Is there anything that can be done to increase the amount of resources available?

Any tips on what I can do to eliminate this error?

Thanks!

6 REPLIES 6
Remi QUINTIN
ST Employee

​Extract from AN5270 p 101:

>>

ACI_GATT_UPDATE_CHAR_VALUE

Description

Update a characteristic value in a service. If notifications (or indications) are enabled on that characteristic, a

notification (or indication) is sent to the client after sending this command to the STM32WB. The command is

queued into the STM32WB command queue. If the buffer is full, because previous commands could not be still

processed, the function returns BLE_STATUS_INSUFFICIENT_RESOURCES. This happens if notifications (or

indications) are enabled and the application calls ACI_GATT_UPDATE_CHAR_VALUE at an higher rate than

what is allowed by the link. Throughput on BLE link depends on connection interval and connection length

parameters (decided by the master, see aci_l2cap_connection_parameter_update_request() for more info on how

to suggest new connection parameters from a slave). If the application does not want to lose notifications

because STM32WB buffer becomes full, it has to retry again till the function returns BLE_STATUS_SUCCESS or

any other error code.

<<

So this means that the link is not fast enough.  One way to avoid this overfow would be to increase the size of  the queue.

Louis Loving
Senior

How do you increase the size of the queue?

Thanks!

Remi QUINTIN
ST Employee

In fact it is not easy to increase the command queue. The best is to manage the events notifying the availability of the buffers.

Roughly you have to stop any transfer until you get the EVT_BLUE_GATT_TX_POOL_AVAILABLE (EVT_VENDOR) event.

Have a look at the BLE_DataThroughput project here:

C:\STM32Cube_FW_WB_VX.Y.Z\STM32Cube_FW_WB_V1.3.0\Projects\P-NUCLEO-WB55.Nucleo\Applications\BLE\BLE_DataThroughput

This is an example of data throuput management.

0690X00000AtGGoQAN.bmpIn this screen shot, trace 2 (the blue trace) goes high whenever we get the BLE_STATUS_INSUFFICIENT_RESOURCES error. Trace 2 goes low whenever we get EVT_BLUE_GATT_TX_POOL_AVAILABLE so that we may resume BLE transmission. Trace 1 (the yellow trace) changes state after each successful transmission.

As you can see we are running out of resources quite often and, occasionally, for extended (close to 100 ms) periods of time.

Are we overrunning the command queue this often?

Would adjusting our link interval timing possibly help this?

Is there anything beyond slowing down our transmission rate that could help here?

This project was based on the Data Throughput example but with the hope of not having to throttle the transmission.

Thanks.

Hi! I have the same issue.

I send 243 bytes every 20 ms and get BLE_STATUS_INSUFFICIENT_RESOURCES. This is a very low throughput < 100 kbit/s. According to bluetooth specification a throughput could be up to 1 Mbit/s or 2Mbit/s in bluetooth 5.

Have you achieved some success in this problem?

If you got a result, could you please let me know what did you do?

Thanks.

KOr.1
Associate

I have the same problem. When sending number of 232 bytes blocks, I frequently get BLE_STATUS_INSUFFICIENT_RESOURCES. I can only get it going by providing at least 100msec delay and retry. It seems the tx throughtput is low. Can someone tell if this can be improved?

Thanks

Kerem