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

Increase data speed in NUS nRF52

Hey,I've a string of less than 10 bytes (10 characters max) and I'm establishing the connection between the Central (nRF52833-DK) and the Peripheral (nRF52810) and I've set-up the NUS bridge for the data-transfer.The problem is, I've not satisfied with the speed of the data-transfer, can you help me with how I can achieve the maximum speed in NUS? The expectation is under 4ms for this 10 bytes string.Awaiting your response.

Parents Reply
  • Hi any update for previous message

    i found this example in devzone

    ble_app_uart_throughput_test.zip

    static void send_data()
    {
        static uint8_t counter;
        static uint8_t data_array[BLE_NUS_MAX_DATA_LEN];
    
        uint32_t       err_code;
        uint16_t       length = m_ble_nus_max_data_len;
    
       
        err_code = ble_nus_data_send(&m_nus, data_array, &length, m_conn_handle);
        if (err_code == NRF_SUCCESS)
        {
             m_tot_num_bytes += length;
             data_array[0]=counter++;
        }
    
    }

    for the above lines i got nearly 282KBPS

    I changed the lines to my defined one

    static void send_data()
    {
        static uint8_t counter;
        static uint8_t data_array[BLE_NUS_MAX_DATA_LEN];
    
        uint32_t       err_code;
        uint16_t       length = m_ble_nus_max_data_len,length1;
        char str[20];
        length1 = sprintf(str, "%d,%d\n",counter,counter+1);            
        err_code = ble_nus_data_send(&m_nus, str, &length1, m_conn_handle);            
        m_tot_num_bytes += length1;
        counter++;
    }

    I got 23KBPS

    How do I increase the speed of it ?

Children
Related