-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BLE small throughput #20153
Comments
@kristiankajak the UART is limited to 1Mb/s for starters, so that might be an issue. There's also the fact that, depending on how your host sends data, it might not be fully utilizing the buffers available in the controller. Some suggestions:
@joerchan @jhedberg @cvinayak additional suggestions welcome. |
Also @kristiankajak could you please use the Nordic BLE sniffer to take a sniffer trace and attach it here? |
Definitely an issue. Assuming you even get 100% utilization of the UART it is still limiting the maximum throughput of BLE. (1.4 Mb/s). Make sure that you have enough buffers available and that you keep them full at all times. Since an empty buffer can end the connection event. Look at the configuration that carles linked, especially CTLR_TX/RX_BUFFER(_SIZE). And then you can use the sniffer that carles linked to to see how many packets you get per event (look at the event counter). At 7.5 ms you should get around 5, increasing the connection interval should improve throughput as long as you manage to enqueue/dequeue fast enough from the buffers. |
Hi @carlescufi and @joerchan, Some debug info:
BTW, thank you for introducing me to the sniffer tool. It's been helpful. With regards, |
@kristiankajak You are only sending L2CAP 23 bytes, and Link Layer 27 bytes. Even though the Link Layer connection is able to transmit 251 bytes. You need to enqueue larger packets to get your throughput up. (Bluetooth does not support more than one l2cap packets inside a single LL packet).
The sniffer will not be able to handle the full throughput. Because of the 1M/s baudrate of the UART. When this happens the sniffer will drop packets. This is probably what you are seeing. |
Hi @joerchan , As I explained, I wasn't able to use the DLE in the sniffer logs due to using a slightly different setup (I had to implement the sniffer on the one NRF52 dev kit I had) than I did when measuring the throughput. The throughput of 550 Kbit/s was reached with LL payload size of 251, so this is not the problem. |
@kristiankajak I don't understand the setup. So if you don't get DLE to work on the USB dongle, then how can you get DLE with 251 bytes in your first setup, wont' you be limited by the USB dongle? |
@joerchan , you are correct about the setup. In terms on the DLE enabling, sorry for being shy on the details, but I did this intentionally to keep the focus of this topic. But to explain, I have been experiencing difficulties sending 251B payload with 2x Dongle setup. DLE is enabled, but the LL payload size cannot be increased further than 68B, otherwise the data does not reach the remote end. I wrote about this problem in a post linked here: https://lists.zephyrproject.org/g/devel/topic/problem_with_sending_longer/36485664?p=,,,20,0,0,0::recentpostdate%2Fsticky,,,20,2,0,36485664. This problem was fixed when switching one of the dongle controllers (client) with the Nrf52 dev kit using HCI-UART. As for the setup used in this issue (NRF52 dev kit + Dongle), DLE works fine and I do actually receive 251B LL payloads on the remote end correctly. |
@kristiankajak This could appear to be a limitation of the USB driver implementation? @anangl, I remember Segger host dropped UART bytes beyond 64 bytes unless MSD was disabled on MacOS, could it be similar on Nordic's CDC implementation? |
@cvinayak This seems to be the case yes. As for the HCI UART implementation with 251B payload, I'm going to, at some point, test this setup with an android device on the remote end. This maybe will give some insight into where the bottleneck is. I will keep you guys updated. |
@kristiankajak make sure you have disabled the MSD as per the instructions here: |
It would seem this question is now answered, so closing. If you disagree please reopen |
The problem
Hi, Zephyr community,
I am experiencing some difficulties when trying to reach a high throughput with BLE communication. I am using DLE enabled HCI-UART on nrf52-pca10040 and DLE enabled HCI-USB on the nrf52840 USB dongle, both working with Linux hosts.
I am sending raw data on the ACL data channel, and so far I am able to reach ~550 Kbps ( ~3.5 ms for one packet), whereas I was hoping higher speeds considering I am using BT5 compatible devices.
Hope you have some ideas.
Connection Setup
Expected behavior
I expect more than 2 packets to be transmitted within one connection interval. Ideally, I am aiming for 5 TX packet transfers, but the Zephyr API does not really document the connection event length, so I am not sure what to expect.
Other interesting observations
Environment
With regards,
Kristian
The text was updated successfully, but these errors were encountered: