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

how to increse the ble rate between the 52840 centarl and 52840 device ?

hi .i use the pca10056 connect to th nrfconnect by usb .andr dun the app Bluetooth low energy.other 52840 device run the hex of \nordic

sdk\nRF5_SDK_16.0.0_98a08e2\examples\ble_peripheral\ble_app_uart.and i modify some para in the project ble_app_uart.


#define NRF_SDH_BLE_GAP_DATA_LENGTH 251
#define NRF_SDH_BLE_GATT_MAX_MTU_SIZE 247
#define MIN_CONN_INTERVAL               MSEC_TO_UNITS(30, UNIT_1_25_MS)
#define MAX_CONN_INTERVAL               MSEC_TO_UNITS(75, UNIT_1_25_MS)

#define NRF_SDH_BLE_GAP_EVENT_LENGTH 24


and in main loop
 do
 { 
 err_code = ble_nus_data_send(&m_nus, data_array, &length, m_conn_handle);
 if ( (err_code != NRF_ERROR_INVALID_STATE) && (err_code != NRF_ERROR_RESOURCES) &&
 (err_code != NRF_ERROR_NOT_FOUND) )
 {
 APP_ERROR_CHECK(err_code);
 }
 if (err_code == NRF_SUCCESS)
 {
 count ++; 
 data_array[0]++;
 data_array[length-1]++; 
 
 if(count>1678)
 {
 NRF_LOG_INFO("end send ");
 flag=0;
 break;
 }
 
 }
 } while (err_code == NRF_SUCCESS);



i discover that the rate between the device and the pac10056 is so slow that the time of send 400KB data is 1 min.

but the same hex program into the pac10056,and connected by nrfconnect of a Android phone .transfer 400KB data use 8s.

the rate looks nice,but it also not arrive the speed of 2M.

so my problem is :

No.1 :how to set the rate to 2Mbps ?


I know the device can change the rate by the callback BLE_GAP_EVT_PHY_UPDATE_REQUEST,if i want to set the rate to 2Mbps once the device init ,

if i callthe api sd_ble_gap_phy_update in the init time can do that ?

and the speed i can run is 50KB /s. it is far from the theoretical value, so what should ido continue to immprvo my data rate?



No.1 :what shuold i do to arrive the fastest ble speed by project

\nRF5_SDK_16.0.0_98a08e2\examples\ble_peripheral\ble_app_uart

and

\nRF5_SDK_16.0.0_98a08e2\examples\ble_central\ble_app_uart_c\

?


  • Hello,

    The smallest code-changes you can make for the biggest gain in throughput speed that you can make is to reduce your connection interval.
    Your current connection interval is set from 30 ms to 75 ms, which is a lot higher than the 7.5 minimum connection interval.
    If you are only going to be connected to a single peripheral, you could set it to the minimum 7.5 ms, to maximize how often your devices will be communicating with each other. You can implement this change by setting both MIN_ and MAX_CONN_INTERVAL to 7.5 ms on your central device, configured in the sdk_file of the Nordic UART example. If you do this, then you also need to make sure that your peripheral device supports 7.5 ms connection interval.
    Bear in mind that decreasing the connection interval increases the active radio time, leading to increased power consumption.

    If you would like to have a look at a maximum-throughput example using the new 2Mbps limit of BLE 5.0, you should take a look at this image transfer demo. It will require a higher effort to familiarize with than the Nordic UART example, but in return it demonstrates the highest speeds you may obtain using BLE.

    Best regards,
    Karl

  • Hi,

    thank for your reply,i try to change the min intercal and max interval,the value is 7.5ms,the rate is really improved.and

    400KB data tranfer takes 6s. it also is low compare to theoretical value. i chek my phone,the connect interval is 7.5ms by

    the log of nrfconnect.But the ble_central's demo cant transfer data as this speed.

  • Hello,

    pipixia_8_8 said:
    thank for your reply

    No problem at all, I am happy to help!

    pipixia_8_8 said:

    ,i try to change the min intercal and max interval,the value is 7.5ms,the rate is really improved.and

    400KB data tranfer takes 6s. it also is low compare to theoretical value.

    I am glad to hear that you were able to increase your throughput.

    pipixia_8_8 said:
    But the ble_central's demo cant transfer data as this speed.

    What do you mean by this?
    Are you able to transfer the 400 KB between your phone and the peripheral, but unable to achieve the same throughput between the Nordic UART central example and peripheral example - is this what you are saying?

    Best regards,
    Karl

  • No problem at all, I am just trying to understand you issue so that I may help with resolving the issue :)
    If you could elaborate on what behavior you are seeing, and how it is different from what you would have expected - along with the things I asked about in my previous comment - that would be highly beneficial.

    Looking forward to resolving this issue together,

    Best regards,
    Karl

Related