Commit graph

24,075 commits

Author SHA1 Message Date
Tomasz Leman
966737f137 logging: Add CONFIG_LOG_RUNTIME_DEFAULT_LEVEL for startup filter control
Add a new Kconfig option CONFIG_LOG_RUNTIME_DEFAULT_LEVEL that allows
setting the initial runtime filter level at system startup, independent
of compile-time log levels.

This enables a common use case where firmware needs to:
1. Compile with DEBUG level (to include all log macros)
2. Boot with minimal logging (e.g., ERROR only for quiet startup)
3. Allow dynamic runtime increases via IPC or other mechanisms

Previously, autostart backends were always initialized with
CONFIG_LOG_MAX_LEVEL, which meant compile-time and initial runtime
levels were coupled. This change decouples them when runtime filtering
is enabled.

Changes:
- Add CONFIG_LOG_RUNTIME_DEFAULT_LEVEL Kconfig option under
  LOG_RUNTIME_FILTERING, defaulting to LOG_DEFAULT_LEVEL
- Update z_log_runtime_filters_init() to use the new config for initial
  aggregated filter levels
- Update autostart backend initialization in z_log_init() and
  activate_foreach_backend() to use CONFIG_LOG_RUNTIME_DEFAULT_LEVEL
  instead of CONFIG_LOG_MAX_LEVEL when runtime filtering is enabled

This allows firmware to start with ERROR-level logging while keeping
full DEBUG compile-time capability, then dynamically increase verbosity
as needed without recompilation.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2026-02-19 12:52:28 +01:00
Emil Gydesen
f4492d04e0 Bluetooth: CAP: Add missing NULL checks in acceptor_register
Add missing NULL check for `param` and `svc_inst`

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-02-19 12:51:41 +01:00
Sergey Terentiev
f2910d8663 canbus: isotp: fix race conditions
Unsigned variable overflow fixes

Signed-off-by: Sergey Terentiev <sergey@terentiev.me>
2026-02-19 09:26:06 +01:00
Jukka Rissanen
d060673658 net: wifi: shell: Convert the code to use SHELL_HELP macro
This will save flash memory by 1489 bytes and make usage help look
uniform in different commands.

Re-order the shell commands to alphabetical order. This has been
done before but has bitrotted over time.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2026-02-18 10:31:49 +00:00
Josuah Demangeon
6c1d24cde1 usb: device_next: uvc: fix frame/formats descriptors
The standard format "frame-based payload" was abused as a way to get
generic descriptors that match all other format and frame types.
This is not accurate as some fields do not match, causing misalignment
of some struct fields in some case.

Correct the misuse by introducing new valid structs and refactoring the
descriptor parsing to use them instead.

Signed-off-by: Josuah Demangeon <me@josuah.net>
2026-02-18 10:30:44 +00:00
Josuah Demangeon
4360894965 usb: host: class: support multiple controllers
Only bind to a controller after probing. Wait that a class is matching and
assigned to a device to assign a host controller to a class. This allows
a class to be used by any of the controller in place.
Remove the `c_data->uhs_ctx` field, not used anywhere, in favor of using
`c_data->udev->ctx`.

Signed-off-by: Josuah Demangeon <me@josuah.net>
2026-02-18 10:29:27 +00:00
Jukka Rissanen
0179cce4cd net: shell: Convert the code to use SHELL_HELP macro
This will save flash memory by 646 bytes and make usage help look
uniform in different commands.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2026-02-17 17:40:49 -06:00
Jukka Rissanen
66812f66a7 net: ipv6: Do packet length checks before starting fragment reassembly
Make sure to check packet length check before starting the
IPv6 fragmentation reassembly process. This way we can drop the
malformed packet without consuming resources.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2026-02-17 13:21:17 -06:00
Jani Hirsimäki
757b576b65 net: ppp: always set FSM name in ppp_fsm_name_set
Previously the name was only set when CONFIG_NET_L2_PPP_LOG_LEVEL >=
LOG_LEVEL_DBG. NET_ERR/NET_WRN in ipv6cp (and others) use fsm->name
as %s at any log level, which could pass NULL into the logger and
crash in cbprintf/strlen. Always assign the name so logging is safe.

Signed-off-by: Jani Hirsimäki <jani.hirsimaki@nordicsemi.no>
2026-02-17 10:33:02 +01:00
Emil Gydesen
309b5b3c01 Bluetooth: CAP: Add ep conn check in unicast audio start
Add check in valid_unicast_audio_start_param to verify
that the ep connection matches the member_conn.

Instead of declaring the endpoints in the unit tests, we
not define them in the mock unicast client and use the
discover function to get pointers.

