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 <vich@nordicsemi.no>
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 <vich@nordicsemi.no>
bt_gatt_find_by_uuid used bt_gatt_attr_value_handle but that
function only works to get the value handle of a characteristic
declaration, i.e. if the UUID is not BT_UUID_GATT_CHRC then it
would always return handle = 0. This meant that
bt_gatt_find_by_uuid would always use handle = 0 as the starting
handle for non-BT_UUID_GATT_CHRC attributes, instead of the handle
of the provided attr.
This was not an issue for any UUIDs that may only exist once on a
GATT server, which is most UUIDs, but for UUIDs like the
BT_UUID_TBS_* UUIDs that may be multiple instances of, it would
always return the first attribute rather than the one starting
from the provided start attr.
This commit also ensures that we do not overflow the `end_handle`
when adding 2 uint16_t values.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Fix byteorder handling in csip sef crypto function.
On big-endian system we also need to convert the k array from
little-endian to big-endian. The Bluetooth protocol is always using
little-endian ordering.
Signed-off-by: Joakim Andersson <joerchan@gmail.com>
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 <vich@nordicsemi.no>
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 <vich@nordicsemi.no>
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 <vich@nordicsemi.no>
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 <vich@nordicsemi.no>
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 <vich@nordicsemi.no>
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 <vich@nordicsemi.no>
Update advanced non-overlapping Central Connection Creation
scheduling for single timer use support required for nRF54L
Series SoCs.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
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 <vich@nordicsemi.no>
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 <vich@nordicsemi.no>
This reverts commit a7fff7445c.
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 <vich@nordicsemi.no>
Restrict the jitter considered in the PDU reception in the
subevents of ISO Sync Receiver.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
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 <vich@nordicsemi.no>
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 <vich@nordicsemi.no>
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 <vich@nordicsemi.no>
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 bcd28e0a86 ("Bluetooth: Controller: Fix
sw switch single timer for spurious TXEN/RXEN").
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
In current implementation, the `accept` cannot be identified if the
same one `accept` callback is passed by the upper layer.
Similar with `accept` of `bt_l2cap_server.accept`, add a parameter
`server` to the `bt_rfcomm_server.accept` callback.
Add a argument `server` to function bt_hfp_hf_accept() to avoid
building issue for HFP_HF.
Add a argument `server` to function rfcomm_accept() to avoid building
issue for shell/rfcomm.c.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
In the function `bt_rfcomm_server_register()`, the channel cannot be
dynamic allocated. And only pre-set channel is supported.
Improve the function `bt_rfcomm_server_register()` to support the
dynamic channel allocation if the passed channel is zero.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
The buffer `BT_RFCOMM_BUF_SIZE` is used to define the TX buffer size of
TX pool.
In current implementation, the TX buffer size of RFCOMM cannot be
calculated due to the macro `BT_RFCOMM_BUF_SIZE` is defined in internal
header file `rfcomm_internal.h`.
Move the macro `BT_RFCOMM_BUF_SIZE` form internal header file
`rfcomm_internal.h` to interface `rfcomm.h`.
Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
BASE is now parsed on-the-fly on sink sync, removing
unnecessary restriction in intermediate parsed storage
and without requiring an excessive amount of memory.
Signed-off-by: Lars Knudsen <LAKD@demant.com>
As the connection was removed from the list, we now own its reference.
Keep this reference and return it to the TX processor.
Signed-off-by: Ahmed Ahmed <ahmed.ahmed@dewinelabs.com>
Assert that the previous connection in the list and the tmp element
in the loop are different to the current connection.
Otherwise, if the same connection was somehow added twice it
could result in an infinite loop.
Signed-off-by: Ahmed Ahmed <ahmed.ahmed@dewinelabs.com>
Iterate over the list of connections to find a connection
that is able to send data, instead of returning NULL if
the first connection can't send data.
This solves the problem with starvation of other connections.
Signed-off-by: Ahmed Ahmed <ahmed.ahmed@dewinelabs.com>
We can't use 0xff to compare with an int8_t since it'll trigger compiler
warnings/errors:
subsys/bluetooth/host/classic/br.c:397:11: error: result of comparison of
constant 255 with expression of type 'int8_t' (aka 'signed char') is
always false [-Werror,-Wtautological-constant-out-of-range-compare]
if (rssi == 0xff) {
~~ ^ ~~
1 error generated.
Use 127 instead for situations where we don't know the RSSI value, like
when processing remote name events. This is fine since from a spec
perspective only -127 - +20 are valid values for the parameter.
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
Allow the user to disable the P256-M driver in case their version of
Mbed TLS does not support this driver.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
Explicitly enable "PSA_WANT_ALG_ECB_NO_PADDING" to select the AES ECB
mode that it is used in CMAC operation.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
MBEDTLS_AES_ROM_TABLES let Mbed TLS use precomputed AES tables instead
of generating them at runtime and placing in RAM. It clearly helps
reducing the RAM footprint, but at the same time it increases the ROM
one. In order to let the final user decide which kind of optimization
they prefer, we change the "select" statement with "imply".
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
According to MshDFUv1.0, section 6.2.3.5, the Firmware Distribution
Receivers List message is not limited by the size of the receivers list:
```
The number of selected entries shall be limited by the following:
- The number of entries shall not exceed the value of the Entries Limit
field from the Firmware Distribution Receivers Get message.
- The number of entries shall not cause the message payload to exceed
the maximum Access PDU size.
```
Thus, this assertion is incorrect as it doesn't allow to have the
receivers list bigger than number of maximal Access PDU size.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Instead of having 2 separate and non-equal checks for
capabilities in ASCS and the Broadcast Sink, there is now
a single function in pacs.c that performs the
check.
This reduces code size and makes it easier to maintain.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Move the contents of Kconfig.iso to the common Kconfig
file.
The main reason for this is that the Kconfig.iso filename
has caused issues for some, due to the .iso filename extension.
The contents have been moved to right after the Kconfig options
for BT_CONN which are quite similar.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
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 <vich@nordicsemi.no>
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 <vich@nordicsemi.no>
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 <mtpr@oticon.com>
* Move all KConfig configuration from CMake to `nrfx_kconfig.h`
* Move macro utils from `nrfx_kconfig.h` to `nrfx_zephyr_utils.h`
* Move GRTC channels allocation from `nrfx_kconfig.h` to
`nrfx_reserved_resources.h`
Signed-off-by: Marcin Szymczyk <marcin.szymczyk@nordicsemi.no>
Commit:
- adds dependency of the mbedtls psa usage on secure storage
- removes PSA ITS emulator and enables usage of
the secure storage in ble mesh bsim tests
- enables secure storage in all ble mesh and related samples
Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
This commit removes the `ctx_shell` declaration from the Bluetooth shell,
marking a milestone in eliminating this dependency.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
This change aims to eliminate the dependency on `ctx_shell` in
the Bluetooth `classic/shell/*`, making the code more maintainable.
Replaced `shell_*` functions that depended on `ctx_shell` with
the appropriate `bt_shell_*` functions.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
This change aims to eliminate the dependency on `ctx_shell` in
the Bluetooth `mesh/shell/*`, making the code more maintainable.
Replaced `shell_*` functions that depended on `ctx_shell` with
the appropriate `bt_shell_*` functions.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
This change aims to eliminate the dependency on `ctx_shell` in
the Bluetooth `audio/shell/*`, making the code more maintainable.
Replaced `shell_*` functions that depended on `ctx_shell` with
the appropriate `bt_shell_*` functions.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Relocated `bt_shell_private.c` to the `common` folder to enable
independent use between `BT_SHELL` and `BT_MESH_SHELL`.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>