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: Controller: Multiple Broadcaster asserts when each of them overlap over time #71608

Closed
cvinayak opened this issue Apr 17, 2024 · 0 comments · Fixed by #71611
Closed
Assignees
Labels
area: Bluetooth Controller area: Bluetooth bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug

Comments

@cvinayak
Copy link
Contributor

Describe the bug
Multiple Broadcaster asserts when each of then overlap over time

ASSERTION FAIL [(ret == 0) || (ret == 2) || (fp_op_func == ((void *)0))] @ WEST_TOPDIR/zephyr/subsys/bluetooth/controller/ll_sw/ull_adv.c:1964

To Reproduce
Steps to reproduce the behavior:

  1. mkdir -p build/broadcaster_multiple; cd build/broadcaster_multiple
  2. cmake -GNinja -DBOARD=nrf52840dk_nrf52840 ../../samples/bluetooth/broadcaster_multiple
  3. ninja
  4. ninja flash
  5. See error after a random amount of time, the implementation has to be changed as below
diff --git a/samples/bluetooth/broadcaster_multiple/prj.conf b/samples/bluetooth/broadcaster_multiple/prj.conf
index 1a401ed6c77..04248f7a2be 100644
--- a/samples/bluetooth/broadcaster_multiple/prj.conf
+++ b/samples/bluetooth/broadcaster_multiple/prj.conf
@@ -1,7 +1,7 @@
 CONFIG_BT=y
 CONFIG_BT_BROADCASTER=y
 CONFIG_BT_EXT_ADV=y
-CONFIG_BT_EXT_ADV_MAX_ADV_SET=1
+CONFIG_BT_EXT_ADV_MAX_ADV_SET=64
 CONFIG_BT_DEVICE_NAME="Broadcaster Multiple"
 
 CONFIG_LOG=y
diff --git a/samples/bluetooth/broadcaster_multiple/src/broadcaster_multiple.c b/samples/bluetooth/broadcaster_multiple/src/broadcaster_multiple.c
index d4ce51c4f25..fba839aee0c 100644
--- a/samples/bluetooth/broadcaster_multiple/src/broadcaster_multiple.c
+++ b/samples/bluetooth/broadcaster_multiple/src/broadcaster_multiple.c
@@ -69,9 +69,10 @@ int broadcaster_multiple(void)
                .id = BT_ID_DEFAULT,
                .sid = 0U, /* Supply unique SID when creating advertising set */
                .secondary_max_skip = 0U,
-               .options = (BT_LE_ADV_OPT_EXT_ADV | BT_LE_ADV_OPT_USE_NAME),
-               .interval_min = BT_GAP_ADV_FAST_INT_MIN_2,
-               .interval_max = BT_GAP_ADV_FAST_INT_MAX_2,
+               // .options = (BT_LE_ADV_OPT_EXT_ADV | BT_LE_ADV_OPT_USE_NAME),
+               .options = BT_LE_ADV_OPT_USE_NAME,
+               .interval_min = 0x00a0,
+               .interval_max = 0x00a0,
                .peer = NULL,
        };
        int err;
diff --git a/subsys/bluetooth/controller/ll_sw/ull_adv.c b/subsys/bluetooth/controller/ll_sw/ull_adv.c
index ee070d14857..a99cebca3bf 100644
--- a/subsys/bluetooth/controller/ll_sw/ull_adv.c
+++ b/subsys/bluetooth/controller/ll_sw/ull_adv.c
@@ -1952,6 +1952,7 @@ static uint32_t ticker_update_rand(struct ll_adv_set *adv, uint32_t ticks_delay_
        lll_rand_isr_get(&random_delay, sizeof(random_delay));
        random_delay %= ticks_delay_window;
        random_delay += (ticks_delay_window_offset + 1);
+       random_delay = ull_adv_handle_get(adv) + 1U;
 
        ret = ticker_update(TICKER_INSTANCE_ID_CTLR,
                            TICKER_USER_ID_ULL_HIGH,

Expected behavior
A clear and concise description of what you expected to happen.

Impact
showstopper

Logs and console output
See description

Environment (please complete the following information):

  • OS: Linux
  • Toolchain: Zephyr SDK
  • Commit SHA or Version used: 2b7f5dc

Additional context
NA

@cvinayak cvinayak added bug The issue is a bug, or the PR is fixing a bug area: Bluetooth area: Bluetooth Controller labels Apr 17, 2024
@cvinayak cvinayak self-assigned this Apr 17, 2024
@aescolar aescolar added the priority: medium Medium impact/importance bug label Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Bluetooth Controller 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

Successfully merging a pull request may close this issue.

2 participants