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

Maximizing UART over BLE throughput

Hi,

I have a question regarding our approach to achieving high throughput UART transmission over BLE.

The protoboards we are currently testing have BL654 modules from Laird which use the nRF52840 SoC with the following setup:
 - nRF5SDK v16.0.0
 - Soft Device s140 v7.0.1
 - Segger embedded studio IDE
 - MSP432 communicating with BL654 via UART <-> BL654 communicating with gateway SBC

We have tested "ble_app_att_mtu_throughput" and have been able to achieve ~340Kbps between two nrf52840 DK boards with the default configuration as listed here. This is a reasonable speed using 2Mbps PHY. Of course we were hoping to achieve maximum throughput (~1Mbps) line-of-sight using UART profile as was done in the nRF52 image transfer demo.

The sample code we have modified to transfer high-density sensor data (~100kB) from a wireless sensor to a gateway were based on: 
 - ble_app_uart_c (gateway)
 - ble_app_uart (sensor)

The host microcontroller is sending ~100kB of binary data via UART to the BLE module at max 460800 baud 8N1, which is still taking ~40 seconds to send. Repeating the test using two DK's and sending a binary file via realterm takes approximately the same time. Obviously this is a bit longer than the expected 3 seconds (800K bits / 340Kbps = 2.5 seconds). However, this may due to the fact that the only code modification we have made thus far is to set the PHY from auto to 2Mbps which has not yielded any different throughput results.

            NRF_LOG_DEBUG("PHY update request.");
            ble_gap_phys_t const phys =
            {
                .rx_phys = BLE_GAP_PHY_2MBPS, /* was BLE_GAP_PHY_AUTO - 4-22-20 */
                .tx_phys = BLE_GAP_PHY_2MBPS, /* was BLE_GAP_PHY_AUTO - 4-22-20 */
            };
            err_code = sd_ble_gap_phy_update(p_ble_evt->evt.gap_evt.conn_handle, &phys);
            APP_ERROR_CHECK(err_code);

Not being a BLE expert myself, I would likely proceed by diff'ing the projects, (ble_app_att_mtu) and (ble_app_uart), and modifying ble_app_uart configuration to achieve a higher throughput. Is this a good approach? Assuming the setup which was described above, what do you suspect is the highest possible throughput using the Nordic UART profile? 

We have not yet implemented flow control (RTS/CTS) but are in process of doing so due to dropped packets we are seeing and, if ultimately necessary, we could transmit data from our sensor's host processor to BL654 via SPI for increased speed. Any additional advice or examples would be much appreciated.

Thank you for your assistance.

Regards,

Rob

Parents
  • We have tested "ble_app_att_mtu_throughput" and have been able to achieve ~340Kbps between two nrf52840 DK boards with the default configuration as listed here. This is a reasonable speed using 2Mbps PHY. Of course we were hoping to achieve maximum throughput (~1Mbps) line-of-sight using UART profile as was done in the nRF52 image transfer demo.

     The default GAP data length in the Throughput example is 27, so oncreasing the GAP data length should result in a higher throughput.

    Not being a BLE expert myself, I would likely proceed by diff'ing the projects, (ble_app_att_mtu) and (ble_app_uart), and modifying ble_app_uart configuration to achieve a higher throughput. Is this a good approach? Assuming the setup which was described above, what do you suspect is the highest possible throughput using the Nordic UART profile? 

    Yes, comparing the two projects and using the same settings as the Throughput example in the ble_app_uart example is a good approach.  

    The ble_app_uart example uses notifications to send the data from the peripheral to the central. Looking at the Bluetooth Low Energy data throughput in the S140 SoftDevice Specification, the highest achievable throughput with a single connection,  ATT MTU = 247, GAP data length = 251 and a connection interval of 50ms is 1327kbps with the 2M Phy and 702,8kbps with the 1M Phy

    Best regards

    Bjørn

Reply Children
No Data
Related