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

[Backport v3.5-branch] Bluetooth: Controller: Fix extended scanning assertion #68046

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -915,11 +915,11 @@ static void isr_window(void *param)
}
lll_chan_set(37 + lll->chan);

#if defined(CONFIG_BT_CENTRAL) || defined(CONFIG_BT_CTLR_ADV_EXT)
#if defined(CONFIG_BT_CENTRAL)
bool is_sched_advanced = IS_ENABLED(CONFIG_BT_CTLR_SCHED_ADVANCED) &&
lll->conn && lll->conn_win_offset_us;
uint32_t ticks_anchor_prev;
uint32_t ticks_at_start;

if (is_sched_advanced) {
/* Get the ticks_anchor when the offset to free time space for
Expand All @@ -932,14 +932,17 @@ static void isr_window(void *param)
} else {
ticks_anchor_prev = 0U;
}
#endif /* CONFIG_BT_CENTRAL */

uint32_t ticks_at_start;

ticks_at_start = ticker_ticks_now_get() +
HAL_TICKER_CNTR_CMP_OFFSET_MIN;
remainder_us = radio_tmr_start_tick(0, ticks_at_start);
#else /* !CONFIG_BT_CENTRAL */
#else /* !CONFIG_BT_CENTRAL && !CONFIG_BT_CTLR_ADV_EXT */

remainder_us = radio_tmr_start_now(0);
#endif /* !CONFIG_BT_CENTRAL */
#endif /* !CONFIG_BT_CENTRAL && !CONFIG_BT_CTLR_ADV_EXT */

/* capture end of Rx-ed PDU, for initiator to calculate first
* central event.
Expand Down
2 changes: 1 addition & 1 deletion tests/bsim/bluetooth/mesh/src/test_beacon.c
Original file line number Diff line number Diff line change
Expand Up @@ -1331,7 +1331,7 @@ static void test_tx_priv_interleave(void)
ASSERT_TRUE(status == STATUS_SUCCESS);
ASSERT_TRUE(phase == BT_MESH_KR_PHASE_2);

k_sleep(K_SECONDS(BEACON_INTERVAL + 5));
k_sleep(K_SECONDS(BEACON_INTERVAL + 7));
toggle_priv_beacon(tx_cfg.addr, 1);

PASS();
Expand Down
4 changes: 2 additions & 2 deletions tests/bsim/bluetooth/mesh/src/test_provision.c
Original file line number Diff line number Diff line change
Expand Up @@ -1008,11 +1008,11 @@ static void test_provisioner_pb_remote_client_parallel(void)
/* scanning device with dev index 3 */
uuid[6] = '0' + 3;
uuid_to_provision_remote = uuid;
ASSERT_OK(bt_mesh_rpr_scan_start(&rpr_cli, &srv, uuid, 5, 1, &scan_status));
ASSERT_OK(bt_mesh_rpr_scan_start(&rpr_cli, &srv, uuid, 15, 1, &scan_status));
ASSERT_EQUAL(BT_MESH_RPR_SUCCESS, scan_status.status);
ASSERT_EQUAL(BT_MESH_RPR_SCAN_SINGLE, scan_status.scan);
ASSERT_EQUAL(1, scan_status.max_devs);
ASSERT_EQUAL(5, scan_status.timeout);
ASSERT_EQUAL(15, scan_status.timeout);

ASSERT_OK(k_sem_take(&scan_sem, K_SECONDS(20)));
ASSERT_OK(k_sem_take(&prov_sem, K_SECONDS(20)));
Expand Down
Loading