This allows for a proper implementation of
bt_bap_unicast_client_has_ep as well as makes the tests more similar
to a normal application.

This change required a significant change in the unicast_stop
unit tests as well, which uncovered a small bug in the implementation.
The bug was fixed as part of this commit.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-02-17 10:31:09 +01:00
Johan Hedberg
dd37a250b1 Bluetooth: Host: Remove leftover k_poll related code
There's no use of k_poll in the host stack anymore, so remove leftovers
and related definitions.

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2026-02-16 09:03:09 -06:00
Johan Hedberg
39a428c5d9 Bluetooth: Mesh: Add missing select for POLL
The Bluetooth Mesh code depends on k_poll, so it should have the
appropriate select statement in its Kconfig.

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2026-02-16 09:03:09 -06:00
Paul He
a14a5b2d60 llext: remove leading -D from CMakeLists.txt
Any leading -D passed to target_compile_definitions on an item will
be removed, here remove them to make code style consistent.

Signed-off-by: Paul He <pawpawhe@gmail.com>
2026-02-16 09:00:09 -06:00
Lingao Meng
c51a341181 fs: nvs: fix required_space calculation for flash write block alignment
NVS calculates required_space for an entry by summing data size, ATE size
and CRC size. However, the CRC size is assumed to be 4 bytes and the
calculation does not account for the flash write block size.

On flashes with write_block_size greater than 4 bytes (e.g. 8 or 16),
the data + CRC payload must be padded to the write block size. The
current logic underestimates the required space, which may cause writes
to cross sector boundaries and corrupt adjacent entries or ATEs.

Fix this by aligning the data + CRC payload size to the flash write
block size before adding the ATE size to required_space.

This makes NVS space accounting consistent with flash write granularity
and prevents sector overflow on non-4-byte write block devices.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2026-02-16 12:52:00 +01:00
TOKITA Hiroshi
c981669481 fb: cfb: fix HTILED glyph byte indexing
Fix draw_char_htmono() to compute byte offsets with row-based
HTILED addressing and keep g_y controlled by the outer loop.
This avoids row-skips and broken rendering near clipping boundaries.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2026-02-16 12:51:35 +01:00
TOKITA Hiroshi
2374ef62f9 fb: cfb: fix inversion condition in finalize
Fix cfb_framebuffer_finalize() to invert the software framebuffer
only when pixel format polarity and cfb inversion state differ.
This restores the expected behavior for MONO01/MONO10 finalize output.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2026-02-16 12:51:35 +01:00
TOKITA Hiroshi
38d58b7e30 fb: cfb: add HTILED support to cfb_invert_area
Handle both VTILED and HTILED framebuffer layouts in cfb_invert_area().
Also update the basic cfb test helper to read pixels correctly for
HTILED buffers.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2026-02-16 12:51:35 +01:00
Vinayak Kariappa Chettimada
c4a4937d9f Bluetooth: Controller: Update ll_data_path_tx_pdu_release()
Update ll_data_path_tx_pdu_release() to have return -ENOTSUP
so that the node_tx is released using the fallback method to
use the MFIFO from LLL to ULL_HIGH context.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2026-02-16 11:08:16 +01:00
Vinayak Kariappa Chettimada
23005983dd Bluetooth: Controller: ISO Tx ack data flow review rework
Review rework ISO Tx ack data flow design for context-safety.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2026-02-16 11:08:16 +01:00
Vinayak Kariappa Chettimada
a4f4deef44 Bluetooth: Controller: Fix ISO Tx ack data flow for context-safety
Fix ISO Tx ack data flow design for context-safety.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2026-02-16 11:08:16 +01:00
Vinayak Kariappa Chettimada
d66dd5cde8 Bluetooth: Controller: Fix BIS to unify with CIS TX ack handling
Fix BIS to unify with CIS TX ack handling.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2026-02-16 11:08:16 +01:00
Pieter De Gendt
0a63c65787 net: shell: dns: Use same unsupported command pattern
Update DNS shell commands if the DNS resolver isn't disabled to reduce
flash usage.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2026-02-13 09:50:47 -06:00
Pieter De Gendt
3c5760b1e6 net: shell: dns: Add browse command
Add the 'net dns browse <service>' command to resolve multiple hosts of a
certain service type.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2026-02-13 09:50:47 -06:00
Pieter De Gendt
b35a7bc617 net: dns: resolve: Handle DNS_RESPONSE_DATA item in validate
Add an entry to the DNS cache for DNS_RESPONSE_DATA messages, and return
dns_read with DNS_EAI_ALLDONE instead of DNS_EAI_NODATA.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2026-02-13 09:50:47 -06:00
Pieter De Gendt
4251e01754 net: shell: dns: Make DNS info message queue size configurable
In large networks there can be many DNS responses, make the DNS info queue
size configurable to prevent dropping messages

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2026-02-13 09:50:47 -06:00
Seppo Takalo
5fb307a98a modem: backends: uart_async: Prevent closing twice
When modem_pipe_notify_closed() is removed from pipe->close() call,
we rely on the UART callback to notify when the UART is closed.

