131212 Commits

Author SHA1 Message Date
Jakub Rzeszutko
a04d8957c2 shell: fix race condition between prompt print and RX buffer flush
Move z_shell_backend_rx_buffer_flush() before state_set() in
shell_start() to prevent a race condition where incoming shell
commands could be lost.

Previously, the sequence was:
1. state_set() - prints the prompt
2. z_shell_backend_rx_buffer_flush() - flushes RX buffer

If the shell thread was preempted after printing the prompt,
the host could see the prompt and send commands. When the
thread resumed, z_shell_backend_rx_buffer_flush() would discard
those commands.

By flushing the RX buffer before printing the prompt, any
commands received after the prompt is visible will not be
affected by the flush operation.

Fixes #99674

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@verkada.com>
2026-01-23 09:21:43 -06:00
Cristian Bulacu
f87fff19a7 tests: net: remove OT reference device flag for OT tests
This commit removes OPENTHREAD_REFERENCE_DEVICE flag for OpenThread tests.

Signed-off-by: Cristian Bulacu <cristian.bulacu@nxp.com>
2026-01-23 09:21:10 -06:00
Cristian Bulacu
089bb1f000 samples: net: openthread: Remove OT reference device flag for NXP RW612
This commit removes the OPENTHREAD_REFERENCE_DEVICE flag for NXP RW612
samples, as these are not meant to be included in a test setup.

Signed-off-by: Cristian Bulacu <cristian.bulacu@nxp.com>
2026-01-23 09:21:10 -06:00
Andrej Butok
6404f37814 boards: nxp: Fix NXP MCU board names in yaml
- Fixes an inconsistency in the board list
  of the MCUx-VSCode extension. No functional change.
- Adjusts names in yaml files to follow the currently used approach
  "NXP <board_name> [(cpu)] [(type)]".

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2026-01-23 09:20:47 -06:00
Benjamin Cabé
1feabd2552 shell: fix potential buffer overflow in shell_help_is_structured()
The function was casting a char* help pointer to struct shell_cmd_help*
and reading its 4-byte magic field. When the help string was shorter
than 4 bytes, this caused a read past the end of the buffer.

The fix replaces the struct cast with a byte-by-byte comparison of the
magic number.

Fixes zephyrproject-rtos/zephyr#102598

Co-authored-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-01-23 09:20:01 -06:00
Svitlana Drozd
cdfd692b76 boards: raspberrypi: rpi_5: correct DTB file name in doc
The DTB file was previously listed as bcm2712-rpi-5.dtb, which was
inaccurate, as the hyperlink referenced the `bcm2712-rpi-5-b.dtb`
file. To ensure documentation precision and avoid potential
confusion, update the file name to the correct
`bcm2712-rpi-5-b.dtb`.

Signed-off-by: Svitlana Drozd <svitlana_drozd@epam.com>
2026-01-23 09:19:25 -06:00
Svitlana Drozd
b4bbba70b1 boards: raspberrypi: rpi_5: remove unnecessary arm_64bit option
The ARM cores in BCM2712 are incapable of running the kernel in 32-bit
mode. The option `arm_64bit=1` is unnecessary and can be confusing, as
Raspberry Pi 5 runs in 64-bit mode by default.

Removed the `arm_64bit=1` configuration from documentation for Raspberry
Pi 5 (BCM2712).

Signed-off-by: Svitlana Drozd <svitlana_drozd@epam.com>
2026-01-23 09:19:25 -06:00
Cesar Santos
ec5c3420b3 samples: net: secure_mqtt_sensor_actuator: add missing POSIX libraries
In order to compile the demo application for a secure MQTT connection,
several networking API functions are used, which is properly defined by
some of the POSIX libraries already integrated onto Zephyr project. By
adding the missing libraries, compilation to the reference board
adi_eval_adin1110ebz passes.

As a minor change, reordered the sequence of included libraries to be
in alphabetical order.

Fixes #102372.

