CC2640R2F: Connection interval temporarily changes without request (part II)

Part Number: CC2640R2F

Tool/software:

Hello,

We see, using Ellisys, in some cases the connection interval updates without request from neither central (CC2640R2F) nor peripheral, and no request to do a connection interval was triggered in our code.

On the problematic connection handle, CC2640R2F is central with BLE4 tested SDK v1.40 and SDK v5.30 based on `multi_role`, heavily customised. After the connection interval has changed without request, it reverts automatically on its own after some time.

In "part I" we found there actually was a request being made, this has been addressed and that other product works fine now, but I was mixing up multiple projects so that didn't solve the present ticket with CC2640R2F as central.

We found that this happens only when `multi_role` also has an additional connection as peripheral to a central phone. If this peripheral connection is removed, the wrong connection interval on that other connection handle does not appear.

The usual connection interval on the peripheral side, with iPhone as central is 30ms, with Android as central is 45ms.

The usual connection interval on the central side, with CC2640R2F as central is 450ms.

When the CC2640R2F uses an unexpected connection interval, it is always a multiple of the agreed connection interval, starting at 3x450ms = 1350ms, 1800ms, 2250ms; it sounds like `slave latency` but that is always set to `0`; 

Is there a known issue in those regards? Is there something we do / should not do that can cause this situation?

I am able to share Ellisys captures over PM. 

Best regards,

Jerome 

  • Hi Jerome,

    Thank you for reaching out. I agree that this sounds like slave/peripheral latency. Can you double check the last connection parameter update to ensure it is being set to 0? Does the behavior happen no matter which smart phones are used (Android with Android, iOS with iOS, Android with iOS and iOS with Android)?

    Best Regards,

    Jan

  • Hi Jan,

    Thank you for the help. 

    multi_role as central is connecting to peripherals which are mcu based, such as a modified simple_peripheral, we have programmed them to accept any 'parameter request' from the central. As we can confirm with Ellisys, slave latency is always `0` in the requests. The problem, is that there is no new 'parameter request', neither from peripheral nor central, but multi_role as central/master just randomly acts as if the slave latency was not 0.

    I also noticed the interval change is temporary and remains for 30 to 65sec, most often around 60sec but never exactly the same, then reverts to normal.

    multi_role as peripheral accepts a single connection from either Android or iOS, never both together, and regardless of the platform we see the same.

    Could it be due to a lack of heap/ram/cpu resource? We monitor the heap and checked ram and they look fine, there is no blocking TIRTOS task code.

    Best regards,
    Jerome 

  • Hi Jerome,

    Understood. Thank you for clarifying. Its possible that some unexpected behavior could occur if the device or task are running out of memory or heap. Could you increase the heap sizes to see if that has an impact? When the change in  parameter occurs, does the connection terminate sometimes or is it always stable?

    Best Regards,

    Jan

  • Hi Jan,

    1. We had HEAPMGR_METRICS enabled and monitoring HEAPMGR_MEMFAIL (Memory allocation failure count), at the time of the unexpected interval, before, and after, this counter was not incrementing indicating there was no heap failure. 

    2. When the change in parameter occurs, the connection never terminates, Ellisys did not record a disconnection at that moment over 10s of occurrences. 

    We do record unexpected disconnections which led to this investigation, but that will be a subject for another time as it looks like there is no relationship with the above. 

    Jerome 

  • Hi Jerome,

    Understood. Were you able to try increasing the heap and stack sizes to see if that has an impact?

    Best Regards,

    Jan

  • Hey Jan, 

    After checking this. Our heap already takes the entire GPRAM already, that's 8KB, I'm afraid we can't grow it further, but it's also not full based on our monitoring.
    All stacks are monitored for overflow as well, so we don't expect any issue there either. 

    Regards,
    Jerome 

  • Hi Jerome,

    Understood, can you monitor the heap and see how close we are to the maximum size of the heap? It would be helpful to know if we are running out of space or not.

    Best Regards,

    Jan

  • Hi Jan,

    Those are the metrics, they remain roughly the same between good and bad moments, there's really no variation: 

    heapmgrBlkMax 120
    heapmgrBlkCnt 115
    heapmgrBlkFree 52
    heapmgrMemAlo 5668
    heapmgrMemMax 7280
    heapmgrMemUB 7516
    heapmgrMemFail 0
    heapmgrMemFreeTotal 2488

    Jerome

  • Hi Jerome,

    These look okay to me. You mentioned that you see this in a heavily custom multi_role. Are you able to see this in an unmodified multirole that uses your connection parameters?

    Best Regards

    Jan