If we call uart_rx_disable() twice, we might lose the callback,
and the pipe status stays open.

This happens when modem_cellular_run_shutdown_script_event_handler() calls
modem_pipe_close_async() followed by modem_cellular_enter_state(IDLE)
which also calls modem_pipe_close_async().

Prevent side-effects of calling the close twice, by checking the already
existing atomic bit.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2026-02-13 09:49:54 -06:00
Benjamin Cabé
090e351e0a fs: shell: adopt SHELL_HELP in FS shell
Use SHELL_HELP macro for help strings to ensure consistency across
various shell modules.
This also documents the usage for each command.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-02-13 09:46:18 -06:00
Benjamin Cabé
a6c663d16c fs: shell: use proper parameter validation for fs shell test commands
Rather than manually checking the number of arguments and printing an
error message, let the shell subsytem handle the validation for us by
indicating all arguments as required.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-02-13 09:46:18 -06:00
Muhammad Waleed Badar
4490c05eef usb: device_next: shell: adopt SHELL_HELP macro
Convert USB device shell command help strings to use the
SHELL_HELP() macro instead of inline help text.

This aligns the USB device shell with the updated shell help
formatting used across the tree and ensures consistent
presentation of command descriptions and argument usage.

Signed-off-by: Muhammad Waleed Badar <walid.badar@gmail.com>
2026-02-13 13:56:04 +01:00
Benjamin Cabé
b710a9ec77 doc: include: drop funcprops Doxygen alias
The "@funcprops" Doxygen alias was originally introduced to list all
the function properties that apply to a given function (e.g. isr_ok,
etc.) in the form of a bullet list. However, since commit a258ab32d1
that is no longer the case and all the properties are rendered as
qualifiers (https://www.doxygen.nl/manual/commands.html#cmdqualifier)
and therefore no longer need to be grouped in a separate list.

This commit also ensure all aliases for the actual qualifiers use
`@qualifier` notation instead of `\qualifier` to be consistent with
our Doxygen guidelines.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-02-13 13:55:40 +01:00
Emil Gydesen
8d904e186b Bluetooth: TBS: Client: Fix reset issue with net_buf
The net_buf was always initialized with net_buf_simple_init_with_data
which was a bit wasteful as we only need to do that once. Since `inst`
is `static`ally allocated, we can check for `.data == NULL`.

Additionally the read callbacks expect the buffer to be 0-initialized
between each usage, which wasn't the case. We can use the `buf.len`
to determine how many bytes we need to reset to `0`.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-02-13 12:37:31 +01:00
Tom Burdick
cd1cc1c0ca rtio: Make the cacheline struct size check optional
This check was asserting on the wrong struct size and was not taking in
the architecture configured cache line size. The build assert now checks
the right struct size and takes into account the configured cache line
size or sets a default.

Additional makes the check entire opt in.

Signed-off-by: Tom Burdick <thomas.burdick@infineon.com>
2026-02-13 10:06:50 +01:00
Tom Burdick
b91a201b15 rtio: Make OP_DELAY optional
OP_DELAY requires embedding in the submission queue entry a _timeout
struct which can push the struct size over the specified 64 byte (cache
line) limit.

Signed-off-by: Tom Burdick <thomas.burdick@infineon.com>
2026-02-13 10:06:50 +01:00
Johann Fischer
eee1fa2d2c usb: usbip: use recently introduce zsock_send_all()
zsock_send() does not necessarily have to send the entire data. Use the
recently introduced function zsock_send_all().

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2026-02-13 10:05:52 +01:00
Johann Fischer
6f602ded27 usb: usbip: retry if the UHC transfer allocation fails
Depending on the server, functions, and client application, we may
get out of transfers very quickly. To throttle here may allow
submitted transfers to be finished.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2026-02-13 10:05:52 +01:00
Johann Fischer
665ab07831 usb: usbip: use variable buffer pool for URB data
UHC transfer handling and assignment of completed transfers to URB
sequences relies on the buf->size. For that, we can just use variable
net_buf pools instead of fixed. Perhaps it gives us also better
utilization of the buffer.

Add Kconfig optons to configure pool size and number of buffers
and use large default pool size for native_sim platform.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2026-02-13 10:05:52 +01:00
Johann Fischer
c9e105873a usb: usbip: improve completion handling when client disconnects
Make request completion handling a bit more robust when, for whatever
reason, the connection has been closed. Do not implicitly clear the USB
device pointer on client disconnect, to allow the completion callback to
clean up. Before handling USBIP_RET_SUBMIT, check whether the device is
still exported, and if not, just drop completed transfer.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2026-02-13 10:05:52 +01:00
Pieter De Gendt
baba005e03 net: dns: resolve: Take lock before calling dns_resolve_init_locked
The mutex should be held when calling dns_resolve_init_locked as mentioned
in a comment above the function.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2026-02-12 14:32:19 +00:00
Herman Berget
62e12edb19 Bluetooth: Host: Use HCI VS command to set public addr on bt_enable
The current way of setting the public address using
`bt_hci_driver_api::setup` does not work well in split builds
where host and controller runs on different cores/socs/boards.
This approach requires each HCI driver and each `hci_<transport>`
application to implement the setup and pass the information on
to the next layer.

Zephyr already defines a vendor-specific command that can be used
to set the public address (`bt_hci_cp_vs_write_bd_addr`).
Use this in `bt_enable` after opening the HCI transport and before
initializing the id module. This makes the setup independent of
hci transport and only depends on a controller that implements the
Zephyr HCI VS commands.

Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
2026-02-12 14:29:44 +00:00
Jamie McCrae
cf972fbba3 retention: Use offset for offset of retention node
Uses the offset instead of the absolute address, to align with a
properly defined DTS layout

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2026-02-12 14:29:31 +00:00
Johann Fischer
0c31b37525 usb: move instances Kconfig template to common directory
Move the Kconfig template to configure the number of instances in, for
example, functions or class drivers, to a common directory.
This makes it less confusing when used in host support.

Template was not used in CDC ECM function and can be removed.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2026-02-12 14:28:18 +00:00
Alex Ciascai
cb9f5f8be0 bluetooth: tbs: fix Join opcode result for PTS conformance
Update the Join handler to return BT_TBS_RESULT_CODE_OPERATION_NOT_POSSIBLE

Signed-off-by: Alex Ciascai <ciascai.alexandru@gmail.com>
2026-02-12 14:27:07 +00:00
Dominik Ermel
919a4f1601 kvss: Move NVS and ZMS headers under kvss subdir
Move them out of fs to kvss.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2026-02-12 10:55:27 +01:00
Dominik Ermel
b9fcb5efa4 kvss: Create Key-Value Storage subsystem
Add new subsystem and move NVS and ZMS under that subsystem.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2026-02-12 10:55:27 +01:00
Evgenii Kosenko
6b1b725ed2 Bluetooth: Shell: Fix GATT UUID race condition with per-operation storage
The static global UUID variable in the GATT shell module was shared across
all concurrent discover and read-by-uuid operations, creating a potential
race condition where one operation could overwrite the UUID before another
completed. Move UUID storage into the per-operation gatt_op_context
structure to isolate UUID state for each operation. This enables safe
concurrent operations without data corruption.

Signed-off-by: Evgenii Kosenko <Evgenii.Kosenko@silabs.com>
2026-02-12 09:30:18 +01:00
Fin Maaß
31864334b3 fs: reduce usages of strlen()
for checking the first two chars of a string
we don't need to get the full lenght, we can simply
just check the 2 chars, especially as we already check
the first one already.

in `fs_opendir` we only need to check the first char.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2026-02-11 17:49:35 -06:00
Pieter De Gendt
20d62fe4e0 shell: Add shell_readline helper
Introduce a helper function to wait for user input with a timeout.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2026-02-11 17:47:50 -06:00
Pieter De Gendt
186597eb99 shell: dummy: Add input buffer
Allow reading from the dummy shell backend, useful for testing purposes.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2026-02-11 17:47:50 -06:00
Emil Gydesen
971578a123 Bluetooth: TBS: Fix issues with friendly name buffer sizes
The friendly name buffer sizes used the URI length, but since
the friendly name is specifically not an URI that did not make
sense. Added a new Kconfig option to configure the maximum
supported friendly name, which is shared between both TBS
and the TBS client, similar to the other max Kconfig options.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-02-11 17:47:36 -06:00
Kristoffer Skøien
c966a54549 Bluetooth: BAP: Direction fix
Bugfix, changed from source to sink in bt_bap_unicast_group_reconfig

Signed-off-by: Kristoffer Skøien <kristoffer.skoien@nordicsemi.no>
2026-02-11 16:34:13 +01:00