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

how to make UART throughput match that of ATT_MTU

Based on my experiment, ATT_MTU sample application can achieve throughput of 900 Kbps with the following settings:

  • SDK 14.2.0
  • ATT MTU size: 247
  • Connection interval: 6 units
  • Data length ext: on
  • Connection length ext: on
  • Connection interval 7.5ms
  • Preferred PHY: 2 Mbps

However, when I tested throughput with UART sample code, I can achieve 150 Kbps

  • SDK 12.0.0
  • DLE enabled
  • MTU size: 150
  • Connection interval 7.5 ms
  • PHY: default, not sure how much

I had problem changing MTU to 250, not enough RAM. But even with MTU 150 bytes, the throughput is much lower.

My questions is how to make UART throughput match that of ATT_MTU? Comparing the above settings, I guess maybe I should

  • Use SDK 14.2.0
  • Set PHY rate to 2M
  • Enable connection length ext

Anything else?

uart_peripheral.zip

  1. I just reused the sample UART peripheral code with BLE_GATT_ATT_MTU_DEFAULT to 247. RAM start and size are set to proper values; nrf_sdh_ble_enable() success.
  2. At peripheral node, upon event BLE_GAP_EVT_CONNECTED, call sd_ble_gap_data_length_update(conn_handle, NULL, NULL)
  3. At central node, upon event BLE_GAP_EVT_DATA_LENGTH_UPDATE_REQUEST, call sd_ble_gap_data_length_update(conn_handle, NULL, NULL)
  4. At peripheral node, upon event BLE_GAP_EVT_DATA_LENGTH_UPDATE, log effective_params.max_rx_octets and effective_params.max_tx_octets
  5. At central node, upon event BLE_GAP_EVT_DATA_LENGTH_UPDATE, call ble_db_discovery_start().

Central and peripheral nodes can establish connection and the ATT MTU exchange also looks OK.

ble_gatt: Data length updated to 251 on connection 0x0.

ble_gatt: max_rx_octets: 251

ble_gatt: max_tx_octets: 251

ble_gatt: max_rx_time: 2120

ble_gatt: max_tx_time: 2120

ATT MTU exchange completed. central 0xF7 peripheral 0xF7

app: Data length updated to 251 bytes.

app: GAP_EVT_DATA_LENGTH_UPDATE Peripheral

app: ATT MTU 251, 251

The above is log message from peripheral node.

However, when I tried sending large packet (--247), the receiver side still gets 20 bytes.

Parents
  • We have measured a maximum throughput of 1376.2 kbps (one way), see this.

    If you don't have any packet loss a connection interval of 400 ms is more efficient than 7.5 ms.

    With the ble_app_uart example you should use an ATT MTU of 247 and LL payload size of 251 (using data length extension). In addition to using 2Mbps mode, enable connection length extension, and a connection interval of 400 ms. And of course sending enough data.

    You should be able to increase the ATT MTU over 150 if you increase the event length. Just increase NRF_SDH_BLE_GAP_EVENT_LENGTH. Set it equal to the connection interval, 300 = 400 ms /1.25 ms

  • I have been testing the UART sample. My problem is after increasing BLE_GATT_ATT_MTU_DEFAULT to 247, the peripheral app gets stuck at nrf_sdh_ble_enable(). I tried increasing IRAM1 size by 0x400 (1025), it still cannot pass nrf_sdh_ble_enable().

Reply Children
No Data
Related