-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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: Extended advertising with one advertising set fails after the first time #31254
Comments
@cvinayak This seems to be an issue with the controller. The advertiser cannot be restarted after it has been terminated in the controller by a timeout or number of events limit. A simple test in the shell:
|
@joerchan Is the issue with non-connectable non-scannable extended advertising too? |
@cvinayak No, that seems to work:
|
@joerchan ok. Thank you. Connectable was added recently, will add a connectable advertising test, investigate and send a PR. |
I'm sorry but I wasn't using connectable advertising? Only Identity and Extended options are set. |
@joerchan There is already a bsim test that covers starting connectable advertising after the terminate due to max events. (https://github.com/zephyrproject-rtos/zephyr/blob/master/tests/bluetooth/bsim_bt/bsim_test_advx/src/main.c#L236) The test is passing in CI. I also added another start advertising with max events, advertising start without duration/max events and the test still passed for me. updated test patch file: There must be something wrong running on target, will continue investigation... |
This is a bug in the controller, the implementation to release auxiliary channel PDU resources is missing when advertising terminates due to max events or duration. Relates to #26338 |
Setting priority as low since this is a WIP feature in the controller. |
@StevenGhe this is caused by the current implementation of Extended Adv missing parts of it, it will be fixed as part of the ongoing Ext Adv work, but not in time for Zephyr 2.5. |
Any ETA? Are we speaking of weeks/months? My thesis is due +- May so not having such key BLE feature is pretty huge for me. |
@StevenGhe I don't know the ETA, but in the meantime you could use the SoftDevice controller in nRF Connect SDK, which has support for this feature. |
I have a similar problem which I believe is related. An advertising set will also fail to restart if a connection was made through that set. In that instance, BT_HCI_ERR_MEM_CAPACITY_EXCEEDED is returned instead. The error starts in |
When Extended Advertising terminated due to duration or maximum number of events, the auxiliary PDU scheduling is now correctly stopped. Fixes zephyrproject-rtos#31254. Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
When Extended Advertising terminated due to duration or maximum number of events, the auxiliary PDU scheduling is now correctly stopped. Fixes #31254. Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Describe the bug
A clear and concise description of what the bug is.
I'm using an extended advertising set with one event (BT_LE_EXT_ADV_START_PARAM(0,1)). However if I call "bt_le_ext_adv_start" again with the same parameters, I get an error: (see picture below)
Am I supposed to stop advertising or create a new extended advertising set each event?
The .sent callback in the "bt_le_ext_adv_cb" is called the first time, which makes me believe the advertising has stopped.
Looking at the documentation, I see nothing else I can do?
I use an Adafruit Feather with a Nordic nRF52840 chip.
What have you tried to diagnose or workaround this issue?
Tried a lot of different methods of triggering this single advertising event. Nothing really changed
Multiple devices have the same behaviour
To Reproduce
Steps to reproduce the behavior:
I've supplied a main.c with some configuration files to test the problem in a .zip below.
The output generated on my device(s) is in the picture below.
Expected behavior
A clear and concise description of what you expected to happen.
Advertising should happen each time. Not just the first time.
Impact
What impact does this issue have on your progress (e.g., annoyance, showstopper)
I'm quite sure I could use (BT_LE_EXT_ADV_START_PARAM(0,0) and stop the advertising myself given I stop it before the second event happened. So not too bad, but I think it could be more efficient using the provided function.
Logs and console output
snippet.zip
Edit: The main.c file is quite messy, I threw everythign related from my own project into the single file. The most interesting parts are at the bottom (main function and BLE advertising method)
Edit2: changed some things requested by Joakim Andersson on Slack
Environment (please complete the following information):
1e61d3e
The text was updated successfully, but these errors were encountered: