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

Bluetooth: bt_gatt_service_register() assumes sc delayed work handler is initialized #9785

Closed
lemrey opened this issue Sep 4, 2018 · 1 comment
Assignees
Labels
area: Bluetooth bug The issue is a bug, or the PR is fixing a bug priority: high High impact/importance bug

Comments

@lemrey
Copy link
Collaborator

lemrey commented Sep 4, 2018

My understanding is that it should be possible, or at least desirable, to register a GATT service prior to bt_enable(). This would it make it possible, for example, to register services automatically with SYS_INIT.
When I try to do that, I am hitting a bus fault but symptoms may vary I gues (I am running a peripheral example on a Nordic DK). I believe the issue is in sc_indicate() in bt_gatt_service_register() which attempts to submit some work to a delayed work queue without it being initialized. Specifically k_delayed_work_submit(&sc->work, SC_TIMEOUT); is not initialized until bt_gatt_init() has been called.

@lemrey
Copy link
Collaborator Author

lemrey commented Sep 4, 2018

FYI: @jhedberg @Vudentz

@nashif nashif added bug The issue is a bug, or the PR is fixing a bug area: Bluetooth priority: low Low impact/importance bug labels Sep 4, 2018
@nashif nashif added priority: high High impact/importance bug and removed priority: low Low impact/importance bug labels Sep 10, 2018
nashif pushed a commit to Vudentz/zephyr that referenced this issue Sep 10, 2018
This ensures the core services are always registered first and the
gatt_sc work is initialized.

Fixes zephyrproject-rtos#9785

Signed-off-by: Luiz Augusto von Dentz <[email protected]>
Signed-off-by: Anas Nashif <[email protected]>
nashif pushed a commit that referenced this issue Sep 10, 2018
This ensures the core services are always registered first and the
gatt_sc work is initialized.

Fixes #9785

Signed-off-by: Luiz Augusto von Dentz <[email protected]>
Signed-off-by: Anas Nashif <[email protected]>
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: high High impact/importance bug
Projects
None yet
Development

No branches or pull requests

3 participants