NCS 2.8
nrf52840
CONFIG_BT=y
CONFIG_BT_LL_SOFTDEVICE=y
CONFIG_BT_DEVICE_NAME_DYNAMIC=y
CONFIG_BT_CENTRAL=y
CONFIG_BT_GATT_CLIENT=y
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_BROADCASTER=y
CONFIG_BT_PERIPHERAL_PREF_MIN_INT=12
CONFIG_BT_PERIPHERAL_PREF_MAX_INT=12
CONFIG_BT_PERIPHERAL_PREF_LATENCY=0
CONFIG_BT_PERIPHERAL_PREF_TIMEOUT=500
CONFIG_BT_CONN_PARAM_UPDATE_TIMEOUT=500
CONFIG_BT_CONN_PARAM_RETRY_TIMEOUT=1000
# Set the maximum number of simultaneous connections
# 1 for peripheral role, 7 for central role
CONFIG_BT_MAX_CONN=8
CONFIG_BT_DATA_LEN_UPDATE=y
CONFIG_BT_USER_DATA_LEN_UPDATE=y
CONFIG_BT_USER_PHY_UPDATE=y
CONFIG_BT_GAP_AUTO_UPDATE_CONN_PARAMS=y
CONFIG_BT_BUF_ACL_RX_SIZE=251
CONFIG_BT_ATT_PREPARE_COUNT=2
CONFIG_BT_L2CAP_TX_MTU=247
CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y
CONFIG_BT_CONN_TX_MAX=10
CONFIG_BT_BUF_ACL_TX_COUNT=10
CONFIG_BT_ATT_TX_COUNT=10
CONFIG_BT_BUF_ACL_TX_SIZE=257
CONFIG_BT_CTLR=y
CONFIG_BT_HCI=y
CONFIG_BT_HCI_VS_EVT_USER=y
CONFIG_BT_SMP=y
CONFIG_BT_DATA_LEN_UPDATE=y
CONFIG_BT_CTLR_DATA_LENGTH_MAX=251
CONFIG_BT_CTLR_PHY_2M=y
CONFIG_BT_CTLR_PHY_CODED=y
CONFIG_BT_CTLR_SDC_MAX_CONN_EVENT_LEN_DEFAULT=4000000
CONFIG_BT_CTLR_SDC_PERIPHERAL_COUNT=1
CONFIG_BT_CTLR_SDC_CONN_ANCHOR_POINT_REPORT=y
CONFIG_BT_BAS=y
My device works a central for up to 7 devices and connects as a periphal with 1 central/phone.
During normal operation I am able to scan and advertise at the same time. Sometimes when the central/phone disconnects the BT stack gets into a state where it will not allow advertising to resume. These warning logs are produced:
[00:02:10.242,492] <inf> my_ble: Disconnected as peripheral: 45:89:C3:5B:EB:A7 (random), reason 0x13
[00:02:10.242,919] <wrn> bt_hci_core: opcode 0x2005 status 0x0c
[00:02:10.242,919] <wrn> bt_id: cmd disallowed
[00:02:10.242,950] <err> bt_adv: Controller cannot resume connectable advertising (-13)
In this case I only had 1 connection where I was acting as a central. During typical operation I'm able to advertise.
I also note that i'm occasionally getting this warning:
[00:01:02.771,972] <wrn> bt_hci_core: opcode 0x200a status 0x0d