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

BLE data transfer speed issues with nRF52840

Hi, I want to measure the data transfer speed of BLE. I  use the nRF52840 DK with the ble_app_uart example

I created a dummy string of 20 bytes (default length of one packet) and I send the string again and again in an endless loop. 

Every time the string is  transferred to the android smartphone, I invert the state of an output pin on the DK so that I can measure

the frequency (speed) with the oscilloscope.

After connecting the DK to the smartphone, data transmission starts and I can observe the data coming on my smartphone BLE uart application.

At the same time I take measurements from the inverting output pin with the oscilloscope and I have noticed a few things that I cannot explain.

BLE Settings are : MAX_CONN_INTERVAL = 20, MIN_CONN_INTERVAL = 10, PHY= 2Mbps,

1. For the period of one connection interval only a  few transmissions occur at the beginning and for the rest of the connection interval no transmission takes place until the next interval.

2. When I remove the  do{}while (err_code == NRF_ERROR_RESOURCES) check which includes the ble_nus_data_send() , then the transmissions occur for the whole length of the connection interval.

 Why this do{}while (err_code == NRF_ERROR_RESOURCES) check  occupies such a big chunk of the connection interval period?

3.The theoretical speed is 250kBps (PHY2) but I can transfer only 30kBps. Why is that? I expected  it to be much higher...

4. I read that in order to transmit more data I must enable the DLE function of BLE so that I can send up to 251 bytes in one transfer packet. How can I do that in the example?

5. Is there something else that I should take care of in order to come closer to the speed  of 250kBps?

Related