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

Question regarding the transfer speed of the BLE on nrf52832 using nordic uart service

Hi Everyone

I have been trying to send a text file(reading from SD card) , The size of the file is 2MB. 
I am using softdevice s132 for nrf52832 to transfer the text file via the Bluetooth to the Android application(nrf Connect). 
I am able to transmit the file to the nrf connect app , but the problem is that the transfer is too slow , it gives me an average speed of around 20KBPS , which is very less for our application.

What  i would like to know is 
1. Is there any specification of the softdevice which i should enable to receive the maximum throughput(or atleast 3/4th of it). 
2. Is it related to the service that i am using , I am using Nordic Uart Service. 

Here are the settings that i have been using
PHY - LE 1M for both Tx and Rx
Here is a log file , i am attaching , if that helps.

5001.Log 2020-10-07 12_34_02.txt

Parents Reply Children
  • Most phones will only use 7.5m connection interval when connecting, and after service discovery is done, change it to a higher value.

    On Android you can “Request connection priority”,

    High: 11.25 – 15 ms

    Balanced: 30 – 50 ms

    Low Power: 100- 125 ms

    But you can also adjust the CONN_INTERVAL_MIN , and CONN_INTERVAL_MAX in your application, and then the Connection Parameters module will request a connection interval between the min/max values. But ultimately, it’s the central device that decides the connection interval.

    You can try to change the PHY from the phone, or request 2M PHY some time later from your application. Some phones does not seem to accept a PHY change before service discovery is done.

    Here is some code you can use to request a PHY change from your application:

    APP_TIMER_DEF(m_phy_update_delay_timer_id);                           /**< PHY update timer. */
    
    
    static void phy_update_delay_timeout_handler(void * p_context)
    {
        UNUSED_PARAMETER(p_context);
    
        NRF_LOG_DEBUG("PHY update request.");
    
        ble_gap_phys_t const phys =
        {
            .rx_phys = BLE_GAP_PHY_2MBPS,
            .tx_phys = BLE_GAP_PHY_2MBPS,
        };
    
        if(m_conn_handle != BLE_CONN_HANDLE_INVALID)
        {
            uint32_t err_code = sd_ble_gap_phy_update(m_conn_handle, &phys);
            APP_ERROR_CHECK(err_code);
        }
    
       
    }
    
    
    in timers_init(), add
    
        err_code = app_timer_create(&m_phy_update_delay_timer_id,
                                    APP_TIMER_MODE_SINGLE_SHOT,
                                    phy_update_delay_timeout_handler);
        APP_ERROR_CHECK(err_code);
    
    
    
    in ble_evt_handler() , under case for BLE_GAP_EVT_CONNECTED
    
                err_code = app_timer_start(m_phy_update_delay_timer_id, APP_TIMER_TICKS(7000), NULL);
                APP_ERROR_CHECK(err_code);

Related