Signed-off-by: Cesar Santos <dev.cmsantos@gmail.com>
2026-01-23 09:19:01 -06:00
Wolfgang Betz
b84bdbcee3 dts: arm: st: n6: Use dedicated dts node for NPU cache (aka CACHEAXI)
The new node is called "npu_cache".

This way a possibility is offered to choose - thru an overlay - if to
enable the NPU cache or not.
This new node has a dependency with node "npu", so the NPU cache's
status is taken into account only in case node "npu" has status "okay".

Default status value of "npu_cache" is "okay"
(i.e. enable the NPU cache).

Signed-off-by: Wolfgang Betz <wolfgang.betz@st.com>
2026-01-23 09:18:34 -06:00
Alberto Escolar Piedras
92df06bf1d boards: native: nrf_bsim: Add simple model of LDREX/STREX/CLREX
Add a model of LDREX/STREX/CLREX, that although simple may be correct
enough to cover the needs of SW using these instructions.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2026-01-23 09:17:37 -06:00
Marcelo Roberto Jimenez
1ab8978e66 drivers: flash: flash_shell.c: Fix flash read help text
Actually, the parameter is the number of bytes to read, not the number
of double words.

Signed-off-by: Marcelo Roberto Jimenez <marcelo.jimenez@gmail.com>
2026-01-23 09:17:05 -06:00
Marcelo Roberto Jimenez
391ca7c7de drivers: flash: flash_shell.c: Fix parsing of "flash read"
The parsing of the number of bytes to read in the read command was being
done in hexadecimal, causing unexpected behavior.

Now the number can be interpreted in decimal or hexadecimal if prefixed
with 0x.

Signed-off-by: Marcelo Roberto Jimenez <marcelo.jimenez@gmail.com>
2026-01-23 09:17:05 -06:00
Marcelo Roberto Jimenez
ec8472c362 tests: subsys: shell: Clang-format on shell_flash_test.c
This patch runs clang-format on the shell_flash_test.c file
before the real patch gets applied, otherwise the changes
would be hard to read.

Signed-off-by: Marcelo Roberto Jimenez <marcelo.jimenez@gmail.com>
2026-01-23 09:17:05 -06:00
Marcelo Roberto Jimenez
9535aebafe drivers: flash: flash_shell.c: Run clang-format before patch
This patch runs clang-format on the flash_shell.c file before the
real patch gets applied, otherwise the changes would be hard to
read.

Signed-off-by: Marcelo Roberto Jimenez <marcelo.jimenez@gmail.com>
2026-01-23 09:17:05 -06:00
Gaetan Perrot
08f8223d55 boards: phytec: phyboard_atlas: xip: fix typos in comments
Fix spelling and wording issues in comments for phytec
phyboard_atlas xip FlexSPI NOR configuration headers.

No functional change.

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2026-01-23 13:57:14 +01:00
Mathieu Choplain
7a8bc1cdce soc: st: stm32: cleanup linker script of STM32MP2 series
Remove inclusion of files already included by the arch linker script from
the SoC-specific linker script.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-01-23 13:56:53 +01:00
Mathieu Choplain
c64c13e525 soc: st: stm32: cleanup linker scripts of STM32MP1 series
STM32MP1 series used a custom SOC_LINKER_SCRIPT, but all it did was
include the main Cortex-M script, unnecessarily re-include headers already
included by the main script(!) and add a custom section.

Get rid of the custom SOC_LINKER_SCRIPT but keep the custom section by
moving it to a linker script snippet file, added to the build system using
CMake directives.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-01-23 13:56:53 +01:00
Fabrice DJIATSA
d1e8918332 boards: shields: x_nucleo_dfx01m2: fix invalid dt enums in overlays
Fix the panel pixel format enum in the X-NUCLEO-GFX01M2 shield overlay
by using PANEL_PIXEL_FORMAT_RGB_565 as defined in panel dt-bindings.

Signed-off-by: Fabrice DJIATSA <fabrice.djiatsa-ext@st.com>
2026-01-23 13:56:08 +01:00
Fabrice DJIATSA
de04861e29 samples: sensor: stream_drdy: fix invalid dt enums in overlays
Fix Devicetree compilation errors caused by incorrect enum macro
names used in DTS overlay files.

Replace LSM6DSV16X_DT_ODR_AT_120Hz with the correct Devicetree enum
LSM6DSVXXX_DT_ODR_AT_120Hz in the stream_drdy sample boards overlay.

Signed-off-by: Fabrice DJIATSA <fabrice.djiatsa-ext@st.com>
2026-01-23 13:56:08 +01:00
Johan Hedberg
f64a999147 drivers: bluetooth: silabs_efr32: Fix default for max PAwR advertisers
This option already depends on BT_PER_ADV_RSP being enabled, so we should
have a more reasonable default for it. This way e.g. the existing PAwR
sample app should work without additional changes.

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2026-01-23 13:55:25 +01:00
Pieter De Gendt
8402a4f8e5 drivers: gpio: mcux: Fix updating ICR registers without IRQ lock
During configuration the base->ICR1 or base->ICR2 register is written
without an IRQ lock. This can result in unwanted side-effects if the status
bit isn't cleared, or the edge select still needs to be updated.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2026-01-23 13:54:42 +01:00
Gaetan Perrot
7af0a2fcdf sensor: adi: adxl372: stream: check return value of adxl372_set_op_mode
Check the return value of adxl372_set_op_mode() in
adxl372_submit_stream() and abort on error.

Fix CID: 516239

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2026-01-23 13:54:21 +01:00
Gaetan Perrot
ed545d2302 drivers: ethernet: lan9250: Make interrupt mask constant unsigned
Add a 'U' suffix to the interrupt status mask passed to
lan9250_write_sys_reg() to make the constant explicitly unsigned.

This avoids signed/unsigned ambiguity and addresses a SonarQube
static analysis warning.

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2026-01-23 13:53:59 +01:00
Gaetan Perrot
f18da88e3f drivers: ethernet: lan9250: fix uninitialized variable warning
The lan9250_thread() function declares a local variable that may be
used without being initialized, triggering a -Wmaybe-uninitialized
warning when building with -Werror.

Initialize the variable at declaration to ensure deterministic
behavior and avoid build failures.

No functional change intended.

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2026-01-23 13:53:59 +01:00
Gaetan Perrot
2719679c26 drivers: ethernet: lan9250: fix error handling
Several LAN9250 helper functions ignored return values from register
access and wait routines, potentially hiding SPI or timeout
failures.

Propagate error codes from read/write/wait helpers throughout the
driver so failures are detected and handled by callers.

This improves robustness and makes error conditions visible during
initialization, PHY access, RX/TX paths, and MAC configuration.

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2026-01-23 13:53:59 +01:00
Robert Lubos
10b9520cac net: lib: http_server: Prefer explicitly defined resources over FS ones
Do direct resource path comparison on all registered resources before
falling back to fnmatch() so that exact path matches get always
preference.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2026-01-23 13:52:47 +01:00
Robert Lubos
59b653bb4f tests: net: lib: http_server: Add test case for overlapping resources
Add a test case verifying that if there's a static resource defined
which overlaps a FS resource pointing to a directory, it takes
preference on exact URI match.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2026-01-23 13:52:47 +01:00
Hugues Fruchet
b0fd7d9665 samples: video: tcpserversink: release camera frame as soon as possible
Release camera frame immediately after video encoding.
Doing so, the frame could be reused by camera for next capture
without waiting for the end of network transmission.

Signed-off-by: Hugues Fruchet <hugues.fruchet@foss.st.com>
2026-01-23 13:52:31 +01:00
Hugues Fruchet
9ebfb206af samples: video: tcpserversink: fix multiple connect/disconnect
Fix multiple connect/disconnect regression introduced in
6a7aefaa samples: video: tcpserversink: check video_enqueue/dequeue
return values.

