Receive regular Ble packets from multiple peripherals

Dear Nordic support team,

We are currently working on a motion tracking project that involves sending quaternion matrices from 8 individual devices (custom boards with nRF52840) to a central device (nRF52840 dongle). The peripherals are programmed to send packets every 16.8ms (59.5 Hz refresh rate), and the central device receives these packets and prints them on the com port using the USB CDC ACM module. However, we have noticed that when only one device sends data, the data on the com port is regular, with delta_t~=15ms. But when multiple devices send data, the received data (two successive packets from one specific device) on the com port is irregular, and the timestamps vary from 1 to 80ms.

We do not believe that the issue is with the peripheral devices because they are programmed to send data regularly and independently from the central device (which does not send any data to the peripherals). We have also tested the USB module and found that it is rarely the cause of the issue, as it can write test data every 500us on the com port. However, we suspect that the problem is related to the central device's concurrent receive function, which may be affecting its performance.

We are currently using a code for the central device that can be found at https://github.com/NordicPlayground/nrf52-ble-app-uart-c-multilink. We have attached the main and configuration files for both the peripheral and central devices. We would greatly appreciate your help in resolving this issue, as we require the motion data to be received regularly. Is it possible to receive 8 packets every 15ms regularly?

Thank you for your support, help, and time.

Best regards.

Parents
  • Susheel Nuguru said:
    BLE needs HFCLK and it is recommended to have a high accuracy XTAL for it.

    We will check it

    Susheel Nuguru said:
    Are you getting BLE_NUS_C_EVT_NUS_TX_EVT as expected every ~2ms? If yes, then what is the time taken by the snprintf and app_usbd_cdc_acm_write? you can toggle a gpio just after this event is called and toggle the same gpio again just before leaving this event handling. That way you will get an accurate processing time for this event.

    It's unlikely that we get a Nordic UART Service (NUS) event every 2ms since the motion devices are not necessarily synchronized with each other. It's possible that the central device receives data packets from two individual devices in less than 2ms, although they send every 16ms, and we have eight packets every 16ms (with time differences that may vary from case to case).

    Thank you for your helpful suggestion. We will test it out and report back with the results.

Reply
  • Susheel Nuguru said:
    BLE needs HFCLK and it is recommended to have a high accuracy XTAL for it.

    We will check it

    Susheel Nuguru said:
    Are you getting BLE_NUS_C_EVT_NUS_TX_EVT as expected every ~2ms? If yes, then what is the time taken by the snprintf and app_usbd_cdc_acm_write? you can toggle a gpio just after this event is called and toggle the same gpio again just before leaving this event handling. That way you will get an accurate processing time for this event.

    It's unlikely that we get a Nordic UART Service (NUS) event every 2ms since the motion devices are not necessarily synchronized with each other. It's possible that the central device receives data packets from two individual devices in less than 2ms, although they send every 16ms, and we have eight packets every 16ms (with time differences that may vary from case to case).

    Thank you for your helpful suggestion. We will test it out and report back with the results.

Children
No Data
Related