Commit graph zephyr/subsys
Author SHA1 Message Date
Jonas Spinner
03695daaab fs: shell: align mount commands
Align format strings for FAT fs and littlefs commands.

Signed-off-by: Jonas Spinner <jonas.spinner@burkert.com>
2026-03-10 17:56:46 -07:00
Jonas Spinner
cc6ed8f0e0 fs: shell: fix null pointer access
Add an early check whether FAT fs is already mounted similar to
littlefs mount command. This fixes a null pointer access if the mount
command is used twice.

Fixes #104777

Signed-off-by: Jonas Spinner <jonas.spinner@burkert.com>
2026-03-10 17:56:46 -07:00
Andy Ross
750eb4fcb4 arch/arm: Remove unused Cortex M thread struct elements
When USE_SWITCH=y, the thread struct is now mostly degenerate.  Only
the two words for ICI/IT state tracking are required.  Eliminate all
the extra fields when not needed and save a bunch of SRAM.

Note a handful of spots in coredump/debug that need a location for the
new stack pointer (stored as the switch handle now) are also updated.

Signed-off-by: Andy Ross <andyross@google.com>
2026-03-10 17:24:10 +01:00
Jay Beavers
b2bc53aab8 logging: swo: drain hardware pipeline in panic handler
The SWO backend's panic() handler was a no-op. When LOG_PANIC() is
called (e.g., before a bootloader jumps to an app, or during a fatal
error), the logging subsystem flushes software buffers to the ITM
FIFO, but the TPIU hardware pipeline still has bytes in-flight on
the SWO pin. The debug probe loses these final messages.

Spin on ITM_TCR.BUSY until the formatter is idle, then busy-wait
for the TPIU output stage to clock remaining bytes out at the
configured SWO baud rate.

Signed-off-by: Jay Beavers <jay@tolttechnologies.com>
2026-03-10 15:05:20 +01:00
Jordan Yates
cc53c73263 mgmt: mcumgr: img_mgmt: typo fix
Fix `Faled` -> `Failed`.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2026-03-10 12:39:23 +01:00
Jani Hirsimäki
3eeff9e1ef net: ipv6: check on-link prefix before falling back to default router
When routing packets, check if the destination address matches an
on-link prefix on any interface before using the default router.
This ensures packets destined for on-link prefixes are not
incorrectly sent to the default router.

Signed-off-by: Jani Hirsimäki <jani.hirsimaki@nordicsemi.no>
2026-03-10 12:39:06 +01:00
Yongxu Wang
1a27ec9a18 pm: policy: fix duplicated space in policy
Fix duplicated space in policy_state_lock file