Signed-off-by: Hugues Fruchet <hugues.fruchet@foss.st.com>
2026-01-23 13:52:31 +01:00
Hugues Fruchet
0c0bb202c7 samples: video: tcpserversink: fix missing input buffer encoder dequeue
Fix missing input buffer encoder dequeue, this was corrupting camera
device fifo because of same buffer queued into two different fifo.

Signed-off-by: Hugues Fruchet <hugues.fruchet@foss.st.com>
2026-01-23 13:52:31 +01:00
Hugues Fruchet
70f57d119a drivers: video: stm32_dcmipp: give back buffers at stream disable
Give back buffers at stream disable.

Signed-off-by: Hugues Fruchet <hugues.fruchet@foss.st.com>
2026-01-23 13:52:31 +01:00
Hugues Fruchet
cc8475dd52 drivers: video: stm32_dcmipp: set multilines to 128 to limit interrupts
Set multiline on pixel pipes to 128 lines to limit slave IP hardware
handshakes and so reduce the number of interrupts received by slave IP.

Signed-off-by: Hugues Fruchet <hugues.fruchet@foss.st.com>
2026-01-23 13:52:31 +01:00
Hugues Fruchet
8c8a021a5f drivers: video: stm32_venc: log interrupts
Log number of interrupts, including fuse interrupts at each
key frame and at the end of encoding.

Signed-off-by: Hugues Fruchet <hugues.fruchet@foss.st.com>
2026-01-23 13:52:31 +01:00
Hugues Fruchet
f396ac9efc drivers: video: stm32_venc: fix completion on interrupt
Fix wait of hardware encoding completion by using
interrupt signaling instead of polling on irq status.

Signed-off-by: Hugues Fruchet <hugues.fruchet@foss.st.com>
2026-01-23 13:52:31 +01:00
Hugues Fruchet
e84f195780 drivers: video: stm32_venc: fix delta frames generation
Only key frames were generated because of resync flag
always true, fix this.

Signed-off-by: Hugues Fruchet <hugues.fruchet@foss.st.com>
2026-01-23 13:52:31 +01:00
Hugues Fruchet
a616f7b107 drivers: video: stm32_venc: fix release sequence
Fix missing H264 library release and total memory count reset.

Signed-off-by: Hugues Fruchet <hugues.fruchet@foss.st.com>
2026-01-23 13:52:31 +01:00
Andy Lin
d807e39a2c arch: riscv: Add the support for Zbkb ISA extension
Introduce the missing flag to compile code with Zbkb extension,
which has already been supported by the GCC 12 in current SDK.

Signed-off-by: Andy Lin <andylinpersonal@gmail.com>
2026-01-23 13:51:55 +01:00
Łukasz Kędziora
261dfbc765 drivers: spi_dw: Add clock control
This adds optional clock control support to the spi_dw driver. The
support currently assumes that the clock control binding uses clkid for
the clock cell name.

Signed-off-by: Łukasz Kędziora <lkedziora@antmicro.com>
Signed-off-by: Piotr Zierhoffer <pzierhoffer@antmicro.com>
Signed-off-by: Andreas Weissel <andreas.weissel@synaptics.com>
2026-01-23 13:50:34 +01:00
Marcelo Roberto Jimenez
e73e2f148c drivers: ethernet: xmc4xxx: BUG Fix: RX code dropping packets
The ethernet DMA driver code was causing the silent dropping of packets
with length 125, 126 and 127. The root cause of the problem is that the
DMA engine performs an extra four bytes transfer corresponding to the
Receive Status Word. For those particular packet lengths, the previous
code incorrectly calculated the last fragment size.

The new code avoids that pitfall by decrementing the total frame size as
the fragments are being collected, while avoiding the creation of an
extra fragment on the extracted network packet.

Signed-off-by: Marcelo Roberto Jimenez <marcelo.jimenez@gmail.com>
2026-01-23 13:49:34 +01:00
Johann Fischer
506a59396f usb: device_next: fix compilation if the user disables HWINFO
Make USBD_HWINFO_DEVID_LENGTH prompt optional so that the code compiles
even if HWINFO is disabled.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2026-01-23 13:48:16 +01:00
Robert Lubos
ba04734220 net: sockets: tls: Optimze helper buffer for sendmsg and CID check
Both cases use a large static buffer, we can optimize here and use a
single mutex-protected buffer for both.

sendmsg() test case needed adjustments, as it was also testing a buffer
overflow scenario. This can only be properly tested however if CID
feature is disabled, as otherwise the common helper buffer size is
increased for the CID use case, preventing the overflow from taking
place.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2026-01-23 10:46:05 +01:00
Robert Lubos
3cc194ee35 tests: net: sockets: tls: Add test cases for DTLS server multi-client
Add test cases verifying that DTLS server socket can handle multiple
clients.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2026-01-23 10:46:05 +01:00
Robert Lubos
8afc2af3c2 net: sockets: tls: Make socket options work with multi-client server
For options that return the handshake status, make sure they work in
multi-client DTLS server case, by returning the status for the session
that completed handshake most recently. For TLS and DTLS client cases
that should make no difference, as there should only be one session per
context.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2026-01-23 10:46:05 +01:00
Robert Lubos
ab07f69128 net: sockets: tls: DTLS server session timeout rework
With support for multiple client sessions for DTLS server socket, the
session timeout can no longer rely on built-in mbed TLS timing out
mechanism, as this only works for the session that is currently active.
Background sessions would never time out if the client just went silent.
Therefore, allocate a per-session timestamp, that keeps track of the
last activity on the session. Then, whenever poll() or recv() is called
loop over all sessions to identify those that timed and should be
released.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2026-01-23 10:46:05 +01:00
Robert Lubos
53be38d3f0 net: sockets: tls: Implement DTLS server session matching by CID
In case a client address changes, but a session uses Connection ID
extension, the server should verify if the packet belongs to any of the
established sessions based on the CID value.

Therefore, before attempting to allocate a new session in such case,
loop over sessions and try to match the packet to one of the existing
sessions based on CID. In case of success, update the corresponding peer
address.

If no session is found based on CID, only then try to allocate a new
one.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2026-01-23 10:46:05 +01:00
Robert Lubos
4197720be8 net: sockets: tls: Free DTLS server active session on errors
In case of errors on an active session (in most cases peer closing the
session), the session should be freed. Note, that as mbed TLS needs some
session context to work with, the last session on a socket is not freed,
but only reset instead.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2026-01-23 10:46:05 +01:00
Robert Lubos
6f58b3f24f net: sockets: tls: DTLS server session matching on TX
For TX, the DTLS server needs to check the peer address before passing
the packet to mbed TLS. In case the peer address doesn't match the
active session, it needs to switch sessions.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2026-01-23 10:46:05 +01:00
Robert Lubos
cc6248d87c net: sockets: tls: Refactor RX part for DTLS server
Refactor RX side for DTLS server to allow session switching when a
datagram from a peer that does not match current session. The server
needs to loop over established sessions, and in case no session is
found allocate a new one.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2026-01-23 10:46:05 +01:00
Robert Lubos
9e544a9ec7 net: sockets: tls: Split DTLS BIO functions
Split DTLS BIO RX functions for client and server case, given the
functionality will differ heavily. DTLS server needs to peek packet
before passing it to mbed TLS to allow to switch DTLS sessions in case
peer address doesn't match.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2026-01-23 10:46:05 +01:00
Robert Lubos
779bfe2e5e net: sockets: tls: Split TLS session and context initialization
It has to be possible to initialize TLS sessions separately of the TLS
socket context.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2026-01-23 10:46:05 +01:00