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

NCS max concurrent peripheral connections

I am trying to build the NCS sample project "peripheral_lbs" with multiple peripheral connections. Therefore I added the CONFIG_BT_MAX_CONN. Up to 20 the build is working fine but if I increase it further the build stops working.

Is it somehow possible to establish more than 20 connections with NCS?

My interpretation of this following quote from a Nordic guide was that the max connections on Zephyr only depend on the amount of memory you can use.

"... and in fact there is no limitation on the maximum number of concurrent connections in Zephyr." (Building a BLE application on NCS - Comparing and contrasting to SoftDevice)

Thanks in advance.

  • Hi,

    Yes, your interpretation is correct. There is no limitation on the number of concurrent connections you can have in Zephyr, it's only dependent on the amount of memory on the chip you are using. It should be fine to establish more than 20 conncections.

  • Ok, but why is it that when I run the build command "west build -b nrf52840dk_nrf52840" I get these two warnings and the build stops with an error:

    One of the warnings says this:
    "... ignored due to being outside the active range ([1, 20]) ..."

    Is this limit there for a specific reason?

    Can I just rewrite the Kconfig to use a different range?

    Error log:

    warning: BT_MAX_CONN (defined at
    D:/Development/nrf52_examples/ncs/manual/ncs/nrf\subsys\bluetooth/Kconfig:14,
    subsys/bluetooth/Kconfig:177) was assigned the value '21' but got the value '1'. See
    http://docs.zephyrproject.org/latest/reference/kconfig/CONFIG_BT_MAX_CONN.html and/or look up
    BT_MAX_CONN in the menuconfig/guiconfig interface. The Application Development Primer, Setting
    Configuration Values, and Kconfig - Tips and Best Practices sections of the manual might be helpful
    too.
    
    
    warning: user value 21 on the int symbol BT_MAX_CONN (defined at D:/Development/nrf52_examples/ncs/manual/ncs/nrf\subsys\bluetooth/Kconfig:14, subsys/bluetooth/Kconfig:177) ignored due to being outside the active range ([1, 20]) -- falling back on defaults
    Parsing D:/Development/nrf52_examples/ncs/manual/ncs/nrf/samples/bluetooth/peripheral_lbs/Kconfig
    Loaded configuration 'D:/Development/nrf52_examples/ncs/manual/ncs/zephyr/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840_defconfig'
    Merged configuration 'D:/Development/nrf52_examples/ncs/manual/ncs/nrf/samples/bluetooth/peripheral_lbs/prj.conf'
    
    error: Aborting due to Kconfig warnings
    

  • Hi,

    Which BLE controller are you using? Zephyr LL controller or Softdevice controller?

    If you are using the nordic softdevice controller, the limit is only 20 concurrent connection. If you are using the Zephyr controller it can support up to 64 concurrent connections(this is what has been tested and qualified with, there is no upper limit) depending on the memory.

  • Hi,

    I wasn't aware that there are these two options. I was probably using the Softdevice controller.

    How can I check which one I am using and how do I switch between them?

  • Take a look at this. You will find more information regarding the two controllers, and under Usage in samples you can find how to switch between them. By default, all samples except for the Bluetooth Mesh samples are currently configured to use SoftDevice Controller. So unless you done any modifications you are using the softdevice controller.

Related