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

ble_app_uart_pca10040 with high data rate

I want to increase ble_app_uart_pca10040 app sample rate. I have my own board with microcontroller and use nrf52832 as uart to ble.

I made pack length to 20bytes, I have questions; Can we make uart active while ble send pack. How we make ble send time to 7.5ms And i see soft device send 6 pack one time, how to do this.

  1. Fill a buffer 6x20 than call "ble_nus_string_send" six time sequentialy.
  2. Fill a buffer 120byte and call "ble_nus_string_send" one for all 120byte.
  • Hi

    To take advantage of the capability in the SoftDevice to send multiple packets in the same connection interval you simply have to buffer several packets quickly. In other words, you can just call ble_nus_string_send() multiple times one after the other, that is correct. Please be aware that if the buffers in the SoftDevice fill up you will get an error message when you try to send more data, and you have to check this in the code to make sure you don't lose any data.

    What kind of BLE device are you using on the central side? Is it Nordic in both ends, or are you only using a Nordic device in the peripheral?

    If the BLE central device supports Bluetooth 4.2 then you probably want to take advantage of the extended MTU option, that allows you to send more than 20 bytes in each payload. For an example of this you could take a look at the mtu throughput example in the SDK: \nRF5_SDK_13.0.0\examples\ble_central_and_peripheral\experimental\ble_app_att_mtu_throughput

    The following example is also similar to ble_app_uart, while trying to push the data throughput to the maximum: github.com/.../nrf52-ble-image-transfer-demo

    Best regards
    Torbjørn

  • I looked at this image transfer example. Looks like this is based on UART service on the peripheral. If I have to use ble_app_uart_c (uart service on central) as starting point, how to modify the central to use mtu sizes greater than 20?

  • Hi
    Did you look at the ble_app_att_mtu_throughput example I linked to above?
    This example comes with both central and peripheral projects, and is set up to use extended MTU.

    Best regards

  • I am trying to do a loopback test over BLE using att mtu throughput example. I am using one of NRF52840 preview DK as central device and another DK as peripheral.

    When I receive the data over BLE on the peripheral side, I want to send the same data back to central. I used nrf_ble_amts_notif_spam function to do this. I had to modify this function to access the data received from the central.

    But now I am receiving multiple notifications on the central side. Do you know why this could be happening?

  • I figured it out. There were multiple notifications because the att mtu throughput example was looping packets until 1KB were sent. When I modified to remove this looping, I am able to successfully loopback the packet received.

Related