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

Ble_nus slows down after 30 seconds.

I am sending task notification from nus_data_handler when in get BLE_NUS_EVT_TX_RDY event

In a seperate task , i am sending  ble packets (244bytes) by using ble_nus_data_send...

It works up around 22000bytes/second for the first 30 seconds after that , BLE_NUS_EVT_TX_RDY event lagging and transfer speed reduces to the around 2000bytes/sec.

I am using nrf52832 ,SES , android samsung note 9.

Where should i look at ? 

Max and min conn interval settings are 47.5ms both.

but it seems android phone only allows 100ms intervals because if i sent only one packet at a time BLE_NUS_EVT_TX_RDY comes after 80-100ms after calling ble_nus_data_send.

Best regards.

  • Hi,

    I see a few very relevant defines here. Specifically, you have configured a 400 ms connection interval. What happens if you set MIN_CONN_INTERVAL and MAX_CONN_INTERVAL to (say) MSEC_TO_UNITS(30, UNIT_1_25_MS) instead of MSEC_TO_UNITS(400, UNIT_1_25_MS)?

  • The problem solved as I implement your suggestion. so what is going on here? When I set it to 400, tx speed slows down after approximately 16 seconds, when I set it to 30, I have tested for 5min continuously and there is no significant slowdown issue. I can understand if 400ms setting would be the reason of low throughput but i really can not figure out why it slows down after 16 seconds.

  • Hi,

    MCB said:
    but i really can not figure out why it slows down after 16 seconds.

    You need to add more logging or use a sniffer trace to answer that question properly. The reason is that the nRF can only request connection parameters when it is a peripheral, and it is the central (phone) that decides. So you need to look at what happens on the link layer to know why the connection parameters are adjusted to what and when. But it is clear that you had configured the nRF to request a 400 ms connection interval, so the only thing that you don't know is why it toke this long time before it happened.

Related