Hi,
I’m using an nRF5340DK with nRF Connect SDK 2.9.1, configured as both Central and Peripheral with the nordic SDC running the network processor
Goal: allow the board to connect to two Central devices simultaneously, with a maximum of three connections allowed.
The first device has a fixed MAC address and a dedicated slot in my connection table.
Issue:
- Lost connection with the second Central (MAC address not fixed)
Two scenarios occur:-
Case 1: The nRF5340DK detects the disconnection (
reason 8 - timeout), releases resources → the Central reconnects successfully. -
Case 2: The nRF5340DK does not detect the disconnection.
The Central initiates a new connection, which occupies the third slot.
Since I only allow two active connections, I forcefully disconnect the old connection using:bt_conn_disconnect(conn2, BT_HCI_ERR_REMOTE_USER_TERM_CONN);bt_conn_unref(conn2);Afficher plus de lignesThen I register the new connection in the second slot.
Problem: the resources for the old connection are never released.
-
-
HCI error after 3 connections
When three Centrals are connected, I get this error right after theconnectedcallback:bt_hci_core: opcode 0x2039 status 0x0dThe connection still works and data is exchanged, but the nRF5340DK is no longer discoverable (all 3 slots are occupied, including 1 that should have been freed).
If a Central disappears again without being detected, it cannot reconnect.
Questions:
- What is the proper way to completely remove a BLE connection?
bt_conn_unref()doesn’t seem to be enough. - How can I resolve the error:
bt_hci_core: opcode 0x2039 status 0x0d
a part of my app prj.conf
prj.conf (network):
Thanks for your help!