Connection failure in nRF52 and nRF53 using Zephyr

I've been running a Central + Peripheral application. I can successfully scan for devices and get the advertising data.

However, when I try to connect, the code seems to execute but connection is never established and I get the following RTT log.

Obviously the MAC address zero indicates something is wrong and it won't connect. What's interesting is that this issue happens on two boards, one nRF53 and one nRF52.

00> [00:06:52.923,126] <dbg> bt_conn: bt_conn_ref: handle 0 ref 1 -> 2
00> --- 13 messages dropped ---
00> [00:06:52.923,217] <dbg> bt_id: set_random_address: EB:02:C1:1A:3C:CB
00> [00:06:52.923,248] <dbg> bt_hci_core: bt_hci_cmd_create: opcode 0x200d param_len 25
00> [00:06:52.923,278] <dbg> bt_hci_core: bt_hci_cmd_create: buf 0x200270f0
00> [00:06:52.923,309] <dbg> bt_hci_core: bt_hci_cmd_send_sync: buf 0x200270f0 opcode 0x200d len 28
00> [00:06:52.923,370] <dbg> bt_hci_core: process_events: count 2
00> [00:06:52.923,400] <dbg> bt_hci_core: process_events: ev->state 4
00> [00:06:52.923,400] <dbg> bt_hci_core: send_cmd: calling net_buf_get
00> [00:06:52.923,431] <dbg> bt_hci_core: send_cmd: calling sem_take_wait
00> [00:06:52.923,461] <dbg> bt_hci_core: send_cmd: Sending command 0x200d (buf 0x200270f0) to driver
00> [00:06:52.923,461] <dbg> bt_hci_core: bt_send: buf 0x200270f0 len 28 type 0
00> [00:06:52.923,492] <dbg> bt_sdc_hci_driver: hci_driver_send: 
00> [00:06:52.923,522] <dbg> bt_sdc_hci_driver: cmd_handle: 
00> [00:06:52.923,736] <dbg> bt_sdc_hci_driver: hci_driver_send: Exit: 0
00> [00:06:52.923,767] <dbg> bt_hci_core: process_events: ev->state 0
00> [00:06:52.923,828] <dbg> bt_sdc_hci_driver: event_packet_process: Command Status (0x200d) status: 0x00
00> [00:06:52.923,858] <dbg> bt_hci_core: bt_recv: buf 0x200270f0 len 6
00> [00:06:52.923,889] <dbg> bt_hci_core: hci_cmd_status: opcode 0x200d
00> [00:06:52.923,919] <dbg> bt_hci_core: hci_cmd_done: opcode 0x200d status 0x00 buf 0x200270f0
00> [00:06:52.924,041] <dbg> bt_conn: bt_conn_prepare_events: 
00> [00:06:52.924,072] <dbg> bt_hci_core: hci_tx_thread: Calling k_poll with 2 events
00> [00:06:52.924,133] <dbg> bt_hci_core: bt_hci_cmd_send_sync: rsp 0x200270f0 opcode 0x200d len 0
00> [00:06:52.924,163] <dbg> bt_conn: bt_conn_unref: handle 0 ref 2 -> 1
00> [00:06:55.923,492] <dbg> bt_hci_core: send_cmd: Sending command 0x200e (buf 0x200270f0) to driver
00> --- 8 messages dropped ---
00> [00:06:55.923,492] <dbg> bt_hci_core: bt_send: buf 0x200270f0 len 3 type 0
00> [00:06:55.923,553] <dbg> bt_sdc_hci_driver: hci_driver_send: 
00> [00:06:55.923,553] <dbg> bt_sdc_hci_driver: cmd_handle: 
00> [00:06:55.923,706] <dbg> bt_sdc_hci_driver: hci_driver_send: Exit: 0
00> [00:06:55.923,706] <dbg> bt_hci_core: process_events: ev->state 0
00> [00:06:55.923,797] <dbg> bt_sdc_hci_driver: event_packet_process: Command Complete (0x200e) status: 0x00, ncmd: 1, len 4
00> [00:06:55.923,828] <dbg> bt_hci_core: bt_recv: buf 0x200270f0 len 6
00> [00:06:55.923,828] <dbg> bt_hci_core: hci_cmd_complete: opcode 0x200e
00> [00:06:55.923,858] <dbg> bt_hci_core: hci_cmd_done: opcode 0x200e status 0x00 buf 0x200270f0
00> [00:06:55.923,980] <dbg> bt_sdc_hci_driver: event_packet_process: LE Meta Event (0x0a), len (31)
00> [00:06:55.924,011] <dbg> bt_hci_core: bt_recv: buf 0x20026e08 len 33
00> [00:06:55.924,133] <dbg> bt_conn: bt_conn_prepare_events: 
00> [00:06:55.924,133] <dbg> bt_hci_core: hci_tx_thread: Calling k_poll with 2 events
00> [00:06:55.924,194] <dbg> bt_hci_core: rx_work_handler: Getting net_buf from queue
00> [00:06:55.924,224] <dbg> bt_hci_core: rx_work_handler: buf 0x20026e08 type 1 len 33
00> [00:06:55.924,224] <dbg> bt_hci_core: hci_event: event 0x3e
00> [00:06:55.924,255] <dbg> bt_hci_core: hci_le_meta_event: subevent 0x0a
00> [00:06:55.924,438] <dbg> bt_hci_core: bt_hci_le_enh_conn_complete: status 0x02 handle 0 role 0 peer 00:00:00:00:00:00 (public) peer RPA 00:00:00:00:00:00
00> [00:06:55.924,530] <dbg> bt_hci_core: bt_hci_le_enh_conn_complete: local RPA 00:00:00:00:00:00
00> [00:06:55.924,560] <dbg> bt_conn: bt_conn_ref: handle 0 ref 1 -> 2
00> [00:06:55.924,621] <dbg> bt_conn: bt_conn_set_state: connecting -> disconnected
00> [00:06:55.924,652] <dbg> bt_conn: bt_conn_unref: handle 0 ref 2 -> 1
00> [00:06:55.924,682] <dbg> bt_conn: bt_conn_unref: handle 0 ref 1 -> 0
00> [00:06:55.924,743] <dbg> bt_hci_core: bt_hci_cmd_send_sync: rsp 0x200270f0 opcode 0x200e len 1

