Commit graph

22128 commits

Author SHA1 Message Date
Pavel Vasilyev
fe5b266ddb bluetooth: mesh: pb_adv: check TotalLength against adv buf length
Check that the buffer length of the received advertising data is less
than reported TotalLength in Transaction Start PDU.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2025-09-01 07:44:57 -04:00
Fin Maaß
d5c29cc1e2 dfu: mcuboot: return flash area id without intermediate var
return flash area id directly without intermediate var.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-09-01 12:01:01 +02:00
Vinayak Kariappa Chettimada
67126ab8aa Bluetooth: Controller: Fix building with Privacy without LE Encryption
Fix building with Privacy feature without enabling LE
Encryption support. This should allow being either Observer
or Broadcaster role with Privacy features.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-08-29 18:20:22 +02:00
Tomi Fontanilles
90650158bb doc: secure_storage: document the 30-bit UID
Add a bullet point for this new, relatively important deviation from
the official specification.

Also, advertise the Zephyr-specific zephyr/psa/* header files as they
are related and probably need more attention from end users.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2025-08-29 18:19:36 +02:00
Tomi Fontanilles
1e78561cff secure_storage: use %# flag character for hex printing
Instead of literally having 0x in the format string, use the %# flag
character so the printf implementation adds the 0x for us.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2025-08-29 18:19:36 +02:00
Tomi Fontanilles
1a477748aa secure_storage: its: use %l printf length modifier
Cast the UIDs to unsigned long when they are 32 bits.
This allows to use a single %l length modifier instead of the double
one for long long.

Certain printf implementations only support the former and not the
latter length modifier, so this has the advantage to work with them
now that the UIDs are 32-bit by default.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2025-08-29 18:19:36 +02:00
Tomi Fontanilles
806c344146 secure_storage: make UIDs 32-bit
Make the storage UID type 32-bit long.
This makes it more convenient to use those UIDs as storage entry IDs
when storing the entries to NVM.
The previous 64+ bits UIDs made it incovenient to use them as such.
As Zephyr defines UID ranges to be used (see
e.g. `zephyr/psa/key_ids.h`), this guarantees that all the UIDs will
fit within the 30 bits reserved for them.

The secure storage ITS implementation API is changed to take
`psa_storage_uid_t` separately so the implementation can check
that no forbidden bits are set before they are packed into
`secure_storage_its_uid_t`.

This change breaks backward compatibility because
`secure_storage_its_uid_t`, which is used both as part of the additional
data for authentication and for generating encryption keys, changes
size from 12 to 4 bytes.
For users wanting to preserve backward compatibility (for example when
upgrading an existing installation to a newer Zephyr release) or that
for some reason want to use a 64-bit `psa_storage_uid_t`, the Kconfig
option CONFIG_SECURE_STORAGE_64_BIT_UID is added. When enabled, it
makes the implementation behave the same as previously and compatibility
with existing entries is preserved. This was tested manually.

Fixes zephyrproject-rtos/zephyr#86177.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2025-08-29 18:19:36 +02:00
Bjarki Arge Andreasen
26888c8fcc modem: modules: remove EXPERIMENTAL
Remove the EXPERIMENTAL label from the MODEM_MODULES and update
API version to 1.0.0. These modules are fully tested and widely
used, and have been present for 2 years.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2025-08-29 18:19:27 +02:00
Mark Wang
101add04bb bluetooth: avdtp: fix the checking of rsp_handler
rsp_handler should be used instead of cmd_handler

Signed-off-by: Mark Wang <yichang.wang@nxp.com>
2025-08-29 13:15:19 +02:00
James Roy
7cb48cce26 ztest: Fix the test_status variable to use the ztest_status enum
global variable `test_status` should use the enum instead
of equivalent integers (such as `1`).

Signed-off-by: James Roy <rruuaanng@outlook.com>
2025-08-29 13:14:58 +02:00
Jaakko Korhonen
7390004b06 shell: modules: devmem: fix devmem load occasionally losing bytes
Changed devmem load to process all characters from the *recv buffer.

Signed-off-by: Jaakko Korhonen <jaakko.korhonen@nordicsemi.no>
2025-08-29 09:01:20 +02:00
Łukasz Duda
6c75315c86 openthread: Use OPENTHREAD instead of L2_OPENTHREAD in dependencies
Update Kconfig dependencies in mbedTLS and logging backend to use
OPENTHREAD instead of NET_L2_OPENTHREAD.

Signed-off-by: Łukasz Duda <lukasz.duda@nordicsemi.no>
2025-08-28 19:57:41 +02:00
Vinayak Kariappa Chettimada
4277e9ae8b tests: bsim: Bluetooth: Param update implementation review rework
Updated the test with review rework, and added comments.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-08-28 19:57:28 +02:00
Vinayak Kariappa Chettimada
0d1b4d2ba6 Bluetooth: Controller: Fix prepare pipeline for overlapping events
Fix prepare pipeline processing of overlapping events by
including ticks_at_expire value to uniquely identify
overlapping events.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-08-28 19:57:28 +02:00
Vinayak Kariappa Chettimada
93b951d6fb Bluetooth: Controller: Fix prepare pipeline overflow in observer role
Fix long standing bug in processing resume events that cause
prepare pipeline overflow due to incorrectly enqueueing up
preemptor events as duplicate events in the pipeline where
being aborted before currently active event.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-08-28 19:57:28 +02:00
Vinayak Kariappa Chettimada
c2eb901ea1 Bluetooth: Controller: Introduce prepare deferred feature
Introduce prepare being deferred due to previous events
desire to continue. In such case the deferred prepare param
will have the defer flag set.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-08-28 19:57:28 +02:00
Vinayak Kariappa Chettimada
8ecb264fec Bluetooth: Controller: Disable connection event continuation on overlap
Disable connection event continuation on overlap with same
connection's next event. This implementation has bugs and
needs to be fixed in subsequent commits.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-08-28 19:57:28 +02:00
Vinayak Kariappa Chettimada
2d732e292a Bluetooth: Controller: Fix stuck forced continuation under throughput
Fix stuck forced continuation of connection event under high
throughput scenario. At near supervision timeout the force
flag is set, but in the next connection event if full
connection interval is used for data transmission and a
subsequent request to abort happens it was not honoured
causing the tx-rx chain to keep continuing until supervision
timeout.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-08-28 19:57:28 +02:00
Vinayak Kariappa Chettimada
2b49185452 Bluetooth: Controller: Fix window widening on connection update
Fix window widening on connection update to current window
widening periodic at the instant, and use new periodic
window widening for subsequent new connection interval.

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

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-08-28 19:57:28 +02:00
Vinayak Kariappa Chettimada
c0fbfc3bb8 Bluetooth: Controller: Fix drift compensation on connection update
Fix drift compensation applied late under high throughput at
after the instant has passed for a connection update.

Workaround test failures due to Zephyr Controller scheduling
overlap causing Periodic Advertising Sync timeouts, ACL
connection failed to be established or Controller assertion
when having latency at the CIS setup instant.

Workaround by using `-start_offset` to ensure that the ACL
established does not overlap the sink being established.

Relates to commit 5f852998d0 ("tests: bsim: Bluetooth:
Workaround Zephyr Controller scheduling overlap").

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-08-28 19:57:28 +02:00
Vinayak Kariappa Chettimada
58091b181f Bluetooth: Controller: Fix conn timeout due to delayed conn upd ind
Unlike legacy Zephyr Controller's double headed Tx queue
linked list, the new split Zephyr Controller's new LLCP does
not place a control PDU at the head of the Tx queue causing
control PDUs to be delayed on air.

Pause the data enqueue until pending PDUs are transmitted
across before enqueuing LE Connection Update Ind PDU, and
thereafter resume other PDUs being enqueued again.

There can still be connection timeout if enqueued PDUs are
not being transmitted/acked during repeated retransmissions.

Updated bap_unicast_audio_acl_disconnect test to not use
random seed, to be similar to unicast_client test; to get
it to pass without overlapping state/roles casing connection
failed to be established after the changes in this PR.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-08-28 19:57:28 +02:00
Vinayak Kariappa Chettimada
852422522c Bluetooth: Controller: Fix LLCP event_counter used during current event
Fix LLCP to use event_counter in the current event to
compare instant when trying to check instant passed on
reception of PDU with instant.

Fixes regression in commit e3e410aeed ("Bluetooth: Controller:
Fix LLCP event_counter value used during prepare").

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-08-28 19:57:28 +02:00
Vinayak Kariappa Chettimada
daffb534ba Bluetooth: Controller: Remove duplicate define CONN_DATA_BUFFERS
Remove duplicate define CONN_DATA_BUFFERS and use
CONFIG_BT_BUF_ACL_TX_COUNT instead.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-08-28 19:57:28 +02:00
Vinayak Kariappa Chettimada
3e2beedb21 Bluetooth: Controller: Minor update adding comments
Minor update adding comments in the implementation.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-08-28 19:57:28 +02:00
Vinayak Kariappa Chettimada
043dee2919 Bluetooth: Controller: Move declaration close to locality of reference
Move the declaration code to locality of reference and be
consistent in how the code pattern is, related to calling
LLL disable.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-08-28 19:57:28 +02:00
Vinayak Kariappa Chettimada
e94d9c7811 Bluetooth: Controller: Fix event overhead check for single timer use
Single timer use needs additional event overhead to start
radio to ensure the software switch implementation executing
in radio completion ISR can correctly set the tIFS switching
after a maximum radio ISR latency.

The latency value shall be the used additional overhead so
that there is no spurious tIFS switch before radio ISR
executes.

The additional event overhead value is not considered in the
event overhead check.

Relates to commit 37bf99eee7 ("Bluetooth: Controller: Fix
radio_tmr_start_us for single timer use").

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-08-28 19:57:28 +02:00
Vinayak Kariappa Chettimada
66d85b448b Bluetooth: Controller: Fix assertion establishing connection
Fix an assertion detecting delayed prepare establishing an
ACL connection due to scanner or advertiser not disabled
immediately when scheduling the first connection event.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-08-28 19:57:28 +02:00
Vinayak Kariappa Chettimada
fe7675e209 Bluetooth: Controller: Fix assertion due to cleared pending radio IRQ
Fix assertion on scan disable observed in BabbleSIM audio
tests due to clearing of pending radio IRQ under race
conditions between scanning being stopped by application
and scanning stopped on central connection setup.

irq_enable/disable is not needed either as radio_isr_set
is always called from Radio or LLL execution context which
are co-operative with each other at same execution priority.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-08-28 19:57:28 +02:00
Vinayak Kariappa Chettimada
355648a69f Bluetooth: Controller: Fix missing radio tmr status reset
Fix missing radio tmr status reset on radio_disable call,
without this which disables PPI/DPPI caused under race
conditions the radio to transition into Tx or Rx state and
put the Controller's state out of sync with the Radio
peripherals internal state. The symptoms being that the
Central role was not transmitting in the next interval;
also, caused the defer iterations to reach maximum events
being enqueued in the pipeline, and manifesting as large
CPU overheads in redundant prepare of deferred events.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-08-28 19:57:28 +02:00
Vinayak Kariappa Chettimada
4b272e0b33 Bluetooth: Controller: Fix missing radio status reset
Fix missing radio status reset on early abort of central
and peripheral prepare.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-08-28 19:57:28 +02:00
Aleksander Wasaznik
73fbdbe1e7 Bluetooth: document bt_addr_le_is_resolved()
I believe there is some confusion about what this function does. This
function is doing some type-bending, so it's extra important to document
it.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2025-08-28 13:59:45 +02:00
Lyle Zhu
613dcf327e Bluetooth: Classic: SCO: Get SCO conn info
Save the air_mode to SCO connect object.

Add a structure `struct bt_conn_sco_info` to return the SCO conn info.

Return SCO info through `struct bt_conn_sco_info` when calling the
function `bt_conn_get_info()`.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-08-28 13:59:10 +02:00
Alex Fabre
714cbd85ec log: backend: net: add const qualifier to hostname
When setting the net log hostname, the string content is not modified.

Signed-off-by: Alex Fabre <alex.fabre@rtone.fr>
2025-08-28 11:32:11 +02:00
Bastien Beauchamp
ad849debee pm: skip min_residency_ticks calculation if input is 0
In the default PM policy, the function k_us_to_ticks_ceil32() is used
and does calculation using 64-bit integers which can be slow and
avoidable if the input is 0.

Signed-off-by: Bastien Beauchamp <bastien.beauchamp@silabs.com>
2025-08-28 08:57:06 +02:00
Aaron Ye
8bbc05df71 Bluetooth: Host: direction: correct the cte_req_enable opcode
The opcode of hci_df_set_conn_cte_req_enable command should be
BT_HCI_OP_LE_CONN_CTE_REQ_ENABLE (0x2056).

Signed-off-by: Aaron Ye <aye@ambiq.com>
2025-08-28 06:24:33 +02:00
Cheng Chang
2768acb856 bluetooth: host: avdtp: Fix command and response format error
There are three aspects of changes involved:
1.  The format of Service Category should be checked  in set
configuration cmd and error code and Service Category
should be detailed in response.
2. There is no  INT Stream Endpoint ID in re_config cmd,.
3. Fail ACP SEID should be added to start and suspend rej rsp.

Signed-off-by: Cheng Chang <cheng.chang@nxp.com>
2025-08-28 06:24:19 +02:00
Emil Gydesen
56b0e3eb34 Bluetooth: Host: Rearrange fields in bt_le_ext_adv
Move the CONFIG_BT_EXT_ADV fields up and have the 2
8-bit values first, so they can be placed in the same
word as the previous 2 when applicable.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-08-27 20:52:19 +02:00
Emil Gydesen
ef700ec525 Bluetooth: CAP: Remove sid from u->b handover params
The SID is now gettable via bt_le_ext_adv_get_info.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-08-27 20:52:19 +02:00
Emil Gydesen
bbcbcbfc41 Bluetooth: Adv: Store SID and expose via adv_info
Store the SID in the advertising set, and let it be possible
to get it again via bt_le_ext_adv_get_info.

The SID may be used by higher layers to shared information
about the advertising set.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-08-27 20:52:19 +02:00
Emil Gydesen
b714ea3484 Bluetooth: Shell: Increment SID per set
Instead of always using SID=0 for advertising sets (which can be
tricky if there are multiple advertising sets using the same SID
and address), the SID will be incremented and wrap around when
reaching the max to reduce the risk of 2 or more sets having the
same SID.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-08-27 20:52:19 +02:00
Sean Kyer
3a54a4d123 settings: Add EXPERIMENTAL to TF-M ITS backend
Add select EXPERIMENTAL to the TF-M ITS
backend of the settings subsystem.

Signed-off-by: Sean Kyer <sean.actor@gmail.com>
2025-08-27 16:35:23 +02:00
Sean Kyer
20360ff4da settings: Remove default selection of TF-M ITS backend
Remove the default selection of SETTINGS_TFM_ITS when
TFM_PARTITION_INTERNAL_TRUSTED_STORAGE is enabled
which caused this backend to be built when it was
not intended.

Signed-off-by: Sean Kyer <sean.actor@gmail.com>
2025-08-27 16:35:23 +02:00
Lyle Zhu
5245307512 Bluetooth: GATT: Check len of response before parsing response PDU
In function `parse_read_by_uuid()`, the response length is not checked
before parsing the response PDU. There is a potential issue that the
`len` will be underflowed if the `len` is less than the size of
`struct bt_att_data`.

Check the length before parsing the response PDU. If the length is less
then the size of `struct bt_att_data`, notify the upper layer with the
error `BT_ATT_ERR_INVALID_PDU` and stop the parsing.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-08-27 15:16:47 +02:00
Jeppe Odgaard
cbc2b3b540 shell: mqtt: remove username and password preprocessor checks
`#ifdef` will always evaluate to true when used on string Kconfig options.
Therefore username and password is set to "" if unset in Kconfig which is
not an issue.

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
2025-08-27 09:47:04 +02:00
Mike J. Chen
ebab75bb73 nvs: support sector_size of 64KB
Allows NVS to work with flash device configured to
use only 64KB block erase. Due to how addresses
are encoded internally in NVS, 64KB is the maximum
sector size. Add a test for this during mount.

Add a native_sim unit test case for 64kb erase block size

Signed-off-by: Mike J. Chen <mjchen@google.com>
2025-08-26 16:13:23 +02:00
Jeppe Odgaard
a8c8f7f2b8 shell: mqtt: select NET_CONNECTION_MANAGER
Replace `select NET_MGMT` and `select NET_MGMT_EVENT` with
`select NET_CONNECTION_MANAGER` to get L4 events.

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
2025-08-26 13:25:47 +02:00
Jeppe Odgaard
ddc4479243 shell: mqtt: use topic levels
Change topic from <device_id>_rx (and tx) to <device_id>/sh/rx.

This allows use of wildcards. E.g. subscribe to all devices "+/sh/tx".

Level "sh" is added to the topic to make it less generic and prevent
potential clashes with other topics.

The topic part after <device_id> is configurable via Kconfig.

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
2025-08-26 13:25:47 +02:00
Vinayak Kariappa Chettimada
3461135d02 Bluetooth: Controller: Fix assertion in scan aux release
Fix assertion under race conditions where LLL scheduling
did not have an auxiliary context assigned but when node rx
is released an auxiliary context is picked from the scan
context that has no parent assigned yet due to a previously
assigned auxiliary context to the scan context was not
cleared.

Relates to commit 49642efa41 ("Bluetooth: Controller: Fix
regression in scan aux release").

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-08-26 11:34:36 +02:00
Vinayak Kariappa Chettimada
5ce9d0c621 Bluetooth: Controller: Fix extended scanning assert on invalid chan_idx
Fix extended scanning assert on invalid chan_idx received in
the aux pointer structure.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-08-26 11:34:36 +02:00
Make Shi
9cfbed62df Bluetooth: Shell: AVRCP: Shell interface for browsing support
- Add shell interface for browsing connect and disconnect testing and
  SetBrowsedPlayer command testing.

Signed-off-by: Make Shi <make.shi@nxp.com>
2025-08-26 09:32:21 +02:00