Commit graph

22,409 commits

Author SHA1 Message Date
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
Emil Gydesen
4b9bc7d11b Bluetooth: Controller: Fix return types for ll_length
ll_length_req_send and ll_length_default_set were defined to return
a uint32_t, but only returned a uint8_t HCI error code and
was the return value was always stored as such.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-10-08 08:45:37 +02:00
Måns Ansgariusson
98917a022b tracing: Remove retired k_pipe tracing api
The old k_pipe api was retired in #95408, the tracing hooks should be
removed as well.

Signed-off-by: Måns Ansgariusson <Mansgariusson@gmail.com>
2025-10-08 08:44:11 +02:00
Titouan Christophe
3c50822e1d samples: net: midi2: new sample
Add a new sample to demonstrate usage of the newly introduced
Network MIDI 2.0 host stack.

Signed-off-by: Titouan Christophe <titouan.christophe@mind.be>
2025-10-08 08:42:27 +02:00
Titouan Christophe
b0fa1be5b0 net: lib: midi2: new Network MIDI 2.0 host stack
Add a new network protocol for MIDI2.0 over the network, using UDP sockets.
This allows Zephyr to host a UMP endpoint on the network, which can be
invited by UMP clients to exchange MIDI2.0 data.

Signed-off-by: Titouan Christophe <titouan.christophe@mind.be>
2025-10-08 08:42:27 +02:00
Titouan Christophe
5d71669c70 usb: device_next: usbd_midi: mark UMP group as 31.25kb/s from devicetree
Since a new device-tree property has been introduced to describe if a
UMP group is limited to 31.25kb/s (like a physical MIDI DIN-5 port),
this can be used in the USB UMP group terminal block descriptors, as
specified in the USB-MIDI2.0 reference document [1], (in 5.4.2.1
Group Terminal Block Descriptor):

  Maximum Output Bandwidth Capability in 4KB/second. 0x0000 – 0xFFFF.
  Bandwidth is total for this Block, shared among all OUT Group Terminals.
      0x0000 = Unknown or Not Fixed.
      0x0001 = Rounded version of 31.25kb/s

[1] https://www.usb.org/sites/default/files/USB%20MIDI%20v2_0.pdf

Signed-off-by: Titouan Christophe <titouan.christophe@mind.be>
2025-10-08 08:42:27 +02:00
Dominik Ermel
f5e70d56be fs: ext2: Explicit int cast ret assignment in ext2_init_storage
Adds cast to int when ret is assigned error code returned by
functions that return int64_t. The cast has been added to indicate
that assignment with truncation is here intentional.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2025-10-08 08:42:18 +02:00
Anas Nashif
bf82f7ffac copyrights: fix copyright line
Add space before (c) to allow correct parsing by linters.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-10-07 22:53:45 -04:00
Emil Gydesen
2140b55d29 Bluetooth: BAP: Shell: 0-init some global variables
0-init some non-static global variables to avoid
issues with uninitialized values. Also modify
the printing of the broadcast sources found slightly.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-10-07 17:44:19 +03:00
Dawid Niedzwiecki
58a7119d28 mgmt: ec_host_cmd: usb: fix double free
Fix double free of a net buffer after request error.

Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
2025-10-07 17:43:59 +03:00
Jordan Yates
83375a8f86 modem: chat: add modem_chat_is_running
Add a helper function to query if the chat instance is currently running
a script.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-10-07 14:06:37 +02:00
Jamie McCrae
b2884ffb20 mgmt: mcumgr: grp: os_mgmt: Use board target for hardware platform
Uses the full hwmv2 board target for the hardware platform output,
seemingly this was missed in the hwmv2 migration and it was using
the board name only. Adds a deprecated Kconfig to restore to the
previous behaviour

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-10-07 14:06:06 +02:00
Emil Gydesen
35909d7fdf Bluetooth: CAP: Mark err used for assert as __maybe_unused
If asserts are disabled, then `err` is unused can caused
a compiler warning.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-10-07 12:47:30 +02:00
Pieter De Gendt
6a4b5cd3d3 net: lib: coap: Add packet pointer to client response callback data
Pass a pointer to the CoAP packet in the response data. This allows
callback function to inspect for CoAP options.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-10-07 11:00:50 +02:00
Pieter De Gendt
cbef8679f4 net: lib: coap: Convert client response callback arguments to struct
Make it easier to modify the response callback data by passing it as a
struct pointer rather than a long list of arguments.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-10-07 11:00:50 +02:00
Jordan Yates
1f3ce818fc bluetooth: controller: ll_sw: nordic: constant latency req
When `CONFIG_NRF_SYS_EVENT` is enabled, route constant latency requests
through the reference counted API.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-10-07 10:59:38 +02:00
Charles Hardin
2bfd76425a net: ip: account for the size in the inet_ntop code path
The code was writing to the dst without a verification check on
size which is not appropriate. The guard on the arguements should
be enforced and so just ensure the size is larger then the
definition of the strings from POSIX and return an error in those
cases.

