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

[nrf fromtree] Bluetooth: Controller: Upstream fixes upto 2025-02-17 #2515

Open
wants to merge 42 commits into
base: main
Choose a base branch
from

Conversation

cvinayak
Copy link
Contributor

[nrf fromtree] Bluetooth: Controller: Upstream fixes upto 2025-02-17

mtpr-ot and others added 29 commits February 20, 2025 09:22
…ssion groups > 1

For pre-transmission groups > 1, the broadcaster link layer would fetch
incorrect payloads from the TX node queue.

Update payload index calculation to reference correct TX payload. Fix
PTO FIXMEs and range checks.

Signed-off-by: Morten Priess <[email protected]>
(cherry picked from commit d58724d)
Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
…ssions

Add back the implementation in the Controller that tries to
enable pre-transmissions to improve time diversity to aid a
remote ISO Sync Receiver role device.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
(cherry picked from commit 9cd9f41)
Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
…ssion groups > 1

Fixup payload_index to be uint16_t to avoid index overflow.

Do not remember why ptc is 4 bits, where as it must be 5 bit
value similar to nse; added an assertion check until it is
fixed.

Fix ISO Broadcaster and ISO Sync Receiver for PTO > 1 and
use of Pre-Transmission Group Counts.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
(cherry picked from commit 363c143)
Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
…le timer use

This commit addresses two bugs in use of single timer s/w
switch implementation, incorrect aux_offset in subsequent
ADV_EXT_IND and ISO receiver failing to receive second or
greater BIS subevents.

Fix radio_tmr_start_now implementation to consider the
initial latency in starting the event timer in single timer
use mode. This fixes the incorrect aux_offset in ADV_EXT_IND
PDUs.

Fix radio_tmr_start_us implementation for single timer use,
as the timer is reset on every radio end, and hence the
requested start_us has to be adjusted for the accumulated
last_end_pdu_us value. This fixes the BIS subevent
receptions.

Also, fix the maximum radio ISR latency value used in
radio_tmr_start_us to consider the maximum Rx chain delay
and maximum radio ramp up delays. 80 us + ~30 us + ~40 us
should be able to meet the 150 us tIFS duration.

