Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bt_gatt: unable to save SC: no cfg left #22539

Closed
chris-schra opened this issue Feb 6, 2020 · 4 comments
Closed

bt_gatt: unable to save SC: no cfg left #22539

chris-schra opened this issue Feb 6, 2020 · 4 comments
Assignees
Labels
area: Bluetooth bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug

Comments

@chris-schra
Copy link
Contributor

Describe the bug
I'm regularly seeing the log err

bt_gatt: unable to save SC: no cfg left

on a custom nRF52840 board with current master.
Sometimes there's also an assert:

ASSERTION FAIL [status == 0 || param == ull_update_mark_get() || param == ull_disable_mark_get()] @ ZEPHYR_BASE/subsys/bluetooth[00:06:43.624,938] os: r0/a1: 0x00000003 r1/a2: 0x20001494 r2/a3: 0x00000000
[00:06:43.624,938] os: r3/a4: 0x00000004 r12/ip: 0x00000000 r14/lr: 0x000232a1
[00:06:43.624,938] os: xpsr: 0x6100001b
[00:06:43.624,938] os: Faulting instruction address (r15/pc): 0x000232ac
[00:06:43.624,938] os: >>> ZEPHYR FATAL ERROR 3: Kernel oops on CPU 0
[00:06:43.624,938] os: Fault during interrupt handling

[00:06:43.624,969] os: Current thread: 0x20002af4 (BT RX)
[00:06:53.336,456] errhandler: Halting system

and I have no idea where I should look at.

I tried to disable GATT Caching and I'm already using a single connection concept (BT_MAX_PAIRED = 1)

To Reproduce
It only happens when a "new" device connects. "New" in terms of a new MAC. The reason we stumbled upon this is the fact that iOS randomly changes the MAC address for the iDevice which led to errors.
So, this works:

  • boot Zephyr
  • connect via Lightblue or any other BLE app
  • disconnect
  • reconnect
  • repeat as many times as you want

This doesn't work:

  • boot Zephyr
  • connect via iPhone (again, Lightblue etc)
  • disconnect
  • enable and disable flight mode to get a new MAC for your iPhone
  • connect
  • discussed issues come up
@chris-schra chris-schra added the bug The issue is a bug, or the PR is fixing a bug label Feb 6, 2020
@chris-schra
Copy link
Contributor Author

Maybe related to #22514

@aescolar
Copy link
Member

aescolar commented Feb 6, 2020

CC @jhedberg @joerchan

@jhedberg
Copy link
Member

jhedberg commented Feb 6, 2020

Added both @cvinayak and @Vudentz as assignees, since while the Service Changed warning is host-related, the assert looks like it's controller-related.

@chris-schra
Copy link
Contributor Author

here's some more log output:

[00:24:58.253,234] bt_gatt.sc_save: peer 58:dd:00:e0:85:9c (random) start 0x0000 end 0x0000
[00:24:58.253,326] bt_gatt.find_sc_cfg: id: 0, addr: 58:dd:00:e0:85:9c (random)
[00:24:58.253,417] bt_gatt.find_sc_cfg: id: 0, addr: 00:00:00:00:00:00 (public)
[00:24:58.253,448] bt_gatt: unable to save SC: no cfg left

Obviously as in #22514 the sc_cfg is never flushed, it seems

@jhedberg jhedberg added the priority: medium Medium impact/importance bug label Feb 11, 2020
Vudentz added a commit to Vudentz/zephyr that referenced this issue Feb 13, 2020
SC config data is no longer stored within the CCC config itself
therefore it must be cleared separately.

Fixes zephyrproject-rtos#22539

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Bluetooth bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug
Projects
None yet
Development

No branches or pull requests

5 participants