Signed-off-by: Charles Hardin <ckhardin@gmail.com>
2025-10-07 10:59:08 +02:00
Charles Hardin
a8aa8af946 net: dns: fix the inet_ntop buffer size mismatch with a sizeof
From the manpage for inet_ntop

  This function converts the network address structure src in the af
  address family into a character string.  The resulting string is
  copied to the buffer pointed to by dst, which must be a non-null
  pointer.  The caller specifies the number of bytes available in
  this buffer in the argument size.

In an unintended misconfiguration the resolve max string ended up
being 20 and tracking thru some wierd code issues determined some
stack corruption which came back to the shell command. So, just
fix the size argument to be the sizeof which then leads to the next
problem that the size is being ignored by inet_ntop.

Signed-off-by: Charles Hardin <ckhardin@gmail.com>
2025-10-07 10:59:08 +02:00
Emil Gydesen
6c870b071a Bluetooth: Remove CONFIG_BT_BUF_ACL_RX_COUNT
Remove the deprecated CONFIG_BT_BUF_ACL_RX_COUNT config
as it has been deprecated since 4.1

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-10-06 20:17:14 -04:00
Pieter De Gendt
05a605021a nvmem: Introduce new subsystem for Non-Volatile Memory layer
This commit adds the NVMEM subsystem with a basic implementation for use
with EEPROM devices.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-10-06 15:09:30 -04:00
Jordan Yates
761961fa28 modem: optional dedicated workqueue
Add the option to use a dedicated workqueue for the modem backend
instead of the system workqueue.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-10-06 20:01:41 +03:00
Emil Gydesen
360880b7c7 Bluetooth: Host: Remove bt_le_set_auto_conn
Remove the deprecated function bt_le_set_auto_conn
as it has been deprecated since 4.1.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-10-06 20:01:04 +03:00
Alberto Escolar Piedras
1264a923f3 net: mqtt_sn: udp: Adapt to new zsock_recvfrom() api.
zsock_recvfrom() takes as last argument a socklen_t pointer
( c546c1cad1 )
whose definition has changed.
So let's ensure we pass the right type of pointer to it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-10-06 20:00:20 +03:00
Alberto Escolar Piedras
37ff1b254f tracing: ctf: Fix arguments socket tracing functions
Zephyr's socklen_t was changed in
c546c1cad1
to be uint32_t instea of size_t.
Let's fix accordingly the prototypes which expect it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-10-06 20:00:20 +03:00
Alberto Escolar Piedras
d4094d431c net: dns: dispatcher: Fix type of pointer
zsock_recvfrom() takes as last argument a socklen_t pointer
which type was changed in
c546c1cad1
as is not anymore equivalent to size_t.
So let's ensure we pass the right type of pointer to it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-10-06 20:00:20 +03:00
Jukka Rissanen
c546c1cad1 net: socket: Change socklen_t to be 4 bytes long
There is an issue when zephyr is compiled with native_sim_64 where
size_t is 8 bytes. The socklen_t in specified as 4 bytes in Linux
even for 64 bit builds so we have a conflict between Linux and Zephyr.
To make things work properly, define socklen_t as uint32_t in order to
align with Linux. Four bytes is enough for socket address length anyway.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-10-06 09:38:01 +02:00
Jordan Yates
f047a412e0 modem: cmux: auto calculate work buffer sizes
Automatically size the CMUX work buffers based on
`CONFIG_MODEM_CMUX_MTU`. This eliminates a Kconfig variable that would
otherwise need to manually be kept in sync. The option to extend the
size of these buffers is still provided through
`CONFIG_MODEM_CMUX_WORK_BUFFER_SIZE_EXTRA`.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-10-06 09:37:26 +02:00
Shawn Huang
f7412dc0df logging: allow simplified logging of backend
This allows no timestamps and level prefixes in backend log output.

