Commit graph

24,075 commits

Author SHA1 Message Date
Pavel Vasilyev
a360ff7cc3 bluetooth: mesh: Fix build without settings under asan
When Mesh is built without CONFIG_BT_SETTINGS and with CONFIG_ASAN
(and CONFIG_NO_OPTIMIZATION), the call to bt_mesh_settings_set is not
optimized out. Since settings.c isn’t compiled when CONFIG_BT_SETTINGS
is disabled, the linker reports an undefined reference.

Guard the call with !IS_ENABLED(CONFIG_BT_SETTINGS) so the call and the
subsequent code is compiled out when settings are disabled.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2025-10-17 17:03:06 +03:00
Jeppe Odgaard
25d5c73b0a net: config: sntp: optionally set rtc
Set RTC when an SNTP response is received if enabled via Kconfig option.

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
2025-10-17 17:02:55 +03:00
Jeppe Odgaard
57a5b86b7f debug: thread_analyzer: replace #if IS_ENABLED
Use of IS_ENABLED in a #if statement is discouraged. Replace with #ifdef.

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
2025-10-17 17:01:30 +03:00
Jamie McCrae
a44efd9a95 mgmt: mcumgr: transport: udp: Add support for DTLS
Adds support for using DTLS for the transport

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-10-17 18:28:08 +09:00
Valerio Setti
019e26aecf bluetooth: mesh: use new Kconfig CONFIG_PSA_CRYPTO
Remove previous Kconfig choices CONFIG_BT_MESH_USES_MBEDTLS_PSA and
CONFIG_BT_MESH_USES_TFM_PSA and use CONFIG_PSA_CRYPTO instead.
This commit also updates test code accordingly.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2025-10-17 11:16:25 +02:00
Valerio Setti
1bc2db575f modules: mbedtls: add new helper Kconfig symbol PSA_CRYPTO
The goal of new Kconfig PSA_CRYPTO_PROVIDER is to automatically enable
any of the PSA Crypto API provider available for the platform without
having the user to manually pick the proper one. This provider can be
either TF-M, if that's enabled in the build, or Mbed TLS otherwise.

PSA_CRYPTO_PROVIDER simplifies also modules/subsystem Kconfigs removing
blocks as:
	select MBEDTLS if !BUILD_WITH_TFM
	select MBEDTLS_PSA_CRYPTO_C if !BUILD_WITH_TFM

Kconfig PSA_CRYPTO_PROVIDER_CUSTOM is also added to allow the end user
to add a custom implementation of PSA Crypto API instead of TF-M or
Mbed TLS ones.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2025-10-17 11:16:25 +02:00
Pieter De Gendt
1da7a115cc net: l2: wifi: shell: Add bgscan command
Add a shell command to configure the background scanning.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-10-17 11:15:37 +02:00
Pieter De Gendt
93c4dbd2e0 modules: hostap: Support bgscan
Add configuration options for background scanning (bgscan) in
wpa_supplicant.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-10-17 11:15:37 +02:00
Seppo Takalo
2cfd92410e modem: cmux: Combine state and event
Refactor internal event bits to use state enum values
and define set_state() and wait_state() so we don't need
two set of variables to maintain.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2025-10-16 22:40:21 -04:00
Qiang Zhao
56098d60b4 drivers: dsa_nxp_imx_netc: add Qbv capability
add Qbv capability for dsa_nxp_imx_netc

Signed-off-by: Qiang Zhao <qiang.zhao@nxp.com>
2025-10-16 22:34:41 -04:00
Qiang Zhao
d4928e8419 net: shell: Add Qbv shell
Added Qbv shell subcommand to net command.
Supported enable, set_config, set_time and get_info functions.

Signed-off-by: Qiang Zhao <qiang.zhao@nxp.com>
2025-10-16 22:34:41 -04:00
Qiang Zhao
16d6c46a0f net: ethernet: add NET_QBV Kconfig
Add NET_QBV in Kconfig, Qbv is Enhancements for Scheduled Traffic (EST),
one feature of TSN. The PTP clock provides the time reference for Qbv

Signed-off-by: Qiang Zhao <qiang.zhao@nxp.com>
2025-10-16 22:34:41 -04:00
Qiang Zhao
a12c664b53 net: dsa: add set/get_config support
Supported set/get_config API.

Signed-off-by: Qiang Zhao <qiang.zhao@nxp.com>
2025-10-16 22:34:41 -04:00
Dan Kalowsky
27afe41b10 debug: thread_analyzer: add thread analyzer option to reset frame
Use THREAD_ANALYZER_LONG_FRAME_PER_INTERVAL config to reset
longest frame value to zero after printing so that longest frame
now represents longest frame for the most recent interval.  The
longest overall frame is often at startup and this modification
allows one to observe subsequent long frames.

Signed-off-by: Jay Lawlor <jlawlor@amperecomputing.com>
Signed-off-by: Dan Kalowsky <dkalowsky@amperecomputing.com>
2025-10-16 22:33:22 -04:00
Tomasz Chyrowicz
3ae8a43667 storage: Allow to use subpartitions in flash_map
Allow to use both partition and subpartition names when suing the
flash_map API.
That way it is possible to introduce a hierarchy within DTS in a
backward compatible way.

Signed-off-by: Tomasz Chyrowicz <tomasz.chyrowicz@nordicsemi.no>
2025-10-16 15:06:12 -04:00
Tim Pambor
99fd6d4f4e ztest: Add validation of zassert strings
Add __printf_like attribute to ztest assertion functions
zassert, zassume, zexpect to validate format strings and arguments
at compile time.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2025-10-16 15:05:07 -04:00
Mark Wang
a713aedb53 bluetooth: a2dp: check the reject response's error code
If the reject response's error codes is success, change as FORMAT ERROR.

Signed-off-by: Mark Wang <yichang.wang@nxp.com>
2025-10-16 17:16:53 +03:00
Mark Wang
60c7ec6915 bluetooth: a2dp: set req->status as 0
create internal bt_a2dp_init_req and bt_a2dp_init_ctrl_req to init `req`,
then the `req->status` will not be forgotten to be cleared as 0.

Signed-off-by: Mark Wang <yichang.wang@nxp.com>
2025-10-16 17:16:53 +03:00
Mark Wang
c994c9e02e bluetooth: a2dp set right endpoint state for start and abort cmd
If the start cmd fail, need set back as OPEN state.

Signed-off-by: Mark Wang <yichang.wang@nxp.com>
2025-10-16 17:16:53 +03:00
Lyle Zhu
40bba4057f Bluetooth: Classic: HFP_HF: Fix AT+CLCC can not be sent issue
Due to the flag `BT_HFP_HF_FLAG_CLCC_PENDING` is set when receiving
the +CIEV or +CIND notification, the command `AT+CLCC` will be
pending due to the flag is not cleared.

Add a flag `BT_HFP_HF_FLAG_INITIATING` to indicate the HF
initialization is ongoing.

Add a flag `BT_HFP_HF_FLAG_QUERY_CALLS` to indicate the current calls
list needs to be queried.

Set the flag `BT_HFP_HF_FLAG_INITIATING` at the beginning of the HF
initialization. Set the flag `BT_HFP_HF_FLAG_QUERY_CALLS` instead of
setting the flag `BT_HFP_HF_FLAG_CLCC_PENDING` if the current calls
list needs to be queried and the flag `BT_HFP_HF_FLAG_INITIATING` is
set.

After the HF initialization is done, query list of the current calls
by calling the function `hf_query_current_calls()` if the flag
`BT_HFP_HF_FLAG_QUERY_CALLS` is set.

