Failing to restart advertising after connection on nRF5340-DK

Hello,

I’m working with the nRF5340-DK using nRF Connect SDK v3.0 and the SoftDevice Controller. My goal is to support multiple simultaneous connections, and I have already set CONFIG_BT_MAX_CONN in prj.conf to a value greater than 1. I use legacy advertising.

I understand that when a BLE connection is established, advertising is automatically stopped. Because of this, I try to manually restart advertising inside the connected callback using bt_le_adv_start().

However, this call fails with error -ENOMEM (code -12). From what I understand, this likely means there are no more connection objects available — although it’s not entirely clear to me what exactly these connection objects are, how they are allocated or released.

I also tried restarting advertising from the same callback, but using a delayed workqueue with 150–250 ms delay, and still get the same -ENOMEM result.

How can I ensure that advertising is correctly restarted and that multiple connections can be handled reliably? Is there something I’m missing regarding when connection objects become available again?

Thanks in advance for the help.

Best,
Agustín

Parents Reply Children
No Data
Related