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

Gazell data lag when more than 1 device is connected

Hi! I am fairly new to programming micro controllers so apologies if I ask many questions. I am using NRF52832. The situation is this - I have 2 devices and 1 host . After receiving data the host then sends data via UART to FT232RL and then to a computer. The devices are running on different pipes, however when both devices are sending data to the host some bytes are being skipped and there is this lagging as well - the data comes not consistently but in steps. Any ideas or advice ?

Here is the host's main code Host Device.txt

And here is the devices' code (it's quite a mess, sorry). Device.txt

Parents Reply Children
  • Hi Viktor

    What is your UART baudrate, and how much data are you trying to send from each device?

    What kind of hardware are you using for the nRF52? Since you mention the FT232RL chip I assume it is not a standard development kit?

    Maybe you can share your nRF52 code project, so I can have a look at it?

  • My UART baudate is 921600. From each device I am trying to send 19.2 kbps (24 bytes, at 100 Hz). Indeed it is not a standard development kit - it is something I got together myself. The host has only the NRF52832 and the FT232RL and the devices have IMU devices (LSM330DLC). I think I am having trouble with syncing the devices, as by changing the sync time the flow of data from the devices changes. So far the best result was when the devices and the host had the same time slot time (1200) and 2mbps data rate. How can I attach a file to a comment ? The code is pretty long and won't fit in the comment.

  • Hi Viktor

    You can't attach files in comments, but if you edit your original question there should be an "Attachment" button that allows you to attach larger files (or you can click Ctrl + F).

  • OK. I attached code to the question. It has changed since the initial question a bit. I found that the best results were achieved when the host was listening on a channel for a longer period of time ( timeslot=4800, timeslots per channel=1) (but not longer that the sample frequency - 10ms) and the device would have multiple attempts to send the data ( timeslot=600, timeslots per channel=8). The stream then is somewhat stable, however I have a suspicion that I am not getting all of the packets...

  • Hi

    Have you done some debugging to check how often the nrf_gzll_device_tx_failed(..) callback occurs?

    As it is I don't think you are handling this interrupt correctly. You handle it by re sending the data_payload buffer, but at this point that buffer might already have been overwritten by new sensor data.

    Secondly, you might want to check the return code from the nrf_gzll_add_packet_to_tx_fifo(..) calls, in case the internal buffers fill up. Once that happens the data will not be uploaded, and if you don't store it externally the packet will be lost.

    Best regards

Related