Here's the prj.conf if that's of help:

CONFIG_NCS_SAMPLES_DEFAULTS=y

CONFIG_BT_DEVICE_NAME="BLE Test"
CONFIG_BT_DEVICE_APPEARANCE=832



CONFIG_BT_SCAN=y
CONFIG_BT_SCAN_FILTER_ENABLE=y
CONFIG_BT_SCAN_UUID_CNT=1

CONFIG_BT_GATT_DM=y

#CONFIG_BT_SETTINGS=y
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y
CONFIG_NVS=y
CONFIG_SETTINGS=y

CONFIG_HEAP_MEM_POOL_SIZE=1024

CONFIG_DK_LIBRARY=y

CONFIG_USE_SEGGER_RTT=y
CONFIG_LOG_BACKEND_RTT=y
CONFIG_LOG_MODE_DEFERRED=y
CONFIG_LOG_BACKEND_RTT_OUTPUT_BUFFER_SIZE=8192
CONFIG_SEGGER_RTT_BUFFER_SIZE_UP=8192

#USB related configs
CONFIG_USB_DEVICE_STACK=y
CONFIG_USB_DEVICE_MANUFACTURER="None"
CONFIG_USB_DEVICE_PRODUCT="BLE Test USB"
CONFIG_USB_DEVICE_SN="0123456789"
CONFIG_USB_DEVICE_PID=0x0009
CONFIG_LOG=y
#CONFIG_USB_DRIVER_LOG_LEVEL_ERR=y
CONFIG_USB_DEVICE_LOOPBACK=n
CONFIG_USB_DEVICE_INITIALIZE_AT_BOOT=n
#CONFIG_USB_DEVICE_LOG_LEVEL_DBG=y
CONFIG_USB_DEVICE_INITIALIZE_BY_APP=y

# Clock Configuration
CONFIG_NRF53_SYNC_RTC=n
CONFIG_SOC_ENABLE_LFXO=n
CONFIG_CLOCK_CONTROL_NRF_K32SRC_SYNTH=y


CONFIG_BT=y
CONFIG_BT_CENTRAL=y
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_OBSERVER=y
CONFIG_BT_PRIVACY=n
CONFIG_BT_SMP=y
CONFIG_BT_SMP_ENFORCE_MITM=n
CONFIG_BT_SMP_ALLOW_UNAUTH_OVERWRITE=y
CONFIG_BT_SMP_APP_PAIRING_ACCEPT=y
CONFIG_BT_SIGNING=y
CONFIG_BT_BONDABLE=y
CONFIG_BT_ATT_PREPARE_COUNT=12
CONFIG_BT_GATT_CLIENT=y
CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y
CONFIG_BT_DEVICE_NAME_MAX=32
CONFIG_BT_DEVICE_NAME_DYNAMIC=y
CONFIG_BT_DEVICE_NAME_GATT_WRITABLE=y
CONFIG_BT_EATT=y
CONFIG_BT_L2CAP_ECRED=y
CONFIG_BT_EATT_MAX=5
CONFIG_BT_FILTER_ACCEPT_LIST=y
CONFIG_BT_EATT_AUTO_CONNECT=n
CONFIG_BT_MAX_CONN=4
CONFIG_BT_MAX_PAIRED=2
CONFIG_BT_GATT_NOTIFY_MULTIPLE=y
CONFIG_BT_ATT_RETRY_ON_SEC_ERR=n
CONFIG_BT_GATT_DYNAMIC_DB=y
CONFIG_BT_EXT_ADV=n
CONFIG_BT_PER_ADV=n
CONFIG_BT_PER_ADV_SYNC=n
CONFIG_BT_BUF_ACL_RX_SIZE=100
CONFIG_BT_RX_STACK_SIZE=4096
CONFIG_BT_TINYCRYPT_ECC=y
CONFIG_BT_TESTING=y

CONFIG_BT_DEBUG_LOG=y
CONFIG_BT_DEBUG_HCI_CORE=y
CONFIG_BT_DEBUG_CONN=y
CONFIG_BT_DEBUG_HCI_DRIVER=y

CONFIG_DEBUG=y
CONFIG_DEBUG_OPTIMIZATIONS=y


CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096

Related