Signed-off-by: Shawn Huang <shawn.huang724@realtek.com>
2025-10-06 09:36:23 +02:00
Pieter De Gendt
6693923734 net: wifi: mgmt: Remove extraneous newlines from logs
Some log statements appended unnecessary newlines, remove those.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-10-05 20:02:08 -04:00
Pieter De Gendt
ce45f4ca53 net: lib: wifi: mgmt: Fix memory leaks
When connecting to WiFi from stored credentials, the key_passwd is never
freed.
Additionally if the connect fails, the allocated data was never freed.

Convert heap allocated memory to stack allocated buffers.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-10-05 20:02:08 -04:00
Gustavo Romero
139407f818 instrumentation: Add instrumentation subsystem
This commit adds the instrumentation subsystem.

Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
Signed-off-by: Kevin Townsend <kevin.townsend@linaro.org>
Signed-off-by: Maciej Sobkowski <msobkowski@antmicro.com>
2025-10-05 06:18:25 -04:00
Jordan Yates
d185f8edd0 testsuite: optional limiting of coverage dumps
Add an option that excludes generation of a given path of `.gcda` files
when running coverage testing. This can be useful when running testing
coverage on downstream repos, which would otherwise result in large
`.gcda` files for paths we don't care about filling up the disk.

One example of using this is to exclude coverage outputs from
mbedtls files with the following:
`CONFIG_COVERAGE_DUMP_PATH_EXCLUDE="*modules/crypto/mbedtls*"`

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-10-05 06:18:05 -04:00
Daniel Leung
4ef1163e39 samples: tracing: fix missing k_event funcs for UART test
With the UART transport test (sample.tracing.transport.uart),
it would fail on qemu_x86_64 complaining about missing
k_event tracing functions. So add them to fix the compilation
error.

Fixes #96818

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2025-10-03 21:19:57 -04:00
Fabio Baltieri
37717b229f sys: util: rename Z_MIN Z_MAX Z_CLAMP to min max and clamp
Rename these three macros to an unprefixed lower-case variant. This is
normally not done for Zephyr macros (see container_of) but in this case
it seems like a good idea to adopt the lowercase names to:

1. have the same convention as the equivalent Linux macros, helping devs
   working cross project recognizing (mis)use patterns.
2. make it somewhat intuitive that the lowercase ones are meant to be
   used in functions while the uppercase ones are to be used for static
   evaluation.

Add few c++ guards to avoid colliding with std::min and std::max.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2025-10-03 21:14:11 -04:00
Fin Maaß
e88be20d52 sd: sdmmc: only with to 4 bit, if supported by host
only switch to 4 bit mode, if it is supported
by the host. for MMC it is already checked,
but not for the sd card.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-10-03 20:59:01 -04:00
Martin Koehler
cd2a38cc2e logging: Fixes #96880
Now only deletes old log files if more data is needed than is available.

