Commit graph

22,555 commits

Author SHA1 Message Date
Robert Lubos
75ef63921d net: coap_client: Move send buffer into request context
Keep a separate buffer for each request context instead of having a
single common buffer for the entire client context. This allows to
simplify the retransmission logic, as parallel requests will no longer
overwrite the buffer for each other. That way, we can simply retransmit
the packet w/o a need to recreate it, and thus reach to the payload
pointer or callback.

This removes the requirement to keep the payload pointer, provided to
asynchronous coap_client_req() call, valid throughout the exchange
lifetime for simple cases (i.e. no block transfer used). In case of
block transfer, this is unavoidable and needs to be documented.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-10-14 12:50:39 +03:00
Robert Lubos
f7e9d21936 net: coap_client: Use buffers instead of pointers for path and options
Use buffers instead of pointers for path and extra options provided in
the struct coap_client_request, so that the library keeps a copy of the
path/options instead of pointers. That way, the library can still work
correctly in case of retransmissions or block transfer in case when the
original path or options were automatic variables that went out of
context.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-10-14 12:50:39 +03:00
Seppo Takalo
9d93594de9 modem: cmux: Define macros for header size
Define CMUX_HEADER_SIZE macro that is 6 or 7 bytes depending on
MTU.

Remove the previous CMUX_FRAME_SIZE_MAX that was a bit misleading
as it meant only the header size without data and was fixed to 7 bytes.

Redefine new macros CMUX_FRAME_SIZE_MAX and CMUX_FRAME_SIZE_MIN which
are actually frame sizes with data included.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2025-10-14 12:50:30 +03:00
Tom Burdick
6c21c3f817 samples: mctp: Add sample.yaml's to samples
Adds the missing sample.yaml's for building these in CI and with
twister.

Fixes a build issue that came up along the way.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2025-10-13 18:13:23 -04:00
Pieter De Gendt
6728e78576 Revert "shell: Add user data argument to shell_set_bypass"
Revert a change that broke the stable API function shell_set_bypass.
This reverts commit 6b876dba1ba61b659b1b2d4c3ccd0ac41bd56027.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-10-13 18:12:42 -04:00
chao an
e83d8d957d net: dhcpv4_server: correct DHCPv4 lock scope for lease()
DHCPv4 server lease should release mutex correctly

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-10-13 11:28:11 -04:00
Triveni Danda
57a35d9cb4 net: l2: wifi: Fix override certs directory for sysbuild
Fix overriding the test certificates directory for enterprise mode
when using sysbuild. The override already works as expected without
sysbuild.

Signed-off-by: Triveni Danda <triveni.danda@nordicsemi.no>
2025-10-13 09:38:37 -04:00
Michael Zimmermann
58016ed6b6 net: socket: tls: Fix type of pointer
mbedtls_ssl_get_peer_cid takes size_t, not socklen_t.
c546c1cad1
changed the type of socklen_t to something that is incompatible with native
offloaded sockets, which caused a compiler error.

Signed-off-by: Michael Zimmermann <michael.zimmermann@sevenlab.de>
2025-10-13 09:38:26 -04:00
Jani Hirsimäki
0f214d3d9e net: ip: ipv6_nbr: p2p link: NA without link address option
Neighbor Advertisement (NA) messages without a link-layer address option
are now accepted on point-to-point links. See RFC 7066, ch. 2.2.

Signed-off-by: Jani Hirsimäki <jani.hirsimaki@nordicsemi.no>
2025-10-13 09:38:09 -04:00
Rami Saad
7d2fb6c013 mgmt: mcumgr: grp: settings_mgmt: Add capability to save setting by key
Extend the save command to allow passing name/val pair to save a
subtree or individual setting to persistent storage.
Resolves zephyrproject-rtos#90407

Co-authored-by: Jamie <40387179+nordicjm@users.noreply.github.com>
Signed-off-by: Rami Saad <rami.saad@morgansolar.com>
2025-10-13 09:35:23 -04:00
Kiara Navarro
fa2aeb1e3f logging: rtt: remove cast to void to used function arguments
The `ctx` arg is used in `data_out_drop_mode`, so casting to void should
be removed.

Signed-off-by: Kiara Navarro <knavarro@paltatech.com>
2025-10-13 08:45:03 +02:00
Kiara Navarro
e8db885acd logging: rtt: mark unused function arguments
Add missing ARG_UNUSED() to mark unused function arguments.

Signed-off-by: Kiara Navarro <knavarro@paltatech.com>
2025-10-13 08:45:03 +02:00
Emil Gydesen
1c004a08c3 Bluetooth: CCP: Client: Add support for get provider name
Add support for getting the remote bearer provider
name.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-10-13 08:43:47 +02:00
Maciej Zagrabski
b69b064242 fs: littlefs: add api call for lfs_fs_gc
Lfs provide lfs_fs_gc function for some time now.
Function allow offloading of expensive block allocation scan.

Introduce lfs_fs_gc via api call fc_gc.

Signed-off-by: Maciej Zagrabski <mzi@trackunit.com>
2025-10-10 13:00:05 -04:00
Lyle Zhu
3ac4f92625 Bluetooth: Classic: OBEX: Optimize MOPL configuration
Set the MOPL of RX and TX to `BT_OBEX_MIN_MTU` when registering OBEX
server.

Set the TX MOPL to `BT_OBEX_MIN_MTU` when sending OBEX connection
request.

Check if the MOPL of client exceeds MTU of transport when server
receives the connection request.

Check if the MOPL of server exceeds MTU of transport when client
receives the connection response.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-10-10 12:59:56 -04:00
Lyle Zhu
26065ecee3 Bluetooth: Classic: GOEP: Support multiple OBEX sessions
Split the structure `struct bt_obex` into two parts.
Part 1 `struct bt_obex`, it is the common part and shared by all OBEX
sessions which share the same one transport.
Part 2 `struct bt_obex_server` and `struct bt_obex_client`. The
`struct bt_obex_server` is used to manage the OBEX session of server
role. The `struct bt_obex_client` is used to manage the OBEX session
of client role.

Add function `bt_obex_server_register()` to register the OBEX server
with specific uuid.

Add function `bt_obex_server_unregister()` to unregister the OBEX
server.

Add function `bt_obex_make_uuid()` to make UUID.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-10-10 12:59:56 -04:00
Lyle Zhu
6d77949698 Bluetooth: GOEP: Fix L2CAP segmented RX data handling issue
The receiving segmented L2CAP data can not be handled properly. Due to
the `struct bt_l2cap_chan_ops::alloc_buf` is NULL, the partial data
will be notified through callback `struct bt_l2cap_chan_ops::recv`.
The GOEP does not consider this issue and handles it as a completed
packet. It causes the L2CAP disconnecting due to the partial packet
cannot be processed by OBEX.

Add a RX pool, and set `struct bt_l2cap_chan_ops::alloc_buf`. The
L2CAP will allocate the buffer from the pool to buff the segmented
data. Only the completed packet will be notified through
`struct bt_l2cap_chan_ops::recv`.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-10-10 12:58:54 -04:00
Tomasz Chyrowicz
32615695ad dfu: Allow to use imgtool-based headers
It is possible to add MCUboot header through --pad-header option.
In such cases, the FLASH_LOAD_OFFSET does not point to the beginning of
the slot, but to the beginning of the executable area, thus the check
for the active slot should use ranges instead of exact values.

Signed-off-by: Tomasz Chyrowicz <tomasz.chyrowicz@nordicsemi.no>
2025-10-10 12:57:45 -04:00
Christophe Dufaza
60c3de2722 bluetooth: host: remove useless internal flag BT_ADV_PERSIST
Automatic advertiser resumption is publicly deprecated since
Zephyr 4.0 [1].

Options and parameters for this behavior have been removed,
and the internal bit flag BT_ADV_PERSIST is now always false.

The behavior it used to configure (to keep advertising after a
connection has been established as long as there are connections
available) has also been removed.

[1] Bluetooth: Deprecate adv auto-resume #73395

Signed-off-by: Christophe Dufaza <chris@openmarl.org>
2025-10-10 12:56:28 -04:00
Christophe Dufaza
a1dd571f11 bluetooth: host: remove no longer used internal API bt_le_adv_resume()
Automatic advertiser resumption is publicly deprecated since
Zephyr 4.0 [1].

Options and parameters for this behavior have been removed,
as well as all calls to bt_le_adv_resume().

Also remove adv_get_options() whose bt_le_adv_resume()
is the only caller.

[1] Bluetooth: Deprecate adv auto-resume #73395

Signed-off-by: Christophe Dufaza <chris@openmarl.org>
2025-10-10 12:56:28 -04:00
Christophe Dufaza
9b5ad2f8df bluetooth: host: do not attempt to resume terminated advertising sets
Automatic advertiser resumption is publicly deprecated
since Zephyr 4.0 [1].

