Multiple BLE central links with peripheral (upto 15 central links)

Hello,

I am using nRF52840 and I currently am working on a application where mostly I am using central functionality (BLE connection and exchange the data) along with cellular connection (bg96 sim module to connect the device with MQTT) and following BLE links...
NRF_SDH_BLE_PERIPHERAL_LINK_COUNT 1
NRF_SDH_BLE_CENTRAL_LINK_COUNT 11
NRF_SDH_BLE_TOTAL_LINK_COUNT 12

Overall functionality is to connect with multiple peripheral, take data from them and upload it on cloud via MQTT.
Now as per currently developed code, my application requires about 164 KB RAM. So just for safer side, I have set 170 KB of RAM.
Now my central device works well up to 10 peripheral devices (it got connected with 10 peripherals), no crash, stable BLE connection and everything works just fine.
As soon as it connects with 11th peripheral device, following problems gets generated at random point of time...

  • Sometimes central device generated fatal error during BLE connection.
  • Sometimes central device generated fatal error at random point of time when there was any activity to be performed (such as exchange the data over BLE).
  • Unstable BLE connection. Which means any of the peripheral device gets disconnected and connected again and this happens at random point of time.I thought it was an issue of RAM. I have also tried with 250 KB of RAM and then also the same problem gets appeared.


FYI: As per Nordic documentation, there's support of 20 total ble links. My ultimate requirement is to establish the central connection with 15 peripheral devices (15 BLE central links) in parallel.
So I need help to overcome such kind of issues so that I can properly establish the 15 BLE connection with peripherals in parallel. Any help will be highly appreciated.


Thanks & Regards
Vivek

  • Hello Vivek,

    It would be good to know where the "fatal error" occurs. Could you please select the "DEBUG" build configuration to get the error handler to print out more error information?

    Also, what connection paramaters do you use? The stack supports up to 20 concurrent links as you say, but that requires there to be enough spacing between connection events to leave enough room room for all connections. You can read more about this in the Scheduling chapter of the Softdevice specification.

    Best regards,

    Vidar

  • Hello Vidar,

    I'm a Vivek's colleague and after reading the Scheduling documentation I have some doubts about which macros are defined in the SDK to tune the spacinf between connection events, i.e, which macros should I tune in both peripheral and central? 

    I saw in the SDK code some macros related to connection interval but I don't see where the timing-event, described in the documentation, is defined. And if I understood well, I  need a combination of both connection interval and timing-event to avoid collisions. 

    I'm looking forward to hearing from you. 

    Best regards,

  • Hello,

    The peripheral can request a connection parameter change through the Connection Parameters Negotiation module, but in the end it is the Central that will decide what connection parameters to use. In general, the most important parameter for scheduling is the connection interval you use.

    The longer the interval, the easier it will be for the stack to schedule all the events. The timing of when the connection interval starts is automatically controlled by the central to avoid overlapping events when possible. 

Related