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.

Related