data rate over BLE

Dear Sir or Madam,

I have a Nrf52840 device that needs to send 45k Bytes per second over BLE to another Nrf52840 central device.

I use the NUS UART profile from SDK 17.1.0 in the device to send 244 bytes every 10 milliseconds

To connect to the device, I use the UART central example from SDK 17.1.0 and transmit the data over USB CDC to a PC, I implemented the USB in the project.

All works well when the packet send rate is 50 milliseconds; however, when I attempt to increase the speed to 10 milliseconds per pack, I lose packages

Could you please advise what I can do in order to avoid losing packages?

Shimon

  • Hi

    Have you tried taking a sniffer trace to see if the bottle neck is over the air or if something is lost on-air? Do you get any error messages indicating where the lost data is? My guess would be that the UART isn't set to the correct baud rate perhaps, or that a buffer is filled up quicker than it can be emptied. 244 bytes every 10ms would equal a bit rate of 195200 if I'm not mistaken, so how is this set up in your UART sample? By default the bit rate in our samples is set to 115200.

    Best regards,

    Simon

  • Hi 

    I have changes the UART baud rate to 460800

    I found that I need to set the NRF_BLE_SCAN_SCAN_PHY  (PHY to scan on) in the SD_Config.h to  BLE_GAP_PHY_2MBPS in the nrf52840 that I use as central 

    Do I need to the same in the device ? if yes [lease advise how ? as I don't see this configuration in the Sd_Config.h file 

  • Hi

    You can make the advertiser advertise on the 2MBPS PHY by adding the following in the advertising_init() function:

    init.config.ble_adv_primary_phy      = BLE_GAP_PHY_2MBPS;

    However, the scanning and advertising PHYs shouldn't matter too much as long as there is a PHY update requested upon connection from either side that sets the PHY once connected to 2MBPS. This blog post from NovelBits does a great job of showing how you can maximize the throughput of your BLE application, so please check it out.

    Best regards,

    Simon

Related