This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

NRF_ERROR_RESOURCES error

I'm trying to send data from an IMU at about 50Hz over BLE to a smartphone. I'm finding that after some number of successful transmissions, I start to get the NRF_ERROR_RESOURCES error returned from sd_ble_gatts_hvx().

My understanding is that each buffer I try to send with sd_ble_gatts_hvx() goes into a queue until it is actually sent, and this error indicates that the queue is full.  The fact that I am able to send a bunch of buffers successfully before I start to see errors suggests to me that the throughput is too low (that is, the buffers are being sent too slowly, so the queue of unsent buffers fills up, and once it's full I start to see the errors).

My program is based off the ble_app_template example.  With the default settings I was able to send about 90 samples before I start seeing errors. Based on some questions from other people about this error I saw on this forum, I played around with the NRF_SDH_BLE_GATT_MAX_MTU_SIZE and NRF_SDH_BLE_GAP_EVENT_LENGTH values in sdk_config.h, and while this did increase the number of messages successfully sent at the beginning, I still start to see the NRF_ERROR_RESOURCES after 200 or so samples.

Is there something I can do to increase the rate at which the samples are being transmitted?  Or is there some other problem?

I'm using SDK 16.0 and SoftDevice 132.

Related