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

NRF52840 BLE transfer using NUS service

image descriptionI am writing an application for sending data received over SPI from a non-nordic chip to nrf52840 to nrf uart app using NUS service. I am using 20 bytes of a packet size the max in NUS. The SPI sampling happens at 4 MHZ. I am receiving a very low throughput of around 2.88kbps. Can anyone guide me how to change BLE setting to maximize the throughput

Parents
  • The question is what are both ends of your BLE link, who is Master (GAP Central), what Connection Interval is used and whether you are able to change this. Normally NUS on any nRF5x chip should be able transport at least 3 packets at 7.5ms interval which (being 20B each) gives you at least 8kBps (64kbps). But indeed if one side of the link is some Android phone with 48.75ms interval and single packet per interval then indeed maximum throughput will be around 3.2kbps.

  • Hi i using this function from NUS service to send data over ble (20 bytes in one packet)

    ble_nus_string_send(&m_nus,buf,20);

    I am collecting data over SPI and in buffer of 20 bytes and then sending it over ble. You mentioned something of sending at least 3 such packets in one connection interval. Can you give some insight as in how can I use this to my advantage? for example , can I write

    ble_nus_string_send(&m_nus,buf,60);

    or I use three different buffers of 20 bytes each and call ble_nus_send_string three times

Reply
  • Hi i using this function from NUS service to send data over ble (20 bytes in one packet)

    ble_nus_string_send(&m_nus,buf,20);

    I am collecting data over SPI and in buffer of 20 bytes and then sending it over ble. You mentioned something of sending at least 3 such packets in one connection interval. Can you give some insight as in how can I use this to my advantage? for example , can I write

    ble_nus_string_send(&m_nus,buf,60);

    or I use three different buffers of 20 bytes each and call ble_nus_send_string three times

Children
No Data
Related