From 12739479f4aeaf08f72f81d8041825f75e8fd7b9 Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Fri, 3 Jan 2025 14:05:59 +0100 Subject: [PATCH 1/2] Bluetooth: Controller: Fix ISO Sync Receiver subevent jitter Fix the jitter considered in the PDU reception in the subevents of ISO Sync Receiver to not exceed such that the reception is scheduled late (causing assertion). Signed-off-by: Vinayak Kariappa Chettimada --- .../controller/ll_sw/nordic/lll/lll_sync_iso.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync_iso.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync_iso.c index 071e72c73200b..8b6d7a983e6a2 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync_iso.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync_iso.c @@ -1344,16 +1344,30 @@ static void isr_rx(void *param) hcto -= radio_rx_chain_delay_get(lll->phy, PHY_FLAGS_S8); hcto -= addr_us_get(lll->phy); hcto -= radio_rx_ready_delay_get(lll->phy, PHY_FLAGS_S8); + overhead_us = radio_rx_chain_delay_get(lll->phy, PHY_FLAGS_S8); overhead_us += addr_us_get(lll->phy); overhead_us += radio_rx_ready_delay_get(lll->phy, PHY_FLAGS_S8); overhead_us += (EVENT_CLOCK_JITTER_US << 1); + + LL_ASSERT(EVENT_IFS_US > overhead_us); + jitter_max_us = (EVENT_IFS_US - overhead_us) >> 1; - jitter_max_us -= RANGE_DELAY_US + HAL_RADIO_TMR_START_DELAY_US; + jitter_max_us = (jitter_max_us * nse) / (lll->num_bis * lll->nse); + overhead_us = HAL_RADIO_TMR_START_DELAY_US; + if (jitter_max_us > overhead_us) { + jitter_max_us -= overhead_us; + } else { + jitter_max_us = 0U; + } + jitter_us = (EVENT_CLOCK_JITTER_US << 1) * nse; if (jitter_us > jitter_max_us) { jitter_us = jitter_max_us; } + + LL_ASSERT(hcto > jitter_us); + hcto -= jitter_us; start_us = hcto; @@ -1365,7 +1379,6 @@ static void isr_rx(void *param) * the current subevent we are listening. */ hcto += (jitter_us << 1); - hcto += RANGE_DELAY_US + HAL_RADIO_TMR_START_DELAY_US; } else { /* First subevent PDU was not received, hence setup radio packet * timer header complete timeout from where the first subevent From ff7e93ab449193a2350b58fe43eef6cec870e19d Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Tue, 2 Sep 2025 17:35:38 +0200 Subject: [PATCH 2/2] Bluetooth: Controller: Fix missing ISO Receiver address capture Fix missing ISO Receiver access address capture that caused ISO PDU reception error. Missing access address capture for subsequent subevent when prior subevent did not have an anchor point sync prevent proper drift compensation hence causing ISO PDU reception error for the entire BIG event. Signed-off-by: Vinayak Kariappa Chettimada --- .../bluetooth/controller/ll_sw/nordic/lll/lll_sync_iso.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync_iso.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync_iso.c index 8b6d7a983e6a2..4f4dad90754f5 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync_iso.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_sync_iso.c @@ -1301,6 +1301,13 @@ static void isr_rx(void *param) radio_switch_complete_and_disable(); + /* Setup Access Address capture for subsequent subevent if there has been no anchor point + * sync previously. + */ + if (radio_tmr_aa_restore() == 0U) { + radio_tmr_aa_capture(); + } + /* PDU Header Complete TimeOut, calculate the absolute timeout in * microseconds by when a PDU header is to be received for each * subevent.