Commit graph

22,555 commits

Author SHA1 Message Date
Benjamin Cabé
dd4bf1aadc pm: policy: doc: fix spelling of help text
s/whithout/without/

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-09-03 17:04:13 +02:00
Benjamin Cabé
89fef8aa6d doc: correct the spelling of "comparison"
s/comparision/comparison/

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-09-03 17:04:13 +02:00
Benjamin Cabé
637f1cd411 net: shell: dns: use int type for %.*s format specifier
The `%.*s` format specifier expects an int so cast the size_t parameter
to int.

Fixes an issue spotted in CI for:

    west twister -p native_sim/native/64 -s sample.net.dns_resolve.mdns

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-09-03 14:53:17 +03:00
Emil Gydesen
29f5628c7f Bluetooth: CAP: Add bt_cap_unicast_group_get_info
Add bt_cap_unicast_group_get_info to get information about
a CAP unicast group. For now this just contain the pointer
to the BAP unicast group, which then can be used with
bt_bap_unicast_group_get_info to get information specific
to BAP. The bt_cap_unicast_group_info struct can later be
expanded with any additional information CAP may add.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-09-03 13:49:54 +03:00
Emil Gydesen
dae29d344a Bluetooth: BAP: Add bt_bap_unicast_group_get_info
Add bt_bap_unicast_group_get_info to get information
about a unicast group. In this first iteration the info
struct only contains the sink and source presentation
delay, but the info struct can easily be expanded on
later to contain more.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-09-03 13:49:54 +03:00
Emil Gydesen
e42e875777 Bluetooth: BAP: Add validation of presentation delay
BAP section 7.1 states that all streams in a direction shall
have the same presentation delay. To achieve this, we need to
store the configured presentation delay for a unicast group,
so that we can compare with the new presentation delay.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-09-03 13:49:54 +03:00
Flavio Ceolin
9fdbe5f66e bt: host/classic: Use proper flexible array
0 length array is a GNU extension. Use proper C99 flexible
array.

Signed-off-by: Flavio Ceolin <flavio@hubblenetwork.com>
2025-09-03 13:49:31 +03:00
Flavio Ceolin
1441a5a9dc bt: controller/openisa: Use proper flexible array
0 length array is a GNU extension. Use proper C99 flexible
array.

Signed-off-by: Flavio Ceolin <flavio@hubblenetwork.com>
2025-09-03 13:49:31 +03:00
Flavio Ceolin
e50da84e74 bt: host/classic: Use proper flexible array
0 length array is a GNU extension. Use proper C99 flexible
array.

Signed-off-by: Flavio Ceolin <flavio@hubblenetwork.com>
2025-09-03 13:49:31 +03:00
Flavio Ceolin
bb66123ecd bt: controller/util: Use proper flexible array
0 length array is a GNU extension. Use proper C99 flexible
array.

Signed-off-by: Flavio Ceolin <flavio@hubblenetwork.com>
2025-09-03 13:49:31 +03:00
Flavio Ceolin
6f0e9caa9c bt: audio: Use proper flexible array
0 length array is a GNU extension. Use proper C99 flexible
array.

Signed-off-by: Flavio Ceolin <flavio@hubblenetwork.com>
2025-09-03 13:49:31 +03:00
Jun Lin
e9d470b2f4 ec_host_cmd: shi: npcx: not reset when receiving bad data
When the SHI driver receives data from the host and finds it is invalid
(due to a checksum error or an unsupported protocol version),
it currently resets the state machine, initializes the output buffer,
and waits for CS de-assertion. Upon CS de-assertion, the driver resets
the state machine and initializes the output buffer again. This commit
removes the first redundant reset and re-initialization in the function
`shi_npcx_bad_received_data()`, improving the driver’s efficiency.

Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
2025-09-03 06:09:25 +02:00
Vinayak Kariappa Chettimada
230df77993 Bluetooth: Controller: Relax radio packet pointer assignment deadline
Relax the radio packet pointer assignment deadline assertion
until access address being transmitted. The PDU buffer is
probably only needed just after access address is being
transmitted or received by the radio. This will give some
more breathing room for slow CPUs like in nRF51x SoCs.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-09-03 01:36:57 +02:00
Pisit Sawangvonganan
fa3f2e1b2a modbus: serial: rename rtu_tx_adu to modbus_rtu_tx_adu
Renamed the static function `rtu_tx_adu` to `modbus_rtu_tx_adu`
for naming consistency with `modbus_rtu_rx_adu`.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2025-09-03 01:10:49 +02:00
Syver Haraldsen
6331225c94 storage/stream_flash: Add API to query buffered data size
add a wrapper function to read the number of bytes currently buffered
and pending for the next flash write operation.

