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..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. @@ -1344,16 +1351,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 +1386,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