Options and parameters for this behavior have been removed.

[1] Bluetooth: Deprecate adv auto-resume #73395

Signed-off-by: Christophe Dufaza <chris@openmarl.org>
2025-10-10 12:56:28 -04:00
Christophe Dufaza
731e581174 bluetooth: host: do not resume periodic connectable advertisers
Automatic advertiser resumption is publicly deprecated since
Zephyr 4.0 [1].

Options and parameters for this behavior have been removed.

[1] Bluetooth: Deprecate adv auto-resume #73395

Signed-off-by: Christophe Dufaza <chris@openmarl.org>
2025-10-10 12:56:28 -04:00
Christophe Dufaza
b3a4ff0109 bluetooth: host: do not use freed connection to resume advertising
In bt_conn_unref(), if we remove the last reference to the connection,
we notify listeners that a connection object has been freed
and can be taken, then immediately reuse this freed slot
to resume advertising.

This behavior is source of errors, and automatic advertiser resumption
is publicly deprecated since Zephyr 4.0 [1].

Options and parameters for this behavior have been removed.

[1] Bluetooth: Deprecate adv auto-resume #73395

Signed-off-by: Christophe Dufaza <chris@openmarl.org>
2025-10-10 12:56:28 -04:00
Christophe Dufaza
5762ff5b58 bluetooth: host: remove transitional option _BT_LE_ADV_OPT_ONE_TIME
Automatic advertiser resumption is deprecated since Zephyr 4.0 [1].

To maintain the behavior during the deprecation period, internal
transitional symbols were introduced to replace the deprecated ones
in the implementation:

- _BT_LE_ADV_OPT_CONNECTABLE: same option bit
   as BT_LE_ADV_OPT_CONNECTABLE (deprecated)
- _BT_LE_ADV_CONN_ONE_TIME: same option bit
   as BT_LE_ADV_CONN_ONE_TIME (deprecated)

The only option for connectable advertising is now BT_LE_ADV_OPT_CONN,
whose value is _BT_LE_ADV_OPT_CONNECTABLE|_BT_LE_ADV_OPT_ONE_TIME.

We can assume _BT_LE_ADV_CONN_ONE_TIME is true for connectable
advertisers, and meaningless for non-connectable advertisers.

[1] Bluetooth: Deprecate adv auto-resume #73395

Signed-off-by: Christophe Dufaza <chris@openmarl.org>
2025-10-10 12:56:28 -04:00
Christophe Dufaza
e24d3b92a3 bluetooth: host: remove transitional option _BT_LE_ADV_OPT_CONNECTABLE
Automatic advertiser resumption is deprecated since Zephyr 4.0 [1].

To maintain the behavior during the deprecation period, internal
transitional symbols were introduced to replace the deprecated ones
in the implementation:

- _BT_LE_ADV_OPT_CONNECTABLE: same option bit
   as BT_LE_ADV_OPT_CONNECTABLE (deprecated)
- _BT_LE_ADV_CONN_ONE_TIME: same option bit
   as BT_LE_ADV_CONN_ONE_TIME (deprecated)

The only option for connectable advertising is now BT_LE_ADV_OPT_CONN,
whose value is _BT_LE_ADV_OPT_CONNECTABLE|_BT_LE_ADV_OPT_ONE_TIME.

We can substitute BT_LE_ADV_OPT_CONN for _BT_LE_ADV_OPT_CONNECTABLE
when testing if an advertising set is connectable.

Note: to fix a ClangFormat warning raised by check_compliance.py,
this commit also includes a formatting change next to the lines
actually edited (subsys/bluetooth/host/id.c:810).

[1] Bluetooth: Deprecate adv auto-resume #73395

Signed-off-by: Christophe Dufaza <chris@openmarl.org>
2025-10-10 12:56:28 -04:00
Kiril Tzvetanov Goguev
7ea8b4478d lwm2m: Add missing offset param to write_package_cb calls for SWMGMT
Offset introduced by https://github.com/zephyrproject-rtos/zephyr/pull/72590 is missing
for write_package_cb call in SWGMGT OBJ this fixes compile issues
by adding the offset parameter

Signed-off-by: Kiril Tzvetanov Goguev <kiril.goguev@voiapp.io>
2025-10-10 12:56:04 -04:00
Cristian Bulacu
7a41ed320b net: ipv6_nbr: Handle lifetime from RDNSS message
When an IPV6 message that contains an RDNSS ICMPV6 option with a lifetime
equal to 0 is received, proceed to delete the indicated recursive DNS
servers listed in that option.

