Commit graph zephyr/subsys
Author SHA1 Message Date
Wojciech Jablonski
9806fab79b llext: Option for customizing FLIX generation
Compiler-generated FLIX instructions are currently disabled for LLEXT due
to a historic issue with LLEXT feature that appears to be already
resolved. However, another issue with FLIX is now being investigated.
The latter issue is not related to LLEXT but userspace feature.
To mitigate impact of global complier settings, this change adds a kconfig
choice for controlling FLIX generation independently for LLEXT modules.

Signed-off-by: Wojciech Jablonski <wojciech.jablonski@intel.com>
2026-02-23 13:32:47 -06:00
Szymon Janc
7f044f0a00 Bluetooth: GATT: Fix writable appearance Kconfig choice name
Make sure choice option name is not same as actual config option
that is enabling it. Use _SECURITY suffix for clarity of what
choice is actually about.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2026-02-23 17:00:16 +00:00
Martin Moya
996feaea91 bluetooth: services: cts: Add local time information characteristic
CTS is missing the Local Time Information characteristic and this
commit adds the UUID and the full characteristic to its service.

The peripheral example has been updated as well to use this and
implement it on the example so it is easy to test it out.

Signed-off-by: Martin Moya <moyamartin1@gmail.com>
2026-02-23 16:58:13 +00:00
Vinit Mehta
0d387be9b6 bluetooth: host: add kconfig for evt synchronous buffer pool
- Add kconfig for HCI event synchronous buf pool to allow vendors
to configure buffer count based on the application/host platform
requirements

Signed-off-by: Vinit Mehta <vinit.mehta@nxp.com>
2026-02-23 11:35:42 +00:00
Jukka Rissanen
3a40c90b98 net: dns: Check that DNS packet contains also query type and class
When receiving a DNS query, make sure that the packet contains
also query type and class fields before trying to access them.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2026-02-23 08:53:00 +01:00
Lingao Meng
fe111defaf fs: nvs: fix NVS recovery to handle trailing delete ATEs
Use ate_end_addr >= data_end_addr instead of > to ensure the
last delete ATE is scanned and recovered correctly.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2026-02-21 15:34:58 +00:00
Jay Beavers
f5867550af net: usbd: Set default traffic class TX count
Fixes zephyrproject-rtos/zephyr#103442
Origin: Original

Adds a separate TX traffic class for CDC-ECM and CDC-NCM in USBD Next
to prevent a deadlock during interface provisioning.

Tested with a custom nRF53-app firmware which combines CDC-ECM /
CDC-NCM (both tested) with mDNS with USB hosts MacOS, iPadOS, and
Alpine Linux.

Signed-off-by: Jay Beavers <jay@tolttechnologies.com>
2026-02-21 15:34:44 +00:00
Tomasz Moń
cbe1958809 usb: device_next: dfu: actually fail requests
Control read handlers handle_get_status(), handle_get_state() and
handle_upload() return value is used to set errno. Setting errno inside
the functions and then returning 0 therefore does not fail the request
as intended.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2026-02-20 14:58:46 +01:00
Dipak Shetty
cae71714de bluetooth: services: add Elapsed Time Service support
Added support for elapsed time service (ETS). The service
is introduced currently with the experimental tag.

Signed-off-by: Dipak Shetty <shetty.dipak@gmx.com>
2026-02-20 13:30:34 +01:00
Emil Gydesen
12c30e526a Bluetooth: TBS: Allow join in alerting/dialing state
The TBS spec only specificially disallows join for calls in
the incoming state. The Alerting and Dialing state in Zephyr
were disallowed, but that fails some TBS join tests.

Removed the (implicit) checks for alerting and dialing and
updated the state changer code to be more explicitly so that
all call states, except for incoming, is explicitly handled.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-02-20 10:11:46 +01:00
Emil Gydesen
dd4a01af48 Bluetooth: TBS: set_uri_scheme_list single string instead of array
Refactor bt_tbs_set_uri_scheme_list to take a single string instead
of an array of URIs. This should not affect applications much
in any way (and may actually be easier to use), but simplifies
the implementation significantly, and reduces memory footprint.

