HCI_LE_Connection_Complete event with peer address type 2

Hi,

my firmware is basing on the nRF Connect SDK hci_uart example. I'm using the nRF52840DK as hardware platform and have a STM32 connected to the nRF by HCI with btstack. When I connect the first time from my iOS device and start pairing/bonding, everything is working fine. But I'm not able to reconnect and re-encrypt the connection. Here is, what I found out so far and what I think is the problem:

On the first connect, the iOS device is reported with its resolvable random address

hci.c.2823: LE Connection_complete (status=0) type 1, 59:A2:08:8D:01:A0

On every subsequent connection the address is reported with type 2:

hci.c.2823: LE Connection_complete (status=0) type 2, 88:A9:B7:26:7E:DE

The reported address is exactly the resolved address. What I am additionally wondering about is that type 2 is not specified in the Bluetooth specification:

Here's my current config:

CONFIG_USE_SEGGER_RTT=y
CONFIG_RTT_CONSOLE=y

CONFIG_STDOUT_CONSOLE=n
CONFIG_UART_CONSOLE=n
CONFIG_GPIO=y
CONFIG_SERIAL=y
CONFIG_UART_INTERRUPT_DRIVEN=y
CONFIG_UART_LINE_CTRL=y
CONFIG_LED=y
CONFIG_LED_GPIO=y

CONFIG_BT=y
CONFIG_BT_HCI_RAW=y
CONFIG_BT_HCI_RAW_H4=y
CONFIG_BT_HCI_RAW_H4_ENABLE=y
CONFIG_BT_DEBUG_LOG=n

CONFIG_BT_MAX_CONN=16
CONFIG_BT_ECC=y
CONFIG_BT_TINYCRYPT_ECC=y
CONFIG_BT_HCI_VS_EXT=y

# settings for extended MTU
CONFIG_BT_CTLR_DATA_LENGTH_MAX=251
CONFIG_BT_DATA_LEN_UPDATE=y
CONFIG_BT_BUF_ACL_RX_SIZE=255
CONFIG_BT_BUF_ACL_TX_SIZE=255
CONFIG_BT_BUF_CMD_TX_SIZE=255
CONFIG_BT_BUF_EVT_DISCARDABLE_SIZE=255

# controller settings
CONFIG_BT_CTLR_PHY_2M=y
CONFIG_BT_CTLR_PHY_CODED=y
CONFIG_BT_CTLR_CHAN_SEL_2=y
CONFIG_BT_CTLR_ASSERT_HANDLER=y
CONFIG_BT_CTLR_FILTER_ACCEPT_LIST=y
CONFIG_BT_CTLR_PRIVACY=y
CONFIG_BT_CTLR_LE_PING=y

# Workaround: Unable to allocate command buffer when using K_NO_WAIT since
# Host number of completed commands does not follow normal flow control.
CONFIG_BT_BUF_CMD_TX_COUNT=10

CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=512

I'm digging into this for days now, any idea someone? Maybe some CONFIG's I'm missing? I can provide more logs if needed, of course.

Regards,
Oliver

Related