Signed-off-by: Cristian Bulacu <cristian.bulacu@nxp.com>
2025-10-10 12:55:46 -04:00
Cristian Bulacu
975635fc17 net: dns_resolve: Remove DNS server by specified address
This commit implements removal of a DNS server by specifing an IP
address.

Signed-off-by: Cristian Bulacu <cristian.bulacu@nxp.com>
2025-10-10 12:55:46 -04:00
Måns Ansgariusson
ebe128e61f subsys/tracing: Remove retired k_pipe references in SYSVIEW config
Due to the k_pipe rework, references to k_pipe in the SYSVIEW configuration
are now obsolete. This commit removes these references.

Signed-off-by: Måns Ansgariusson <Mansgariusson@gmail.com>
2025-10-10 12:55:37 -04:00
Emil Gydesen
d4afa1989f Bluetooth: Host: Change WRN->DBG for not connect for TX
The bt_conn_tx_processor logged connections not in the
connected state as LOG_WRN, but this is a case that is handled
and could occur during regular behavior.
For this reason the log statement was changed to LOG_DBG,
as the developer/user does not need to worry about it.
Also modifies the statement to log the conn->state for
debugging purposes.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-10-10 12:55:28 -04:00
Pieter De Gendt
4fa4329a16 shell: Add user data argument to shell_set_bypass
Allow passing some context to the shell bypass callback function by
providing a void pointer user data argument.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-10-10 12:53:55 -04:00
Seppo Takalo
9de7d61709 modem: cmux: Implement DM and NSC responses
Implement following responses from 3GPP TS 27.010:
5.4.6.3.8 Non Supported Command Response (NSC)
5.3.3 Disconnected Mode (DM) response

Close DLC when receiving DM response.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2025-10-09 22:55:17 +03:00
Jeppe Odgaard
d58e6efc76 shell: mqtt: cancel disconnect work on connect event
If the disconnect work has not yet run when a connect event is received the
connect event is dropped.

Prevent this behaviour by reorganizing `network_evt_handler()`.

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
2025-10-09 12:46:33 -04:00
Make Shi
528e732aad Bluetooth: Shell: BR: Add SDP discovery support for AVRCP CT/TG
Add SDP discovery handlers for AVRCP CT/TG roles and corresponding
discovery parameters and a common result handling function.

Signed-off-by: Make Shi <make.shi@nxp.com>
2025-10-09 12:42:45 -04:00
Peter Mitsis
ec9a7f8cdd cpu_freq: Add SMP support
Extends the CPU frequency scaling to support SMP for two models.

Model 1: Each CPU/core can have its frequency scaled independently
of the others.

Model 2: All CPUs/cores use the same frequency scaling.

In both models, IPIs are sent from the timer handler to each of the
CPUs to obtain the most up-to-date CPU load information. For the
first model, each CPU sets its next P-state after determining its
load. For the second model, the next P-state is set by the last
CPU/core to determine its load and is based on the CPU/core with the
highest load.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2025-10-09 12:42:32 -04:00
Peter Mitsis
613653716d cpu_freq: Add new policy APIs
Adds two new CPU frequency scaling policy APIs:
  cpu_freq_policy_reset()
  cpu_freq_policy_pstate_set()

These new APIs allow the policy to better control and isolate relevant
logic from the rest of the subsystem.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2025-10-09 12:42:32 -04:00
Peter Mitsis
63748db7c6 cpu_freq: Add default stub for cpu_freq_pstate_set()
This allows a project to select where cpu_freq_pstate_set()
gets implemented. The system integrator may choose to use
a default stub, a version implemented by the SOC, or a custom
version implemented by the project.

The existing 'native' SoC version now has its output contain
the string "SoC" while the new stub version has the string
"Stub" in its. This allows a means to differentiate between the
two.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2025-10-09 12:42:32 -04:00
Peter Mitsis
87570bae3e cpu_load: Make cpu_load_get() SMP safe
Update cpu_load_get() to work with both multiple threads as
well as multiple CPUs.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2025-10-09 12:42:32 -04:00
Vinayak Kariappa Chettimada
9b26e967ca Bluetooth: Controller: nRF54L: Fix to improve decryption speed
Fix to improve decryption speed. Decryption starts after
payload reception, hence use fastest mode to decrypt PDUs.
nRF54Lx only supports decryption after payload reception,
this implementation was already there in the code.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-10-09 12:41:43 -04:00
Vinayak Kariappa Chettimada
a5e1f59686 Bluetooth: Controller: Revert relaxed radio packet assignment deadline
Reverts relaxed radio packet assignment deadline as it is
too risky and can cause invalid bits be transmitted and/or
cause MIC failures.

