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

nRF51822 S110 - TX Buffer leak when disconnected by Central?

I have a problem within the following szenario:

  • I transfer data from my nRF51822 Peripheral to a connected Central (Android App) as a bunch of Notifications with maximal throughput (sending Notifications until sd_ble_gatts_hvx() returns BLE_ERROR_NO_TX_BUFFERS). Using my Samsung SM-P605 (Android 4.3) as Central, this transfers about 4 packets for each connection interval.
  • During this »full power data transfer«, the Central initiates a disconnect
  • When now doing a new connection between Central and Peripheral, the data transfer became very slow. In each 2nd connection interval there is only 1 notification packet transfered.
  • When performing an additional disconnect / reconnect, the transfer looks good as the at the 1st connect.
  • I'd tested with some different Android Centrals (different devices like Samsung, Nexus, Sony, Htc and different Android versions 4.3, 4.4.2 and 4.4.3) all with the same behaviour. So my conclusion is, that the problem seems to be on the peripheral's side (I'd also analyzed some sniffed communication logs and I come to the same result).

It looks, that the Softdevice don't releases all of it's Tx buffers when the Central initiates a disconnection.

Looking for an Api call to determine the number of free buffers results just in

sd_ble_tx_buffer_count_get()

with a description of an IMHO a bit error-prone way (counting some different circumstances) to get the number of free buffers.

So what can I do to make all Tx buffers released / available on disconnect (or on next connect)?

  • Yep, reboot nRF51822 helps (as I tested this), but that's not a solution for my application.
  • Maybe reinit of the Softdevice could help? I don't tested this until now as I think this also as an ugly workaround.

May there be an Api call like "release / discard all tx buffers()"?

My development details:

  • Softdevice S110 Version 6.0.0
  • Nordic Sdk 5.2.0
  • Gcc 4.8.3 (gcc-arm-none-eabi-4_8-2014q1)
Parents
  • Hi Joe,

    Thanks for the detailed report. We are currently looking into this.

    UPDATE:

    We have analyzed the issue and can confirm that it is indeed present. However, this is not considered critical at this point because the invalid buffer handling is reset after a subsequent reconnection and disconnection. The best way to avoid being affected by the issue is to regularly check for BLE_GAP_EVT_DISCONNECTED events while sending data, so that the interval between the actual disconnection of the link and the moment the application realizes it and stops sending data is as short as possible.

    Unfortunately your report came too late to include this in the upcoming 7.0.0 release, but it will be corrected internally and be included in all future S110 releases.

    I would like to thank you for your help in uncovering this problem, and hope you can work around it as best as possible until a complete fix is available.

    Please let us know if you need more information.

    Carles

  • Could you confirm that this issue is fixed in current S110 V7.1.0?

Reply Children
No Data
Related