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

What is the most efficient way to transmit hex bytes over BLE? I'm aiming for 1.1 Mbps

Hi,

I'm trying to write firmware for the nrf52840 that reads from a sensor and then sends data to a PC over BLE. Ultimately, I need the BLE link to achieve ~ 1.1 Mbps throughput (which is doable with BLE 5 from my understanding).

Right now I'm stuck at around 100 kbps and am looking for pointers on how to improve this. I've increased my NRF_SDH_BLE_GATT_MAX_MTU_SIZE to 251 and adjusted the memory appropriately on both my sending nrf52840 and the receiving nrf52840.  I've also lowered my connection time to 7.5 ms. Lastly, I've also set NRF_BLE_SCAN_SCAN_PHY to 2Mbps.

One thing that's interesting is that from my understanding, the MAX_MTU_SIZE is in 8 bit 'bytes' ... but if I try to send test strings greater than 248 chars... well I can't. Nothing goes through. This is odd because I thought by default, the nordic examples break large packets into smaller packets and sends them one after another.

For reference, I'm using soft device S140, SDK v16, and I've built my code off the USBD_BLE_UART central and peripheral examples. 

Any help/advice would be much appreciated, thank you!!

Parents Reply
  • So assuming I'm getting the connection parameters at the right time:

    • MTU = 251 (so data length is 248 bytes)
    • Min and max connection intervals = 6 (so 7.5 ms)
    • Slave latency = 0
    • Timeout = 400.

    I'm getting these by printing the connection parameters from:

    sd_ble_gap_ppcp_get(&my_gap_conn_params);

    After I connect (BLE_GAP_EVT_CONNECTED), I request a PHY update to 2Mbps and I don't get an update request ever again so I think I can assume I'm running at 2Mbps. 

Children
Related