Reverts commit 4dbfb22a7e ("Bluetooth: Controller: Relax
radio packet pointer assignment deadline"), and
commit 230df77993 ("Bluetooth: Controller: Relax radio
packet pointer assignment deadline").

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-10-09 12:41:43 -04:00
Vinayak Kariappa Chettimada
1fe79a65a2 Bluetooth: Controller: Use CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET
Use CONFIG_SOC_COMPATIBLE_NRF5340_CPUNET for nRF53 SoC
conditional compilations.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-10-09 12:41:43 -04:00
Robert Lubos
fa22fa37cb net: coap_client: Add optional payload callback for uploads
Add an optional payload callback field to the coap_client_request
structure, allowing the application to provide blocks of payload
interactively during the resource upload, instead of having to provide
entire payload in a single contigunous memory space.

If registered, the CoAP client library will call the payload callback
whenever a new PUT/POST message is being generated (note this is also
true for retransmissions) instead of using the payload pointer/length.
If the payload callback is NULL, then the library operates as usual.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-10-09 12:37:47 -04:00
Robert Lubos
a6560c1a7b net: coap_client: Handle block size negotiation on upload
During block uploads, the server may respond with Block 1 option with
a smaller block size than currently used (so called block size
negotiation). The CoAP client however did not read the Block 1 option
from the response, therefore ignoring the server request to lower the
block size.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-10-09 12:37:47 -04:00
Declan Snyder
74d715c5ef pm: Remove "power state consistency" check
This check is totally wrong, min-residency-us and exit-latency-us are
not related to each other at all except that the end of the residency
period occurs when the exit starts, so they are totally orthogonal
values and should not be checking if one is less than the other or
anything like this. Even in the code for the default policy manager,
they are added together, so this check is incompatible / in disagreement
with that code, so it should be removed.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-10-09 12:37:07 -04:00
Ryan Erickson
0ab308590c modem: backends: isr: notify remaining RX bytes
If there are still bytes in the RX buffer, trigger another
MODEM_PIPE_EVENT_RECEIVE_READY event.

Signed-off-by: Ryan Erickson <ryan.erickson@ezurio.com>
2025-10-09 12:35:57 -04:00
Emil Gydesen
0abb23ffad Bluetooth: ISO: rm extra log statements in chan_send
bt_iso_chan_send and bt_iso_chan_send_ts would log
twice for each TX, which is unncessary. LOG_DBG statements
include the function name by default, so the 2nd log
statement was unncessary, and were removed.

Added logging of the ts in bt_iso_chan_send_ts which
would still make it possible to tell the 2 apart,
even if CONFIG_LOG_FUNC_NAME_PREFIX_DBG=n.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-10-08 18:25:17 -07:00
Vinayak Kariappa Chettimada
7fd5dea9cc Bluetooth: Controller: Cosmetic changes to Link Layer interface
Cosmetic changes to the Link Layer interface header file.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-10-08 15:12:22 -04:00
Vinayak Kariappa Chettimada
8eae0bfbd0 Bluetooth: Controller: Fix single switch timer use in ISO Sync
Fix implementation of Broadcast ISO Synchronized Receiver
using single switch timer to consider minimum compare value
requirement.

This fix reduces latencies to setup radio receptions and
fixes an assertion in lll_sync_iso when radio_tmr_start_us()
is checked for latencies.

Relates to commit 5dfc58cff9 ("Bluetooth: Controller: Fix
single switch timer minimum compare value").

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-10-08 15:09:33 -04:00
Henrik Brix Andersen
afc65525c0 retention: remove unused API struct
Remove the unused/unnecessary retention subsystem API struct.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2025-10-08 10:09:41 +02:00
Karsten Koenig
d833556ee5 drivers: debug: Moved nrf_etr from misc
Moved the nrf_etr driver from the drive/misc folder into the recently
established driver/debug folder where it is a better fit. Moved the
associated files such as bindings and headers accordingly as well.

Signed-off-by: Karsten Koenig <karsten.koenig@nordicsemi.no>
2025-10-08 10:09:02 +02:00