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

BLE_GATTS_EVT_HVN_TX_COMPLETE not called after NRF_ERROR_RESOURCES

Hi everyone,

I work on an custom board with the nrf52840, the SDK 15.2.0, the SoftDevice 140 6.1.0 and FreeRTOS.

My problem is that during a BLE transfert of a lot of small packets (16 Bytes) I go stuck in the do while loop with sd_ble_gatts_hvx().

The context is that we ask on mobile phone side the donwload of the data. On each BLE_GATTS_EVT_HVN_TX_COMPLETE event we send a new packet on a queue.

We run a task which dequeue all notification to send them over the sd_ble_gatts_hvx() function.

During the process of sending we use a do-while loop as suggested in few other topics.

But the problem is that there is a moment the notification are not send any more. We have an NRF_ERROR_RESOURCES and we don't receive any BLE_GATTS_EVT_HVN_TX_COMPLETE event after this error occured so even if we wait for BLE_GATTS_EVT_HVN_TX_COMPLETE we are not able to continue any ble transfert.

Is anyone have a idea why ?

The softdevice task run with a priority of 3 (in FreeRTOS) and other task run with a priority of 2.

Thanks in advance for any response.

Etienne D

Parents
  • Hi Etienne

    What is the conditions for exiting the loop where you are sending notifications?

    The recommended way to maximize throughput is to upload notifications continuously until the NRF_ERROR_RESOURCES error occurs. Then you should stop calling the sd_ble_gatts_hvx() function until the BLE_GATTS_EVT_HVN_TX_COMPLETE event occurs, at which point the stack will be ready to accept more packets. 

    Best regards
    Torbjørn

Reply
  • Hi Etienne

    What is the conditions for exiting the loop where you are sending notifications?

    The recommended way to maximize throughput is to upload notifications continuously until the NRF_ERROR_RESOURCES error occurs. Then you should stop calling the sd_ble_gatts_hvx() function until the BLE_GATTS_EVT_HVN_TX_COMPLETE event occurs, at which point the stack will be ready to accept more packets. 

    Best regards
    Torbjørn

Children
Related