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

Trying to achive max data rate with PCA10028

Hi, i have a NRF51-DK (nRF51822 - PCA10028) board and using SDKv10 with SoftDevice S110. I read everything i could find about this topic and i see people claiming data rate of at least 2KByte in worst case, but what i get is quite lower.

I started from the ble uart peripheral example, deleted everything uart-related to use only the nus and send runtime-generated data directly from the firmware. So when a button is pressed i call a data_send() function, and when i get the BLE_EVT_TX_COMPLETE event, i call data_send again. Every call to data_send changes the first character of the message sequentially.

These are the connection parameters i have used:

#define MIN_CONN_INTERVAL               MSEC_TO_UNITS(7.5, UNIT_1_25_MS)   
#define MAX_CONN_INTERVAL               MSEC_TO_UNITS(40, UNIT_1_25_MS)    
#define SLAVE_LATENCY                   4     
#define CONN_SUP_TIMEOUT                MSEC_TO_UNITS(4000, UNIT_10_MS)    
#define MAX_CONN_PARAMS_UPDATE_COUNT    3

Doing so i get around 300 byte per second. Reducing MAX_CONN_INTERVAL to 20 gave me around 500byte per second, but i can't leave that because it would cause problems with IOS devices supporting a minimum of 30ms connection interval. To test the speed i used an Android device and different apps that display data received through notification (even Nordic UART v2).

image description

I read topics where people talked about multiple packet per connection inteval, but if i undestood correcty that's something doesn't regard firmware developing but the client device. Even so i tried to call data_send() 4 times every BLE_EVT_TX_COMPLETE event, and doing so i got around 1Kbyte but losing some packets.

image description

image description

So, does someone know how i can speed up it?

  • To speed up the transfer rate I would recommend that you fill the TX buffers between connection event. So instead of placing 4 packets per connection event, you should continue to send date a until you get the BLE_ERROR_NO_TX_PACKETS error. iOS supports up to 6 packets per connection event @ 30 ms intervals (note that I haven't tested the latest version).

    You can also try to get a faster connection interval (Note that we have seen that throughput has actually been reduced on some iOS versions doing this as the number of packets per connection event is/was reduced.) Try asking for min 12.5 - max 22.5 ms or min 15 - max 25 ms or something similar.

  • Hi, didn't found any BLE_ERROR_NO_TX_PACKETS but doing:

    while(ble_nus_string_send(&m_nus, buffer_str, BUFFER_STR_SIZE) == NRF_SUCCESS)
    

    Fixed the packet loss and i got around 1Kbyte, enough for me. Thanks.

Related