Set the flag `BT_HFP_HF_FLAG_CLCC_PENDING` if it is not set in the
function `hf_query_current_calls()`.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-10-16 17:15:51 +03:00
Krzysztof Chruściński
3595c9d0d4 tests: pm: policy_api: Add test for locking all PM states
Add test case that validates behavior of pm_policy_state_all_lock_get
and pm_policy_state_all_lock_put.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2025-10-16 17:15:20 +03:00
Krzysztof Chruściński
336e89efd6 pm: policy: Add option to lock all power states
Add function for getting and putting a lock for all power states.
It is much faster version of requesting 0 us latency with actual
intention to disable all power states.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2025-10-16 17:15:20 +03:00
Jordan Yates
9f1e166abd modem: modem_ppp: optimise frame wrapping
Optimise the PPP frame wrapping process by performing all work inside a
single function into a contiguous buffer, instead of operating on the
ring buffer one byte at a time.

On a nRF54L15 (M33 @ 128 MHz) before the change:
```
Wrapping 1062 byte packet: ~4.1 ms
Wrapping 1355 byte packet: ~5.0 ms
```
After the change:
```
Wrapping 1026 byte packet: ~2.4 ms
Wrapping 1341 byte packet: ~3.1 ms
```

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-10-16 17:15:08 +03:00
Emil Gydesen
572d4d438b Bluetooth: BAP: BA: Improve some logging
Fix additional space in active receive states.
Add additional information when logging duplicate
broadcasts.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-10-16 17:14:20 +03:00
Emil Gydesen
cb9c64947f Bluetooth: CAP: Add missing failed_conn for reception_start
When cap_commander_broadcast_reception_start is called during the
handover, the failed_conn was not correctly.
It is now being set by cap_commander_broadcast_reception_start
and if that is called via handover, it will be correctly set.
If it is called via bt_cap_commander_broadcast_reception_start
then it will be cleared in case of error.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-10-16 17:14:08 +03:00
Cristian Bulacu
a2b554c699 net: l2: openthread: Improve Border Router packet forwarding logic
There are some cases when OpenThread opens a sockets and doesn't choose
as default it's internal interface, this leading to usage of
platform UDP module which will then send back the packet to the
OpenThread interface. In this case, the packet should not be treated as
originated from backbone interface.

Backbone router multicast listener callback functionality is improved.
A route with a prefix length of 128 is set
and a multicast address is added for each listener registration.
OpenThread interface joins that multicast address group.

Enabled forwarding capabilities for Backbone interface.
A border router should be able to perform default packet forwarding for
destination addresses with a multicast scope greater than admin-local.
In order to achieve this, multicast routes have been added to those
addreses. [https://datatracker.ietf.org/doc/rfc7346/]

For Border Router application, `ip6_addr_cb` is not installed.
otIp6SubscribeMulticastAddress call would re-register an IPV6 multicast
address which might have been registered by an OpenThread node using
`ipmadd add` command and even if that node performed `ipmaddr del`,
the address was still present in multicast listener table. This also
led to a missing MLDv2 message with that specific multicast IPV6
address.

Signed-off-by: Cristian Bulacu <cristian.bulacu@nxp.com>
2025-10-16 17:10:51 +03:00
Julien Vermillard
9ee47f2856 net: lwm2m: add cache filtering
Introduce `lwm2m_set_cache_filter()` so applications can drop cached
samples before they reach the LwM2M SEND path.

Fixes #91590

Signed-off-by: Julien Vermillard <julien@clunkymachines.com>
2025-10-16 17:10:24 +03:00
Flavio Ceolin
dabe815663 bt: host/classic: Fix possible integer overflow
Invalid header length and cause an integer overflow in
bt_br_acl_recv leading to undesired behavior.

Signed-off-by: Flavio Ceolin <flavio@hubblenetwork.com>
2025-10-15 11:46:13 -04:00
Ludvig Jordet
f998357015 Bluetooth: Mesh: Minor cleanup of prov link close on success
Changes the link close upon success to use the `prov_link_close` helper
function instead of doing it manually, as minor cleanup.

Signed-off-by: Ludvig Jordet <ludvig.jordet@nordicsemi.no>
2025-10-15 11:43:00 -04:00
Ludvig Jordet
1c6f98aaf2 Bluetooth: Mesh: Provisioner closes link on failed
According to MshPrt 5.4.4, The Provisioner, upon receiving the
Provisioning Failed PDU, shall assume that the provisioning failed and
immediately disconnect the provisioning bearer.

Signed-off-by: Ludvig Jordet <ludvig.jordet@nordicsemi.no>
2025-10-15 11:43:00 -04:00
Jordan Yates
e655c0ed1a net: ip: conn_mgr_connectivity usage calls
Add interface usage notifications to the `NET_NATIVE` code paths.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-10-15 15:39:25 +03:00
Jordan Yates
b92a43d7c0 net: conn_mgr_connectivity: idle timeouts
Implement idle timeouts, primarily in the common connectivity library,
with individual interfaces notifying the library when the interface has
been used.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-10-15 15:39:25 +03:00
Jordan Yates
e3a7bb30bd net: conn_mgr_connectivity: idle timeout parameter
Add an interface idle timeout parameter to the connectivity
binding structure. This will be used to track idle timeouts for
interfaces.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-10-15 15:39:25 +03:00
Jordan Yates
65b616f6d8 net: conn_mgr: connectivity: replace !binding
Replace all `!binding` checks with `binding == NULL` for MISRA
compliance.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-10-15 15:39:25 +03:00
Fabian Otto
8d097554dd logging: backend: add KConfig option for SWO sync packets
Add KConfig LOG_BACKEND_SWO_SYNC_PACKET to allow disabling SWO
synchronization packets. Useful if the SWO is used as a UART replacement
to avoid that the sync packets show up as special characters in a terminal
application.

Signed-off-by: Fabian Otto <fabian.otto@rohde-schwarz.com>
2025-10-15 15:39:01 +03:00
Emil Gydesen
0ebe84cc5a Bluetooth: Host: bt_iso_reset before bt_conn_cleanup_all
Move the call to bt_iso_reset to before bt_conn_cleanup_all.
The reason for this is that bt_conn_cleanup_all will disconnect
all the ACL connections, which will put the CIS in a disconnecting
state, without finalizing them.
This means that if we get a num_completed_packet event between
the call to bt_conn_cleanup_all and before the BT_HCI_OP_RESET
request has been completed, we will trigger an assert in the
hci_num_completed_packets function as the CIS still exists,
but where we would already have cleaned up the pending TX
without telling the controller.

Moving the call to bt_iso_reset means that the CIS will have
been fully terminated at this point, which will prevent
the assert from happening. Since CIS depends on ACLs, this
is also the logical order for resetting them.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-10-15 15:37:21 +03:00
Jamie McCrae
1c756cbef5 mgmt: mcumgr: transport: udp: Increase default stack size to 1KiB
Fixes an issue in a board using ethernet that faults with the
default 512 byte size by doubling the default to 1KiB. The actual
size of the thread depends upon the device and application
configuration so needs to be fine tined for each application
anyhow

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-10-15 15:36:53 +03:00
Michael Zimmermann
f2bed4d6af net: mqtt_sn: Add support for publishing with QOS=-1
This doesn't try to optimize memory usage for QOS=-1 publications, because
it's easier to use existing structs and allocators instead of adding new
ones with less fields.

Signed-off-by: Michael Zimmermann <michael.zimmermann@sevenlab.de>
2025-10-15 15:35:58 +03:00
Michael Zimmermann
be0adf76b5 net: mqtt_sn: add support for short topics
The publish and subscribe APIs allocate topics implicitly, but don't
support allocating predefined or short topics. Additionally, we don't want
to force using short topics in case the passed topic is 2 bytes long, in
case the user doesn't want that (e.g. because the server doesn't support
it).

So instead, we add a new API which works similar to
mqtt_sn_predefine_topic, which allows allocating a short topic before using
any of these APIs.