Signed-off-by: Yongxu Wang <yongxu.wang@nxp.com>
2026-03-10 12:37:59 +01:00
Pieter De Gendt
e7fae7a37e net: lib: coap: client: Add multicast support
Allow sending a CoAP GET request to a multicast address and receive
multiple responses.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2026-03-10 09:32:24 +01:00
Pieter De Gendt
fe6c5e25cd net: lib: coap: client: Add const qualifier to helper functions
Make arguments that are not modified in the helper function const.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2026-03-10 09:32:24 +01:00
Tim Pambor
525554266a logging: Fix logging in PRE_KERNEL with thread id prefix
Logging a message in PRE_KERNEL with CONFIG_LOG_THREAD_ID_PREFIX=y
triggers a assert in k_current_get() because the current thread is not
yet available.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2026-03-10 09:30:55 +01:00
Aleksandr Khromykh
9016127872 bluetooth: mesh: fix always resuming from the first block
Resume from cli->block.number instead of block 0,
so BLOCK_START matches the server's current block.
Blob client does not drop server due to this anymore.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2026-03-09 11:17:53 -05:00
Aleksandr Khromykh
e7f25460db bluetooth: mesh: fix resuming blob server before it comes suspended state
Accept WAITING_FOR_CHUNK phase on resume
when server responds SUCCESS
(server's XFER_START idempotency path).

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2026-03-09 11:17:53 -05:00
Tomi Fontanilles
f2615043c4 modules: mbedtls: add Kconfig option for MBEDTLS_X509_CRT_PARSE_C
Add a dedicated Kconfig option for this previously hidden and
automatically enabled Mbed TLS configuration.
Make the relevant key exchange Kconfig options depend on it.
Enable it explicitly where needed.
Fix the condition for defining MBEDTLS_X509_USE_C (based on
mbedtls_config.h).
Check for CONFIG_MBEDTLS_X509_CRT_PARSE_C instead of
MBEDTLS_X509_CRT_PARSE_C now that we have a Kconfig option for it.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2026-03-09 11:13:40 -05:00
Emil Gydesen
957175f267 Bluetooth: TBS: Add bt_tbs_client_get_by_index
Add function to get an instance pointer by index.
This works the same as bt_tbs_client_get_by_ccid except that
it uses the index instead of the CCID.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-03-09 11:11:36 -05:00
Alberto Escolar Piedras
4040759702 fs: fuse: Switch to use v3 of libfuse by default
Support for using v3 of the FUSE library instead of v2 was added in
b86e52bd6f
As time has been passing more distros are removing v2 support, and at
this point probably all include the v3 in their package repos.

So, let's switch the default to v3.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2026-03-09 14:27:00 +01:00
Lu Jia
f36da9cb7d bluetooth: avrcp: Fix AVRCP notification failure
When calling bt_avrcp_ct_register_notification,
it sets ct->ct_notify[event_id].cb = cb.
In process_register_notification_rsp, it clears the callback
by setting ct->ct_notify[event_id].cb = NULL. However, when
the connection is disconnected, the callback
ct->ct_notify[event_id].cb is not set to NULL , causing
subsequent notification registrations to fail immediately with
an error because the callback pointer is still active.
Similarly, this issue also exists in the AVRCP TG.

Signed-off-by: Lu Jia <jialu@xiaomi.com>
2026-03-09 14:08:14 +01:00
Mark Wang
48f0e505b3 bluetooth: classic: avdtp: fix the early callback of stream established
Refactored the Stream End Point (SEP) callback mechanism to use a
unified bt_avdtp_sep_ops structure instead of individual function
pointers. This change consolidates the connected, disconnected, and
media_data_cb callbacks into a single operations structure. The stream
established callback should be called when the stream l2cap is
connected not the open cmd is finished.

Signed-off-by: Mark Wang <yichang.wang@nxp.com>
2026-03-09 14:04:20 +01:00
Joakim Andersson
8ff525c41e logging: Do not add newline when flushing buffer
Do not add a newline when flushing the buffer to the host terminal.
The caller may not want these newlines to be added, and the host
terminal can handle line wrapping on its own.

Signed-off-by: Joakim Andersson <joerchan@gmail.com>
2026-03-06 21:39:17 +01:00
Joakim Andersson
4e6fca0e00 logging: Add buffer size configuration for posix console stdout
Add buffer size configuration for posix log backend.
This allows to increase the buffer size for the posix console, which is
needed to avoid message flushed in the middle of ansi escape sequences.

Signed-off-by: Joakim Andersson <joerchan@gmail.com>
2026-03-06 21:39:17 +01:00
James Bennion-Pedley
d0057bd2cc usb: uac2: kconfig override for feedback endpoint size
Adds compile-time option for overriding UAC2 Feedback endpoint to allow
usage with non-class-compliant Windows UAC2 driver.

Signed-off-by: James Bennion-Pedley <James.Bennion-Pedley@thinksmartbox.com>
2026-03-06 15:12:15 +01:00
Adrian Warecki
8184ee18b4 logging: Add missing compiler barrier after k_is_user_context
Remove the k_is_user_context call from the Z_LOG_LEVEL_ALL_CHECK macro.
Add the Z_LOG_LEVEL_ALL_CHECK_BREAK macro, which safely checks whether
logging is performed in user context before checking the dynamic log level
that requires access to kernel structure.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2026-03-06 11:37:00 +00:00
Adrian Warecki
fab9ced9dc logging: sensing: tests: Add missing compiler barriers
Add missing memory barriers after branching on k_is_user_context() to
prevent reordering possible of privileged memory access.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2026-03-06 11:37:00 +00:00
Adrian Warecki
d28b9002f8 logging: sensing: tests: Remove the unnecessary CONFIG_USERSPACE checks
Remove the unnecessary CONFIG_USERSPACE checks around k_is_user_context
calls. This function is inline and already performs the config check
internally.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2026-03-06 11:37:00 +00:00
Kapil Bhatt
6cecb912e7 net: Add WEP security support
Add WEP security support in Wi-Fi mgmt ops.
Need to enable Kconfig CONFIG_WIFI_NM_WPA_SUPPLICANT_WEP.

Signed-off-by: Kapil Bhatt <kapil.bhatt@nordicsemi.no>
2026-03-06 11:36:24 +00:00
Zhaoxiang Jin
224f5f74c4 pm: device: Refine device driver initialization
Only set state to ACTIVE after RESUME succeeds, if it fails,
keep SUSPENDED STATE and attach an error code.

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2026-03-06 11:36:10 +00:00
Fin Maaß
2f78a9df1c fs: shell: improve cmd_cp()
improve cmd_cp() by combining 2 error messages and
replacing gotos.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-03-06 11:35:40 +00:00
Pieter De Gendt
16aded5d1f net: lib: sockets: tls: Use struct net_sockaddr_storage for stack variables
Replace instances of struct net_sockaddr with struct net_sockaddr_storage
for stack variables.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2026-03-06 11:34:00 +00:00
Pieter De Gendt
74732cd6fc net: lib: sockets: tls: Use struct net_sockaddr_storage for caches
Storing a socket address should be done with the designated struct
net_sockaddr_storage type instead of the opaque struct net_sockaddr.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2026-03-06 11:34:00 +00:00
Pieter De Gendt
bcc4c0bb1e net: lib: sockets: tls: Validate addrlen before memcpy
Prevent writing data that is larger than the destination struct's size.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2026-03-06 11:34:00 +00:00
Alberto Escolar Piedras
7b49dfd343 subsys/fs/fuse: Avoid using libC defined types in interface
Let's avoid using off_t in the interface between the embedded and the
host side of the FUSE driver.
off_t is a C library defined type and as such can have a different sizes
between the host C library and the embedded C library.

While at it, let's do also the same with size_t. Even though size_t is
meant to be defined in stddef.h which is provided by the compiler, it is
possible to override it in the embedded side.

We just replace them with a 64 bit type for each (signed and unsigned
respectively matching the signedness of off_t and size_t).

There was a bug in the queue type which had the read/write second
parameter as off_t while it should have been size_t, which is now fixed
to be uint64_t.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2026-03-06 10:08:41 +01:00
Pieter De Gendt
af4749d0a0 net: lib: coap_client: Store destination address in request
A CoAP client should not be limited to a single destination address for all
requests.
Store the destination address for each request or use the existing socket
directly.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2026-03-06 10:07:35 +01:00
Pieter De Gendt
a69f9e2fb9 net: lib: shell: ping: Validate identifer/sequence on response
Check if the ping reply is a response to our ping request.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2026-03-06 10:06:42 +01:00
Pieter De Gendt
50578b8aa8 net: ip: icmp: Change net_icmp_handler_t return type to enum net_verdict
Update the return type of the ICMP callback handler to enum net_verdict.
This fixes an issue where currently all ICMP handler are passed the same
pkt. Handlers could have modified the passed packet resulting in undefined
behavior.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2026-03-06 10:06:42 +01:00
Andre Heinemans
52c4fbb931 fs: shell: add mv command
Files can be moved or renamed by this 'mv' command

Signed-off-by: Andre Heinemans <andre.heinemans@nxp.com>
2026-03-06 10:05:20 +01:00
Stine Åkredalen
5dfc1b82a4 bluetooth: mesh: Fix bearer suspend/resume state
bt_mesh_suspend/resume now only re-enable provisioning bearers that
were previously active.

Adds internal bt_mesh_provisionee_suspend/resume APIs.

bt_mesh_suspend() now return -EBUSY if provisioning is active before any
suspend actions are performed.

Signed-off-by: Stine Åkredalen <stine.akredalen@nordicsemi.no>
2026-03-06 09:55:02 +01:00
Jukka Rissanen
6561cd064e net: http: Allow user to turn off HTTP/1 or HTTP/2 in server
If user does not need HTTP/1 or HTTP/2, then it is possible
to turn off support for them.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2026-03-05 16:10:26 +01:00
Emil Gydesen
c97c0366e3 Bluetooth: CAP: Handover: Fix clearing wrong broadcast_source
When proc_param->is_unicast_to_broadcast == false we should clear
the broadcast_to_unicast.broadcast_source instead of the
unicast_to_broadcast.broadcast_source.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-03-05 16:09:04 +01:00
Vedant Malkar
86ff87ff81 Bluetooth: ISO: remove required_sec_level
Remove the required_sec_level for struct bt_iso_chan and
all related automatic security machinery built around it
(iso_chan_connect_security, bt_iso_security_changed,
BT_ISO_STATE_ENCRYPT_PENDING and the CONFIG_BT_SMP checks
in iso.c)

Applications can just call bt_conn_set_security() on the
ACL connection before bt_iso_chan_connect() instead.

Fixes #104751

Signed-off-by: Vedant Malkar <vedantitsme@gmail.com>
2026-03-05 11:15:32 +00:00
Zhaoxiang Jin
de97ddb0e8 pm: device: Refactor power domain add/remove logic
It turns out that power_domain_add_or_remove() when add==true only
looks for DEVICE_HANDLE_NULL empty slots to write to, and never checks
"whether this dev_handle is already in the supported handles or not".
The result is: repeated adds may insert duplicate entries; or when
there are no empty slots, even though it's "already in the domain",
it returns -ENOSPC (which conflicts with the documented semantics).

This commit adds a check: when add==true and rv[i] == dev_handle is
found, it returns -EALREADY and avoids duplicate insertion.

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2026-03-05 10:02:30 +01:00
Robert Lubos
a909dc8296 net: ipv6: mld: Return 0 if address was already joined
In case address was already joined, return 0 instead of an error code to
avoid confusion.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2026-03-04 16:43:42 +00:00
Robert Lubos
f84eeb9deb net: ipv4: igmp: Return 0 if address was already joined
In case address was already joined, return 0 instead of an error code to
avoid confusion.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2026-03-04 16:43:42 +00:00
Robert Lubos
c8644d6899 net: iface: Join multicast IPv6 addresses only once on iface up
Make sure autoconfigured multicast IPv6 addresses are added (and thus
referenced) only once when the interface goes up to avoid mounting refs
for a given address.

Even if address is already present and net_ipv6_mld_join() is skipped
for a given address it's not an issue as all unjoined addresses have
their reports sent on interface going up via net_ipv6_mld_rejoin().

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2026-03-04 16:43:42 +00:00
Robert Lubos
79e0a01ab1 net: iface: Clear is_joined flag when allocating mcast address
When allocating new multicast address, clear the is_joined flag as it
could've still be set from the previous allocation.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2026-03-04 16:43:42 +00:00
Robert Lubos
e62a77ddf3 net: shell: ipv4: Print also multicast address details
For each interface, print also details about registered multicast
addresses.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2026-03-04 16:43:42 +00:00
Robert Lubos
4ea96483b4 net: shell: ipv6: Print also multicast address details
For each interface, print also details about registered multicast
addresses.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2026-03-04 16:43:42 +00:00
Robert Lubos
6ec8a43045 net: iface: Don't re-register mcast addresses on iface up
We just need to resend the report, not add the address again.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2026-03-04 16:43:42 +00:00
Robert Lubos
cb4a2eb534 net: ipv6: mld: Add helper function to rejoin mcast groups
Add helper function that allows to rejoin multicast groups without
registering an address. This is needed in case we just want to send
report w/o increasing the ref count of the multicast address (when
interface goes up for example).

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2026-03-04 16:43:42 +00:00
Robert Lubos
a9f78d65b1 net: ipv4: igmp: Add helper function to rejoin mcast groups
Add helper function that allows to rejoin multicast groups without
registering an address. This is needed in case we just want to send
report w/o increasing the ref count of the multicast address (when
interface goes up for example).

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2026-03-04 16:43:42 +00:00
Robert Lubos
4e2abc0118 net: ipv6: mld: Remove redundant inteface state check
Network interface state is now checked down the line in
net_try_send_data() so a separate check in the MLD code was redudant,
hence remove it to simplify the code.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2026-03-04 16:43:42 +00:00
Robert Lubos
2f17aaa5c7 net: ipv6: mld: Make use of mcast address ref counting
Don't send MLD report on join if the address was already joined,
only increase the ref count by calling net_if_ipv6_maddr_add().

On leave, only send report if the address was removed from the system
(i.e. is no longer in use).

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2026-03-04 16:43:42 +00:00