Closed mfiumara closed 4 years ago
@joerchan I redid the test as follows: Set-up:
nrfjprog --eraseall && west flash
Connect using smartphone with (nrfconnect). Bond using nrfconnect. Subscribe to notifications. Disconnect Corresponding output from device:
*** Booting Zephyr OS build zephyr-v2.2.0 ***
Bluetooth initialized
Advertising successfully started
[00:00:00.004,974] <inf> bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)
[00:00:00.004,974] <inf> bt_hci_core: HW Variant: nRF52x (0x0002)
[00:00:00.004,974] <inf> bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 2.2 Build 0
[00:00:00.005,615] <inf> bt_hci_core: Identity: db:5c:ca:0c:c9:c2 (random)
[00:00:00.005,615] <inf> bt_hci_core: HCI: version 5.1 (0x0a) revision 0x0000, manufacturer 0x05f1
[00:00:00.005,615] <inf> bt_hci_core: LMP: version 5.1 (0x0a) subver 0xffff
Connected
[00:00:34.359,222] <wrn> bt_ctlr_hci: type: 0x14
Disconnected (reason 0x13)
Connected
[00:00:58.149,353] <wrn> bt_ctlr_hci: type: 0x14
[00:01:15.943,328] <inf> hrs: HRS notifications enabled
Disconnected (reason 0x13)
[00:01:22.963,684] <inf> hrs: HRS notifications disabled
Connect device 2 (bluetoothctl) and perform Pair Subscribe Disconnect as follows:
[bluetooth]# scan on
Discovery started
[CHG] Controller 00:28:F8:F8:D6:6B Discovering: yes
[NEW] Device DB:5C:CA:0C:C9:C2 Zephyr Heartrate Sensor
[bluetooth]# scan off
[bluetooth]# connect DB:5C:CA:0C:C9:C2
Attempting to connect to DB:5C:CA:0C:C9:C2
[CHG] Device DB:5C:CA:0C:C9:C2 Connected: yes
Connection successful
[NEW] Primary Service (Handle 0x81fe)
/org/bluez/hci1/dev_DB_5C_CA_0C_C9_C2/service0001
00001801-0000-1000-8000-00805f9b34fb
Generic Attribute Profile
[NEW] Characteristic (Handle 0x81fe)
.
.
.
.
[Zephyr Heartrate Sensor]# pair
Attempting to pair with DB:5C:CA:0C:C9:C2
[CHG] Device DB:5C:CA:0C:C9:C2 Paired: yes
Pairing successful
[Zephyr Heartrate Sensor]# menu gatt
[Zephyr Heartrate Sensor]# select-attribute 00002a37-0000-1000-8000-00805f9b34fb
[Zephyr Heartrate Sensor:/service0019/char001a]# notify on
[CHG] Attribute /org/bluez/hci1/dev_DB_5C_CA_0C_C9_C2/service0019/char001a Notifying: yes
Notify started
[CHG] Attribute /org/bluez/hci1/dev_DB_5C_CA_0C_C9_C2/service0019/char001a Value:
06 66 .f
[CHG] Attribute /org/bluez/hci1/dev_DB_5C_CA_0C_C9_C2/service0019/char001a Value:
06 67 .g
[CHG] Attribute /org/bluez/hci1/dev_DB_5C_CA_0C_C9_C2/service0019/char001a Value:
06 68 .h
[Zephyr Heartrate Sensor:/service0019/char001a]# back
[Zephyr Heartrate Sensor:/service0019/char001a]# disconnect
Attempting to disconnect from DB:5C:CA:0C:C9:C2
[CHG] Attribute /org/bluez/hci1/dev_DB_5C_CA_0C_C9_C2/service0019/char001a Value:
06 6b .k
[CHG] Attribute /org/bluez/hci1/dev_DB_5C_CA_0C_C9_C2/service0019/char001a Value:
06 6c .l
[CHG] Device DB:5C:CA:0C:C9:C2 ServicesResolved: no
Successful disconnected
Corresponding output from device:
Connected
[00:01:56.086,242] <inf> bas: BAS Notifications enabled
[00:02:32.113,067] <inf> hrs: HRS notifications enabled
Disconnected (reason 0x13)
[00:02:38.937,927] <inf> bas: BAS Notifications disabled
[00:02:38.937,957] <inf> hrs: HRS notifications disabled
Connect again with device 1 (nrfconnect) Automatically bonded using LTK's Unable to subscribe to notifications Output from device:
Connected
[00:02:48.763,641] <wrn> bt_ctlr_hci: type: 0x14
[00:03:08.458,831] <wrn> bt_gatt: No space to store CCC cfg
I am still seeing this issue occasionally, but I am using bluetooth mesh. I connect to the bearer successfully but the bearer does not open. And my device is outputting the following:
bt_gatt: No space to store CCC cfg
I'm not exactly sure how to reproduce. It seems to be happening pretty randomly and I can't pinpoint exactly when it happens.
@johnsmithecon Please find out how to reproduce your issue and open a new bug-report if you can
Describe the bug When CONFIG_BT_KEYS_OVERWRITE_OLDEST is enabled, a warning gets thrown by bt_gatt saying no space to store CCC cfg.
To Reproduce Steps to reproduce the behavior:
git apply prj.conf.patch && west build -b nrf52_pca10040 samples/bluetooth/peripheral_hr
west flash
Expected behavior Expected is that the CCC can be normally subscribed to without warning messages from
bt_gatt
Impact This leads to all notifications being broken once in this situation. If the device is power cycled the state is returned to normal.
Screenshots or console output
Environment (please complete the following information):
commit 9518bd19b7a736bd649fa2fc8d8d52967c0b486f (HEAD, tag: zephyr-v2.2.0, tag: v2.2.0)
Additional context Short discussion with Joakim revelead this could be an issue in CONFIG_BT_KEYS_OVERWRITE_OLDEST, as it's quite a new feature
patch: