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

  • 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

  • Hi again. It seems that my byte skipping problem was not solved after all... But I have solved it now - removing the UART sending loop from the host's nrf_gzll_host_rx_data_ready(..) interrupt and increasing the buffer size for UART_TX solved the issue. However, now my data seems to come in little bursts of packets (no packets are lost) and it looks like the stream of data lags instead of being a smooth and constant. Thanks a lot for your help by the way.

  • Hi Viktor

    Are you still experiencing issues with packets arriving in bursts?
    One thing you can try is to set a shorter timeslot on the device side than on the host side (try values 20-50us shorter). Then there is less chance that the device will drop completely out of sync, and have to retransmit the data several times to get back in sync (if the device is faster than the host you typically get away with a single retransmit to get back in sync).

    Best regards

Related