Additionally it also make the client and server more similar
as bt_tbs_client_read_uri_list just returns it as a single
string as well.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-02-20 10:10:38 +01:00
Emil Gydesen
796ac63086 Bluetooth: PACS: Add missing checks before assert in register
bt_pacs_register would assert if e.g.
CONFIG_BT_PAC_SRC_NOTIFIABLE=y but param.src_pac = false.

Add checks for setting the attributes, only if the parameter
actually enables the characteristics.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-02-20 10:09:15 +01:00
Lauren Murphy
ebf1f9d019 tests: llext: fixes for arcmwdt, gcc
Adds fixes for build and runtime issues using MWDT:

* Rename sections for llext_memblk.c buffers as MWDT cannot initialize
  sys_mem_blocks struct with buffer address when the section name of
  sys_mem_blocks struct (its variable name) is identical to the
  buffer's section name
* Adds --no-check-sections flag for MWDT on final stages of
  linking. Unlike other toolchains, MWDT's default behavior is to
  strictly check and fail on section overlap. Using SLIDs requires
  overlap; see llext-sections.ld
* Modifies inspect test case's ifdef around rodata sections, as
  not all Harvard platforms using MWDT have .rodata_in_data sections -
  their creation is triggered by passing the -Hccm flag to CCAC.
  As an example, nsim/nsim_em doesn't have them and nsim/nsim_vpx5 does
* Removes -Hccm flag when building with CONFIG_LLEXT_RODATA_NO_RELOC
  as it causes CCAC to mark the custom section llext.rodata.noreloc
  writable (SHF_WRITE) though it has only read-only data, making it
  impossible for for LLEXT to recognize it and put it in the
  appropriate region; see llext_load.c's llext_map_sections
* Adds name to unnamed first argument of threads_objects_test_setup,
  removing warning about omitting parameter names being a
  C2x extension

Also fixes a build warning for GCC about pointer arithmetic in
the INSTR_FETCHABLE macro.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2026-02-20 07:07:52 +01:00
Gaetan Perrot
951f8d48b0 bluetooth: audio: bap_stream: Fix possible NULL dereference
Avoid dereferencing `stream` in the debug log message when checking
for invalid input parameters.

The previous log printed `stream->ep` and `stream->conn` inside a
combined NULL check, which could trigger static analysis warnings
about a possible NULL pointer dereference.

Align the implementation with the existing pattern used in the file
by logging a generic "Invalid stream" message instead.

No functional change.

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2026-02-19 10:04:50 -06:00
Lingao Meng
49e7643671 tests: nvs: expose nvs_flash_al_wrt_streams for testing
Make nvs_flash_al_wrt_streams() non-static when CONFIG_ZTEST is
enabled so it can be unit tested.

Add test_nvs_write_stream to verify correct concatenation and
write behavior for different head/data/tail combinations.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2026-02-19 10:02:36 -06:00
Lingao Meng
292beaae8d fs: nvs: pack data during GC and flush tail via buffered block move
Rework the NVS garbage collection data move path to support
write-block–aligned packing of consecutive records.

Introduce struct nvs_block_move_ctx to buffer unaligned tail
bytes during GC. Data is moved in write_block_size-aligned chunks
only, and any remaining bytes smaller than one write block are
temporarily buffered and prepended to the next write. The final
tail is flushed before GC completion.

Extend struct nvs_flash_wrt_stream to support an optional
header buffer, allowing head/data/tail segments to be written
as a single contiguous stream while respecting flash alignment
requirements.

This enables packed back-to-back data movement during GC without
introducing additional padding between records. CRCs are not
recomputed for moved data, preserving on-flash format and
compatibility.

No changes are made to normal nvs_write() alignment semantics
outside of GC.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2026-02-19 10:02:36 -06:00
Lingao Meng
e9ff9a5c5b fs: nvs: allow pending write to be committed during GC
Extend the NVS garbage collection path to optionally commit a
pending write request while GC is running.

Introduce struct nvs_gc_write_entry to describe a write operation
that may be handled during GC. When space is insufficient and GC is
triggered from nvs_write(), the write request is passed to
nvs_gc(). If the entry being updated is encountered in the sector
currently being garbage collected, the old copy is skipped and the
new data may be written directly into the active sector, provided
there is sufficient space.

This avoids unnecessary data movement where the old entry would
otherwise be copied during GC and then immediately superseded by a
new write.

The existing GC behavior is preserved when no pending write is
provided.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2026-02-19 10:02:36 -06:00
Lingao Meng
56ea1e6619 fs: nvs: introduce stream-based aligned flash write helper
Introduce nvs_flash_al_wrt_streams() to support aligned flash
writes composed of a primary data buffer and an optional tail buffer.

This refactors the existing aligned write path to allow multiple
contiguous buffers to be written as a single logical stream while
respecting flash write-block alignment requirements. The new helper
enables cleaner handling of cases where data must be extended with
additional metadata (e.g. CRC) without temporary concatenation
buffers or partial pre-writes.

nvs_flash_data_wrt() is updated to use the stream-based interface
for CRC handling. The existing nvs_flash_al_wrt() API is preserved
as a thin wrapper for backward compatibility.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>

iiii

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2026-02-19 10:02:36 -06:00
Emil Gydesen
b438540a09 Bluetooth: CAP: Log ADV address when starting via handover
When starting adv via handover, we log the address used
for the advertising set for debugging purposes.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2026-02-19 10:00:26 -06:00
Radosław Koppel
1fa8739af7 Bluetooth: Host: Conn: Add GAP service validation
Implement the validation if there is exactly one GAP service
in GATT database.
The validation is performed as soon as the GATT database
is available and forbids to enable the Bluetooth if the configuration
is not compatible with the Bluetooth Specification.
The verification may be disabled by the user for better performance
or deliberate implementation that is not compliant with the
specification.

Signed-off-by: Radosław Koppel <r.koppel@k-el.com>
2026-02-19 09:58:49 -06:00
Radosław Koppel
9f33889066 Bluetooth: gap_svc_default: Set user_data for name characteristic to NULL
Set the unused argument of the name characteristic to NULL.
This removes the reference from GAP service to the hci_core.

Signed-off-by: Radosław Koppel <r.koppel@k-el.com>
2026-02-19 09:58:49 -06:00
Radosław Koppel
95e9f27939 Bluetooth: gap_svc_default: Update attribute len checking in write_name
Remove offset form the attribute length checking as the offset
is tested before to be 0.

Signed-off-by: Radosław Koppel <r.koppel@k-el.com>
2026-02-19 09:58:49 -06:00
Radosław Koppel
233495d234 Bluetooth: gap_svc_default: Add BT_ prefix to DEVICE_xxx_GATT_WRITABLE_
Rename the DEVICE_NAME_GATT_WRITABLE_ kconfig options to
BT_DEVICE_NAME_GATT_WRITABLE_.
Rename DEVICE_APPEARANCE_GATT_WRITABLE_AUTHEN to
BT_DEVICE_APPEARANCE_GATT_WRITABLE_AUTHEN.

The old options are marked as deprecated.

Signed-off-by: Radosław Koppel <r.koppel@k-el.com>
2026-02-19 09:58:49 -06:00
Radosław Koppel
e5258ed86d Bluetooth: Host: Extract GAP service from GATT
Remove Generic Access Service implementation from gatt files and move it
into separate file in services directory.
The default service implementation can be disabled by the user in purpose
of providing the GAP implementation directly in the application.

Signed-off-by: Radosław Koppel <r.koppel@k-el.com>
2026-02-19 09:58:49 -06:00
Krzysztof Chruściński
ef085c6898 logging: frontends: improve Kconfig for Coresight STM frontend
Add missing fields in arm,stmesp binding and limit Coresight STM
frontend to SoCs which have the required hardware.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2026-02-19 12:53:43 +01:00
Krzysztof Chruściński
f1e1711995 logging: frontends: Enable special alignment for cbprintf packages
Use specific alignment when STM logging frontend is used on RISCV
core (PPR or FLPR). It fixes the case where 64 bit variable were
incorrectly logged.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2026-02-19 12:53:43 +01:00
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