Relates to commit bcd28e0 ("Bluetooth: Controller: Fix
sw switch single timer for spurious TXEN/RXEN").

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
(cherry picked from commit 37bf99e)
Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
…n using DPPI

Fix single timer s/w switch when using DPPI on nRF53/54L
where the previous compare register index is incorrect when
the base index is a odd numbered DPPI used.

The issue is discovered as failing ISO Receiver sample with
Coded PHY and single timer use, where the compare base is
configured to use the DPPI 3 (instead of 4).

Upstream samples do not use single timer for s/w switch, the
issue is discovered when adding support for nRF54L which has
to use single timer due to the radio only having a single
timer.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
(cherry picked from commit 3bc2462)
Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
…e indices

Fix single timer s/w switch base indices from overlapping
with sample index.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
(cherry picked from commit dd95c22)
Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
Add radio_sim_nrf54l.h file, which for now a copy of the
SoC radio_nrf54lx.h file. This is added for having separate
simulation model dependent timing values and specific
implementation details.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
(cherry picked from commit 7e51788)
Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
…abstractions

Fix nRF5 radio and event timer abstractions for some that
where hard coded compared to use of the ones defined in the
resources header file.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
(cherry picked from commit 06b7503)
Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
…vent jitter

Restrict the jitter considered in the PDU reception in the
subevents of ISO Sync Receiver.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
(cherry picked from commit e4b6751)
Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
…n using single timer"

This reverts commit a7fff74.

The next commit will re-add back the fix to primary
advertising channel plus auxiliary advertising channel too.
This will help keep the fix together regarding use of
single timer for software tIFS switching implementation.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
(cherry picked from commit 28f9315)
Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
…tising nRF54L support

Update Extended Advertising for single timer use support
required for nRF54L Series SoCs.

As the timer is reset on every radio end, add implementation
to accumulate the last_pdu_end_us.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
(cherry picked from commit 373dc0d)
Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
…ing nRF54L support

Update Extended Scanning for single timer use support
required for nRF54L Series SoCs.

As the timer is reset on every radio end, use the
radio_tmr_hcto_configure_abs() function to set the header
complete timeout correctly when using single timer for s/w
switching.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
(cherry picked from commit c4a6651)
Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
…g nRF54L support

Update advanced non-overlapping Central Connection Creation
scheduling for single timer use support required for nRF54L
Series SoCs.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
(cherry picked from commit 88a73dd)
Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
…ync nRF54L support

Update Periodic Advertising Sync implementation for single
timer use support required for nRF54L Series SoCs.

As the timer is reset on every radio end, use the
radio_tmr_hcto_configure_abs() function to set the header
complete timeout correctly when using single timer for s/w
switching.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
(cherry picked from commit ccba18a)
Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
…F54L support

Update ISO Sync Receiver for single timer use support
required for nRF54L Series SoCs.

As the timer is reset on every radio end, use the
radio_tmr_hcto_configure_abs() function to set the header
complete timeout correctly when using single timer for s/w
switching.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
(cherry picked from commit 980cc21)
Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
…F54L support

Update ISO Central for single timer use support required
for nRF54L Series SoCs.

As the timer is reset on every radio end, use the
radio_tmr_hcto_configure_abs() function to set the header
complete timeout correctly when using single timer for s/w
switching.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
(cherry picked from commit b6ce1a6)
Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
… nRF54L support

Update ISO Peripheral for single timer use support required
for nRF54L Series SoCs.

As the timer is reset on every radio end, use the
radio_tmr_hcto_configure_abs() function to set the header
complete timeout correctly when using single timer for s/w
switching.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
(cherry picked from commit 1508aa4)
Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
…al compilations

Replace use of HAL_RADIO_RECV_TIMEOUT_CANCEL_PPI with
HAL_TRIGGER_CRYPT_PPI; they have same value but use the
correctly named HAL_TRIGGER_CRYPT_PPI define now.

Fix conditional compile to correctly exclude reference of
NRF_CCM when CONFIG_BT_CTLR_PRIVACY=n.

Fix missing reference to CCM_TASKS_CRYPT_DELAY_BITS when
CONFIG_BT_CTLR_SW_SWITCH_SINGLE_TIMER=y.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
(cherry picked from commit 439cd0b)
Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
…wer domains

Align DDPI usage with nRF54L series power domains and
available DDPI configurations.

Use indices below 4 when needing to bridge with GPIO,
use indices below 8 when needing to bridge with MCU domain
like CCM and AAR; and use indices above 7 to bridge with
Peripheral domain.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
(cherry picked from commit 031a17c)
Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
… SoC

Add NRF_CCM h/w based encryption support in nRF54L15 SoCs.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
(cherry picked from commit 4304640)
Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
…d UINT8_MAX

Added BUILD_ASSERT to ensure ticker node count does not
exceed UINT8_MAX.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
(cherry picked from commit 750250f)
Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
…date

The connection event at the connection update instant was
skipped due to previous ticker node in use that is being
stopped was registering a relative occupied time that
overlapped with the new ticker node being started for
scheduling the connection with new interval.

Added mock interface for ticker_stop_abs() hence needed by
the Controller unit testing.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
(cherry picked from commit 5dffad0)
Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
Fix reset of drift_skip count when an anchor point sync was
missed so that drift compensation is applied on the next
successful anchor point sync. This will improve connection
stability for short overlapping radio event intervals.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
(cherry picked from commit e09d629024a69d8394b926886b771e545ae73fe7)
Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
… conn done event

Fix uninitialized is_aborted in connection done event.

Relates to commit cadef5a ("Bluetooth: Controller:
Introduce BT_CTLR_PERIPHERAL_RESERVE_MAX").

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
(cherry picked from commit f3e398d64c451ea2b5b4fa4041655387b78caf5f)
Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
…x to any PHY Tx

Fix regression in Coded PHY S2 reception to any other PHY Tx
in the s/w switch implementation.

Regression in commit 55b7dba ("Bluetooth: Controller:
Refactor sw_switch hal interface use").

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
(cherry picked from commit 7573ac521d837213e1507d2bb7af7ae70141c0a8)
Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
Fix connection event busy check when peripheral role is
using minimal time reservation.

Peripheral and Central have a anchor point sync if the
Peripheral has successfully transmitted once to the Central.

Fixes commit cadef5a ("Bluetooth: Controller: Introduce
BT_CTLR_PERIPHERAL_RESERVE_MAX")'.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
(cherry picked from commit 745810c4ce5cf5ea41f04351a77b443a8c9ccc61)
Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
… update

Fix incorrect peripheral drift compensation when connection
events are overlapping and a PHY update causes the currently
used PHY to change.

Incorrect preamble to address that is calculated using
updated PHY was used causing supervision timeout.

Fixed by storing the PHY used in the current connection
event and using that for drift compensation calculation.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
(cherry picked from commit 13fa3a029065dd28638de706eeb941f72670dd9e)
Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
Workaround HCTO calculation for BabbleSIM due to need of
addition timeout value required to have anchor point sync.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
(cherry picked from commit e8da9817116146b526193f8293f125b902d74773)
Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
…sed events value

Fix incorrect elapsed events value when event prepare are
aborted in the pipeline. This can caused premature
supervision timeouts.

Relates to commit 247037b ("Bluetooth: Controller: Fix
incorrect elapsed events value").

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
(cherry picked from commit 1c86636a7f37414db960c0d3df8ab8731bc3dd87)
Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
cvinayak and others added 13 commits February 20, 2025 09:22
…lated latency

Fix Connected ISO to use accumulated latency to update the
payload count.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
(cherry picked from commit 3bf330855edb734f62a8cdff0506a017b30bdfcf)
Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
…CIG overlaps

Fix incorrect event_count use in CIG events when the next
CIG interval's prepare overlaps with the current CIG event.
Use separate event_count_prepare variable in ULL and copy
the value in LLL event.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
(cherry picked from commit be91cfedfb54f9022dc0aa02c577b57b35f887a4)
Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
Coverity was unhappy that
`struct ll_conn_iso_stream *cis = NULL;` was never assigned to
a non-NULL value, which is due to the assignment being
guarded by `#if defined(CONFIG_BT_CTLR_CONN_ISO)`.

Signed-off-by: Emil Gydesen <[email protected]>
(cherry picked from commit a9279eef350f9e01fd13c8fedc156b40a8c425b4)
Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
…t parameter

This fixes uninitialized iso_interval parameter in
bt_hci_evt_le_big_complete.

Signed-off-by: Mariusz Skamra <[email protected]>
(cherry picked from commit 6723625336611a6627564f05eefe55b3fb6fcfc9)
Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
… BASE0

We have previously fixed an issue with shifting and
assigning the value without a cast, but coverity
is still complaining about aa[1] and aa[0] with:

"Casting narrower unsigned aa[1] to wider signed type
int effectively tests its lower bound."

Using the common function, sys_get_le24, should fix this issue.

Signed-off-by: Emil Gydesen <[email protected]>
(cherry picked from commit 9fca7ee3a546e82694dc4bd1fae4ff8a329444e2)
Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
…onal code

Fix BT_CTLR_LOW_LAT_ULL conditional compilation code by
decoupling it from BT_CTLR_LOW_LAT code.

BT_CTLR_LOW_LAT_ULL makes ULL execution context to tailchain
in comparison to continuously process in a while loop.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
(cherry picked from commit 5119896c7d7484b3b1aadf55a403b0f183a6e946)
Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
…Adv Sync

Fix incorrect device address reported in the LE Periodic
Advertising Sync Established event when using Periodic
Advertiser List.

During Extended Scanning there can be an ADV_EXT_IND PDU
received between currently being received ADV_EXT_IND PDU
and AUX_ADV_IND PDU; if the one received between has an
address match then incorrectly the Periodic Synchronization
was established to the device whos AUX_ADV_IND PDU is being
received. Fix by storing the auxiliary context that has the
address match and compare with it when matching the SID in
SyncInfo of AUX_ADV_IND PDU being received prior to creating
the synchronization.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
(cherry picked from commit 83e2ec3c9b17f410adc5d960b0b386f6212d75ed)
Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
…E BIG Complete

Fix missing sync_delay and transport_latency information in HCI
LE BIG Complete event.

Relates to commit 1a640e4 ("Bluetooth: controller:
Included transport latency in LE_Big_Established").

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
(cherry picked from commit 8ebc4f3384585eb32028dac558f5db7ef320b53a)
Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
…chain reception

Fix regression introduced in Periodic Advertising
Synchronization due to change related to multiple
Advertising chain reception.

Related commit c334ed5 ("Bluetooth: Controller: Fix
multiple Extended Adv chain reception"), and
commit da792a9 ("Bluetooth: Controller: Fix interleaved
extended scanning assert").

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
(cherry picked from commit 2461552e192c467212f6ef359870f65ed899c715)
Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
…dic Sync

Fix assertion due to changes introduced to support multiple
advertising chain reception.

Auxiliary context association with the Periodic Sync context
was not cleared due to which when terminating a Periodic
Synchronization triggered an assertion check, under race
conditions, detecting that the auxiliary context was already
released.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
(cherry picked from commit 32637290207a583dc183567016670cf9e70e2879)
Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
…ed in node rx

Fix to release aux context stored in node rx, and not in the
superior scan or sync context as the one in the superior scan
or sync context could be reset or have a different new aux
context when multiple advertising chain reception is used.

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
(cherry picked from commit a8065926acaccef1255c29522a9b8f86dd83f4cf)
Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
Fix regression in scan aux release now that aux context is
retrieved from the node rx when supporting multiple chain
reception.

Relates to commit a8065926acac ("Bluetooth: Controller: Fix
to release aux context stored in node rx").

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
(cherry picked from commit 49642efa41c8fd2230f1527e8e498a720f44d61c)
Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
… association

Remove redundant reset of LLL sync aux context association.

Related to commit 32637290207a ("Bluetooth: Controller: Fix
assertion terminating Periodic Sync").

Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
(cherry picked from commit dcdd3308953ababa0a67382e696982b9f8e2ab86)
Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants