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

Timeout disconnection during sending a large amount of data

Our Nrf51822 will disconnect the connection with timeout reason when it is sending a large amount of data (about 20-70 KB) to our central device which is TI cc2540. This disconnection problem occurs occasionally and it is really fatal for our system. How can we avoid this?

Another problem is in this case, the TI cc2540 will be aware of disconnection after 1 minute. I don't know why? Actually, this time is ~ 10 seconds when I removed the battery from Nrf51822. I mean I see two different values of timeout (~10s and 60s) on TI cc2540 while in both cases the reason of disconnection is 'Timeout'?

Here are the connection parameters I have on Nrf51822.

  • Supervision timeout: 1000 ms
  • Slave latency: 0
  • Min con. interval: 25 ms
  • Max con.interval: 25 ms
  • Con. bandwidth: TX = RX = Low
  • Our Nrf51822 will disconnect the connection with timeout reason when it is sending a large amount of data (about 20-70 KB) to our central device which is TI cc2540. This disconnection problem occurs occasionally and it is really fatal for our system. How can we avoid this?

    I recommend running a sniffer like the nRF Sniffer 2 beta or a dedicated hardware sniffer to get a log showing what happens when the link breaks down. Most likely one of the devices can't handle the sending or receiving of the data at the rate you are doing it. A sniffer log will let you know which device to debug. Another alternative is to add some logging or debugging with breakpoints in fault handlers to see which device and when the connection is broken.

    As I understand the issue only happens occasionally, so you are most likely not far away from a stable system. If you can figure out what operations are getting queued too fast to handle you may be able to increase the size of the buffers used in the queueing. If the issue is that data is just sent/received too fast you need to actually reduce the speed at which you are transmitting or find ways to perform the operations faster. 

    Another problem is in this case, the TI cc2540 will be aware of disconnection after 1 minute. I don't know why? Actually, this time is ~ 10 seconds when I removed the battery from Nrf51822. I mean I see two different values of timeout (~10s and 60s) on TI cc2540 while in both cases the reason of disconnection is 'Timeout'?

    We do not have enough experienced with the TI cc series to give you much help specific to that device. I find it strange that the disconnect is so delayed so long and that you see two different timeouts. With the supervisor timeout set to 1000ms, the connection is to be considered broken after 1000ms and the devices should start scanning/advertising.

    Here are the connection parameters I have on Nrf51822.

    These look fine for a high throughput system. Be aware that setting the min and max interval to the same number you may get into trouble if you want to connect it to something else in the future which for some reason doesn't like 25ms.

    Best regards,
    Rune Holmgren

Related