Signed-off-by: Martin Koehler <koehler@metratec.com>
2025-10-03 20:58:34 -04:00
Emil Gydesen
5d8170bba8 Bluetooth: BAP: Add conn check assert in bt_bap_iso_bind_ep
Adds assert for bt_bap_iso_bind_ep to ensure that endpoints
from different connection don't share a CIS (a bt_bap_iso).

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-10-03 12:51:45 +03:00
Emil Gydesen
1dc98dd932 Bluetooth: BAP: Add check to verify that eps have correct iso
Add a check that verifies that 2 endpoints from different
connection don't share a CIS, which would be invalid.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-10-03 12:51:45 +03:00
Emil Gydesen
4f2ef519b6 Bluetooth: BAP: UC: Move iso_bind_ep to config instead of QoS
We can actually already when we bind the endpoint to the stream
perform the call to bt_bap_iso_bind_ep, if the stream has been
added to a group.

If the stream has not yet been added to a group, then when
the stream is added to a group, then bt_bap_iso_bind_ep will
be done there (existing behavior).

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-10-03 12:51:45 +03:00
Benjamin Cabé
febf4e8e53 shell: fix app version sub commands
commands should not have spaces around hyphens:
version - extended --> version-extended
build - version --> build-version

Fixes: zephyrproject-rtos/zephyr#96591

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-10-02 22:00:11 +02:00
Alberto Escolar Piedras
896bdce53a subsys/tracing/tracing_backend_posix: Set file to be closed on exec
If the process does an exec() (or fork, or..) all descriptors are kept
open by default, unless O_CLOEXEC is set when opening them.
This is usefull for stdin/out/err so that new process is connected to
them, but it is very rare for it to be usefull for any other descriptor.

In general this leads to descriptors being kept open unnecessarily,
which either will block other process from getting them (for example
if the child survives the parent but it does something else).
Or for a "leak" which unnecessarily uses descriptors and memory in the
child process.

Let's ensure we do not leak it for this component as we do not need it.

Note glibc fopen supports the "e" modifier as an extension to pass
O_CLOEXEC to the open syscall.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-10-02 22:00:02 +02:00
Jakub Michalski
a0dbd67262 fs: virtiofs: fix off-by-one in virtqueue initialization
REQUEST_QUEUE was passed as queue_num to virtio_init_virtqueues
where REQUEST_QUEUE+1 was required

Signed-off-by: Jakub Michalski <jmichalski@antmicro.com>
2025-10-02 21:59:01 +02:00
Andreas Schweigstill
78b8950fd1 net: http_server: Fix crash when cb refuses new websocket connection
Zephyr crashes when a new websocket connection is refused by the
user supplied callback function. This is caused by multiple calls
of close_client_connection(). After the first call the file handle
and the client->service pointer are invalid.

This fix checks if the file handle is valid.

Signed-off-by: Andreas Schweigstill <andreas@schweigstill.de>
2025-10-02 21:58:28 +02:00
Yangbo Lu
9304035610 net: bridge: support DSA port
DSA switch performs L2 switching on hardware on DSA user ports.
The promisc mode requirement doesn't apply to DSA user ports.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2025-10-02 21:57:32 +02:00
Anouar Raddaoui
b27ab80d20 modbus: support UART ASYNC API in modbus serial
Reason for this extension are CRC mismatches happening due to RX data
loss when using the interrupt driven API at higher speeds and/or high
CPU load. It is recommended to use the ASYNC API along with hardware
byte counting requiring a timer instance and one PPI channel to achieve
a robust communication at high baudrates on nRF platforms.

Signed-off-by: Anouar Raddaoui <a.raddaoui@smight.com>
2025-10-02 21:56:37 +02:00
Tim Pambor
9041793ccb Revert "ztest: Add validation of zassert strings"
This reverts commit ef73155f96.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2025-10-02 15:14:45 +03:00
Tim Pambor
ef73155f96 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-02 11:47:01 +03:00