Signed-off-by: Michael Zimmermann <michael.zimmermann@sevenlab.de>
2025-10-15 15:35:58 +03:00
Michael Zimmermann
e82b8cb150 net: mqtt_sn: never clear predefined and short topics
- These are independent from connections since they are always valid.
- Implicitly created topics(e.g. from publish or subscribe) can't be
  deleted either, so that doesn't make things worse compared to those.

Signed-off-by: Michael Zimmermann <michael.zimmermann@sevenlab.de>
2025-10-15 15:35:58 +03:00
Mark Wang
b3d56349a1 bluetooth: shell: a2dp: use static for functions
add static for functions and variables.

Signed-off-by: Mark Wang <yichang.wang@nxp.com>
(cherry picked from commit 1282bf7b8d814ef7a217c6f0c424aa4b2f34d363)
2025-10-15 12:06:56 +03:00
Mark Wang
a1cbaf77a6 bluetooth: shell: a2dp: remove unused function
remove app_configured

Signed-off-by: Mark Wang <yichang.wang@nxp.com>
(cherry picked from commit c0be42f10341ea4a6ed1df152375335a5f514c92)
2025-10-15 12:06:56 +03:00
Mark Wang
e468dd3371 bluetooth: avdtp: add copyright
add copyright to avdtp.c

Signed-off-by: Mark Wang <yichang.wang@nxp.com>
(cherry picked from commit 8761b2884726ccc33f953e4679a3d9c86b17da84)
2025-10-15 12:06:56 +03:00
Mark Wang
ef1b4463aa bluetooth: a2dp: remove the digital hardcode
use the sizeof of struct or variable; use macro to do the data shift.

Signed-off-by: Mark Wang <yichang.wang@nxp.com>
(cherry picked from commit d6d567355d08cefd1e11d88563fc300928af4972)
2025-10-15 12:06:56 +03:00
Mark Wang
642dc278d1 bluetooth: a2dp: save configuration when cmd success
In the cmd result callback, save the configuration to stream if result is
success.

Signed-off-by: Mark Wang <yichang.wang@nxp.com>
(cherry picked from commit 9a9477fa0214f245a66e24a2edd90132293d5086)
2025-10-15 12:06:56 +03:00
Mark Wang
c8763596c9 bluetooth: avdtp: unify the avdtp error code based on Zephyr err code
get the avdtp error code based on Zephyr err code to make the codes more
clear.

Signed-off-by: Mark Wang <yichang.wang@nxp.com>
(cherry picked from commit 1d4d97fdb41791501eb63934f096bcc88cb2da81)
2025-10-15 12:06:56 +03:00
Mark Wang
1032b1e567 bluetooth: a2dp: avoid clearing the cmd req
If the previous cmd req is triggered, the cmd fail to trigger again and
keep the previous cmd req.

Signed-off-by: Mark Wang <yichang.wang@nxp.com>
(cherry picked from commit f4197d51b62799748a75c97bd0b68778185ff293)
2025-10-15 12:06:56 +03:00
Mark Wang
eb3af0b9a6 bluetooth: a2dp: remove meaningless if
The `a2dp` is got by `req` through CONTAINER_OF, then the if always is
true.

Signed-off-by: Mark Wang <yichang.wang@nxp.com>
(cherry picked from commit 24ef59d835c69a30fe8a8e6569405791532d9e0d)
2025-10-15 12:06:56 +03:00
Mark Wang
d5fb16bd31 bluetooth: a2dp: use avdtp struct to fill data to net buf
avdtp defines the data format by struct, use it to fill net buf.

Signed-off-by: Mark Wang <yichang.wang@nxp.com>
(cherry picked from commit a89f4eddac6f13f981f2ca0b94f07edaad104afa)
2025-10-15 12:06:56 +03:00
Mark Wang
8e6a853654 bluetooth: avdtp: check buf tail room
check the buf tail room before adding data to buf.

Signed-off-by: Mark Wang <yichang.wang@nxp.com>
(cherry picked from commit 65f8a9e03baf899684198e707170ad17817f7ce5)
2025-10-15 12:06:56 +03:00