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

ble_app-uart example - ble_nus_data_send() - BLE_NUS_EVT_TX_RDY - connection interval

I am sending 240-byte data from peripheral to central through notification (without response) by using the ble_nus_data_send() function when the BLE_NUS_EVT_TX_RDY event comes. The issue here is the BLE_NUS_EVT_TX_RDY is triggering 2x times of connection interval.
eg: If we put connection interval 7.5 then the event BLE_NUS_EVT_TX_RDY will trigger every 15 ms only.

parameters being used

nRF5 SDK v17.0.2

NRF_SDH_BLE_GAP_DATA_LENGTH 251

NRF_SDH_BLE_GATT_MAX_MTU_SIZE 247

NRF_SDH_BLE_GAP_EVENT_LENGTH 400

and also am using the conn_evt_len_ext_set() function.

why is that event BLE_NUS_EVT_TX_RDY is triggering 2x time of connection interval?

here I attached the sniffer log

Parents
  • Hi AKV, 

    We need to look at how your queue the data for sending. 


    From the sniffer trace what I can read is that the notification queue was not full, and it seems that you wait until you receive BLE_NUS_EVT_TX_RDY event before you queue the next one. When you queue data, you would need to queue until the buffer is full (until you receive NRF_ERROR_RESOURCES error code). 
    If you only queue one packet per BLE_NUS_EVT_TX_RDY event, what showed in the sniffer trace is expected. The chip send one packet, the packet get ACKed (in the next event) then you queue the next packet. This explain the 2x time of connection interval. 

  • Thanks for the reply..

    yes, I am sending data as you said only queue one packet per BLE_NUS_EVT_TX_RDY event,

    1. The data is sending from peripheral to central via notification. The notification does not have any response or acknowledgment from central right? Then why it takes the next event to give BLE_NUS_EVT_TX_RDY?

    2. Is the NRF_ERROR_RESOURCES mean that the buffer of the softdevice/stack is full right?

Reply
  • Thanks for the reply..

    yes, I am sending data as you said only queue one packet per BLE_NUS_EVT_TX_RDY event,

    1. The data is sending from peripheral to central via notification. The notification does not have any response or acknowledgment from central right? Then why it takes the next event to give BLE_NUS_EVT_TX_RDY?

    2. Is the NRF_ERROR_RESOURCES mean that the buffer of the softdevice/stack is full right?

Children
Related