Signed-off-by: Syver Haraldsen <syver.haraldsen@nordicsemi.no>
2025-09-02 18:42:45 +02:00
Charles Hardin
633246a3ea net: dns: add query support for additional types CNAME, SRV, and TXT
These types are useful for IoT deployments and should be available
thru the resolver interface to get the data. The SRV is especially
useful to find services on the local network when not using a dns-sd
deployment and just something like Avanhi or Bonjour.

Signed-off-by: Charles Hardin <ckhardin@gmail.com>
2025-09-02 18:42:35 +02:00
Charles Hardin
b60ae6fb1a net: dns: only add periods between labels and not on the first label
When resolving SRV records - the label might not be compressed so
the first entry into the net buf is the start of the name and a
period could end up at the start - ie. ".example.local" so only add
a period when the buffer is not empty.

Signed-off-by: Charles Hardin <ckhardin@gmail.com>
2025-09-02 18:42:35 +02:00
Charles Hardin
ece1ed567b net: dns: adjust the enum for response type to be positive on success
The enum will auto increment, so in debug the IP and DATA records are
negative numbers which initially made this look like an error, so just
push the expected good values to be positive numbers in case of a print
or something else would imply these are ok.

Signed-off-by: Charles Hardin <ckhardin@gmail.com>
2025-09-02 18:42:35 +02:00
Emil Gydesen
2dc358cee2 Bluetooth: ISO: Add check to prevent premature BIG termination
There was an issue where terminating the BIG while in the
ISO connected callbacks could lead to continueing the loops
would cause access to cleared memory.

The simple solution to this is to simply prevent
bt_iso_big_terminate from terminating the BIGs while we are
processing the BIG HCI events.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-09-02 18:42:04 +02:00
Emil Gydesen
258e793cc8 Bluetooth: ISO: Shell: Fix bcode for big_create
The broadcast code was attempting to read from argv[1] instead
of argv[2] that actually contains the broadcast code.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-09-02 18:41:32 +02:00
Theis Mejnertsen
aca602f2d0 fs: zms: add input validation of fs pointer for api
Add checks on the fs pointer passed through the api before using to
avoid causing an exception

Signed-off-by: Theis Mejnertsen <theismejnertsen@gmail.com>
2025-09-02 15:54:17 +02:00
Theis Mejnertsen
4e4482205f fs: zms: make zms_active_sector_free_space return type signed
zms_active_sector_free_space is documented to return -EACCES on fs not
mounted error but currently returns an usigned type size_t. This fixes
that by changing the return value into a ssize_t

Signed-off-by: Theis Mejnertsen <theismejnertsen@gmail.com>
2025-09-02 15:54:17 +02:00
Emil Gydesen
600010cf5f Bluetooth: BAP: Switch to new USB stack for BAP shell
Modify the BAP shell to use the new USB stack, as the current
one used is now deprecated.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-09-02 12:33:11 +02:00
Emil Gydesen
4059d5b6a7 Bluetooth: CAP: Implement bt_cap_initiator_broadcast_foreach_stream
Implement the function bt_cap_initiator_broadcast_foreach_stream that
allows users to iterate on all BAP streams in a BAP broadcast source.
This can be used to easily get references to other broadcast streams in
the same group.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-09-02 11:10:22 +02:00
Pavel Vasilyev
427cf0da6a bluetooth: mesh: pb_adv: check SegN in Transaction Continuation PDU
Check that SegN is not 0. SegN = 0 is invalid as the first segment is
sent in Transaction Start PDU.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2025-09-02 11:09:59 +02:00
Emil Gydesen
90e5b7d658 Bluetooth: Shell: Only add broadcast audio val one place
Instead of add BT_UUID_BROADCAST_AUDIO_VAL for either BAP or
CAP, we now only do it one place (in BAP). This can now be done
since the default_source.broadcast_id was recently added.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-09-01 16:41:05 +02:00
Emil Gydesen
6fe1474225 Bluetooth: Audio: Shell: Store broadcast_id statically
Add a broadcast_id field in broadcast_source so that it can be
lookup later, which is useful for doing broadcast assitant
procedures on a local broadcast source.

The broadcast ID is now created at the same time as the
broadcast source(s), instead at the time of retriving
the advertising data.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-09-01 16:41:05 +02:00
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