Commit graph

136,983 commits

Author SHA1 Message Date
Emanuele Di Santo
a23cfc3f68 kernel: nothread: use k_timer to sleep instead of busy waiting
The current implementation of k_sleep(), when multi-threading
is disabled, busy waits using k_busy_wait() until the sleep timeout
has expired.

This patch aims to improve power efficiency of k_sleep() for
single-threaded applications by starting a timer (k_timer) and idling
the CPU until the timer interrupt wakes it up, thus avoiding
busy-looping.

Signed-off-by: Emanuele Di Santo <emdi@nordicsemi.no>
2026-01-08 17:33:28 -06:00
Bjarki Arge Andreasen
6e4ef44847 kernel: poll: patch recursive lock in z_vrfy_k_poll
In z_vrfy_k_poll, there is a memory access check
K_SYSCALL_MEMORY_WRITE which is wrapped in a spinlock, the same
spinlock used in z_handle_obj_poll_events which is called from
k_sem_give() for example.

The K_SYSCALL_MEMORY_WRITE() macro conditionally calls LOG_ERR()
which may call the UART console, which may call an API like
k_sem_give(). This will cause a deadlock since the locked spinlock
will be relocked, and a recursive lock if SPINLOCK_VALIDATE and
ASSERTS are enabled as the validation will fail, causing a LOG_ERR,
causing a k_sem_give() causing a relock... until stack overflows.

To solve the issue, only protect the copy of events to events_copy
with the spinlock, the content of events is not actually checked, and
bound is not shared, so there is no need to do this validation in a
critical section. The contents of events is shared so that must be
copied in atomically.

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
2026-01-08 17:32:35 -06:00
Ian Morris
ce526f2e16 boards: shields: Renamed Renesas us159 da14531evz board photograph
Reneamed photograph of Renesas US159 DA14531EVZ board to match
convention documented in the Board Porting Guide (resolving issue
with old image not appearing in list of supported boards on Zephyr
website).

Signed-off-by: Ian Morris <ian.d.morris@outlook.com>
2026-01-08 17:31:48 -06:00
Henrik Brix Andersen
b6f601a2b4 boards: nxp: frdm_mcxn947: list usbd as supported feature
List USB device controller as a supported feature in order to increase test
coverage.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2026-01-08 21:18:53 +01:00
Amneesh Singh
70ca335986 drivers: intc: vim: disable all interrupts at init
Disable all interrupts when the VIM interrupt controller is initialized so
that it doesn't encounter any stray interrupts that were not enabled on
Zephyr.

Signed-off-by: Amneesh Singh <amneesh@ti.com>
2026-01-08 21:18:38 +01:00
Amneesh Singh
8b310cf824 drivers: intc: vim: fix header macros
BIT_MASK(32) cannot do (1 << 32) - 1 without causing integer overflow.
Hence, for these macros BIT64_MASK(32) is required.

Additionally, remove the unnecessary (and presently unused) macros for the
register space. All of these can be reliably derived from the present
register masks.

Signed-off-by: Amneesh Singh <amneesh@ti.com>
2026-01-08 21:18:38 +01:00
Khai Cao
2d5b720b62 drivers: can: Fix macro typo in CAN_RENESAS_RA_INIT
Fix macro parameter typo (##inst → ##index) in CAN_RENESAS_RA_INIT
to ensure unique IRQ configure function names per instance.

Signed-off-by: Khai Cao <khai.cao.xk@renesas.com>
2026-01-08 19:17:55 +01:00
Wilfried Chauveau
27fdf98638 cmake: package_helper: Remove an empty elseif
Cmake complains about this.

Signed-off-by: Wilfried Chauveau <wilfried.chauveau@arm.com>
2026-01-08 19:16:40 +01:00
Zhaoxiang Jin
732adf7865 soc: nxp: mcxn: Add OSTIMER support and refine system timer selection
Add MCUX_OS_TIMER configuration with CPU_FREQ-based default selection.
Update CORTEX_M_SYSTICK to be disabled when either LPTMR or OSTIMER
is selected as the system timer, ensuring only one timer is active.

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2026-01-08 19:16:25 +01:00
Zhaoxiang Jin
790598e642 soc: nxp: mcxn: Remove redundant code
MCUX_LPTMR_TIMER is default to n, no need to set it again.

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2026-01-08 19:16:25 +01:00
Zhaoxiang Jin
552004f3d1 boards: nxp: frdm_mcxn236: enable ostimer in dts
The MCXN236 can use ostimer as the kernel timer.
We enable it in the dts, and which specific timer
to use as the system timer can be controlled through
Kconfig option based on application requirements.

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2026-01-08 19:16:25 +01:00
Muhammad Waleed Badar
fc2b697a77 boards: xunlong: add orangepi zero initial support
Add initial board support for the Xunlong Orange Pi Zero,
single-board computer based on the Allwinner H2+/H3 SoC.

Signed-off-by: Muhammad Waleed Badar <walid.badar@gmail.com>
2026-01-08 19:16:01 +01:00
Muhammad Waleed Badar
15a90b7783 soc: allwinner: add sun8i h3 soc support
Add initial support for the Allwinner H3 SoC, commonly
found in development boards like the Orange Pi series.

This commit introduces the intial SoC support files:
 - Basic Kconfig configuration and SoC definition
 - MMU region setup for memory management
 - SoC-specific headers and device tree source include

Signed-off-by: Muhammad Waleed Badar <walid.badar@gmail.com>
2026-01-08 19:16:01 +01:00
Henrik Brix Andersen
0983eb3862 drivers: can: nxp: mcan: enable external timestamp counter support
Enable support for configuring and enabling the external timestamp counter
of the NXP LPC MCAN.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2026-01-08 19:15:29 +01:00
Henrik Brix Andersen
392e816ef0 drivers: can: mcan: add support for configuring internal timestamp counter
Add support for configuring and enabling the internal timestamp counter of
the Bosch M_CAN IP core.

Frontend drivers can overwrite this configuration for using a SoC-specific,
external timestamp counter.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2026-01-08 19:15:29 +01:00
Simon Maurer
50cfa1a5dd drivers: i2c: cdns: Clear hold flag on last data interrupt
Clear the hold flag during the final data interrupt; otherwise the
Transfer Complete interrupt is never asserted.

Signed-off-by: Simon Maurer <mail@maurer.systems>
2026-01-08 19:15:12 +01:00
Simon Maurer
39bfa1126a drivers: i2c: cdns: switch over to DEVICE_MMIO API
Switch the Cadence I2C device driver over to the use of the
DEVICE_MMIO_... macros instead of just using the physical base
address from the device tree.

Signed-off-by: Simon Maurer <mail@maurer.systems>
2026-01-08 19:15:12 +01:00
Simon Maurer
ed1520016b drivers: i2c: cdns: run clang-format
Run clang-format on drivers/i2c/i2c_cdns.c.

Signed-off-by: Simon Maurer <mail@maurer.systems>
2026-01-08 19:15:12 +01:00
Jonas Berg
9334cedb3d boards: Add support for Cytron Maker Nano RP2040
Tested with the commands in index.rst

Product photo from
https://github.com/CytronTechnologies/MAKER-NANO-RP2040/
blob/main/MAKER-NANO-RP2040-Image.PNG

Signed-off-by: Jonas Berg <jonas.s.t.berg@gmail.com>
2026-01-08 08:33:32 -05:00
Marek Slowinski
1db1e69250 mpfs_icicle: Add renode overlay to cmsis_rtos_v1.philosopher tests
Tune quantum parameter for selected kernel tests
targeting mpfs_icicle platform.

Those tests require higher fidelity of the virtual
time flow which is achievable on multi-core platforms
in Renode by reducing the quantum.

Increase time resolution to 10us (default is 100us).
It is a maximum drift of the virtual time between
simulated processors in SMP configuration.

Signed-off-by: Marek Slowinski <mslowinski@antmicro.com>
2026-01-08 08:33:23 -05:00
Marek Slowinski
710ad5c4d8 boards: mpfs_icicle: add renode simulation support
Add Renode simulation support for `mpfs_icicle`.

Signed-off-by: Marek Slowinski <mslowinski@antmicro.com>
2026-01-08 08:33:23 -05:00
Juliusz Sosinowicz
3f04069069 drivers: entropy: virtio: use bounce buffer for virtio entropy driver
The device is not able to place the entropy into stack or heap allocated
buffers. This uses a bounce buffer to be able to use any buffer with
virtio entropy.

Signed-off-by: Juliusz Sosinowicz <juliusz@wolfssl.com>
2026-01-08 08:33:05 -05:00
Daniel Leung
d334130d5d soc: intel_adsp/ace: skip building arch reset vector
This disables the kconfigs to build the reset vector and crt1
startup code from the architecture layer as ACE has its own
rom_entry() as entry point.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2026-01-08 08:32:24 -05:00
Marco Casaroli
efc344bef0 test: eventfd: add test for close while read
When an eventfd is closed, while we are blocked in a read() call, the
close() call should succeed and read should return error.

Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
2026-01-08 08:31:56 -05:00
Marco Casaroli
a78db0f8a9 posix: eventfd: ignore k_condvar_broadcast result
k_condvar_broadcast does not error. It returns the number of
woken threads on success. We should not assert any value.

Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
2026-01-08 08:31:56 -05:00
Marco Casaroli
aa607f9b0a posix: eventfd: fix deadlock with POSIX API
When eventfd is used through read(2) and write(2), the mutex is
already locked from the fdtable implementation. So we remove the
usage of the mutex from the zvfs_eventfd_*_op functions, as it is
already managed by fdtable.

However, when zvfs_eventfd_{read,write} are used, no fdtable layer
is used and we shuld call the _op function with the mutex locked
(the same behavior as with fdtable), so these functions should
manage the mutex. We add it there.

Fixes #99234

Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
2026-01-08 08:31:56 -05:00
Marco Casaroli
48ab80061b tests: eventfd: posix read interface
The eventfd API should work with the standard POSIX read/write
functions with the same behavior as the non-standard
eventfd_read/write API.

We add the tests for these interfaces.

Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
2026-01-08 08:31:56 -05:00
Luca Burelli
060dd3b486 boards: arduino: fix long startup time with WIFI enabled
The default SDHC 'power-delay-ms' is 500 ms, which is unnecessarily long
and causes the boot time to increase by over 5 seconds on H7 boards with
the Murata Wi-Fi card (GIGA R1, Nicla Vision, Portenta H7).

Shortening this delay to 50 ms greatly improves boot time while keeping
compatibility with the controller spec.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2026-01-08 12:01:08 +00:00
Hau Ho
c4c919e6cd tests: drivers: adc: Add overlay file for FPB-RX261 board
Add overlay file for FPB-RX261 board

Signed-off-by: Hau Ho <hau.ho.xc@bp.renesas.com>
2026-01-08 12:00:49 +00:00
Hau Ho
41079453fc tests: drivers: adc: Add overlay file for EK-RX261 board
Add overlay file for EK-RX261 board

Signed-off-by: Hau Ho <hau.ho.xc@bp.renesas.com>
2026-01-08 12:00:49 +00:00
Hau Ho
9f0aa01333 boards: renesas: Add ADC support for FPB-RX261 board
Add ADC support for FPB-RX261 board

Signed-off-by: Hau Ho <hau.ho.xc@bp.renesas.com>
2026-01-08 12:00:49 +00:00
Hau Ho
de115f5242 boards: renesas: Add ADC support for EK-RX261 board
Add ADC support for EK-RX261 board

Signed-off-by: Hau Ho <hau.ho.xc@bp.renesas.com>
2026-01-08 12:00:49 +00:00
Hau Ho
d2f0799246 dts: renesas: rx: Add dts property node for ADC support on RX261
Add dts property node for ADC support on RX261

Signed-off-by: Hau Ho <hau.ho.xc@bp.renesas.com>
2026-01-08 12:00:49 +00:00
Thinh Le Cong
36c5d6646d testsuite: include: zephyr: Add missing mappings for pragmas and recursion
Add missing TOOLCHAIN_WARNING_* definitions for the IAR toolchain:
- subsys/testsuite/include/zephyr/test_toolchain.h
- subsys/testsuite/include/zephyr/test_toolchain/iar.h

Signed-off-by: Thinh Le Cong <thinh.le.xr@bp.renesas.com>
2026-01-08 12:00:29 +00:00
Thinh Le Cong
15cdf90bee include: zephyr: toolchain: suppress Go004 warning for inline functions
IAR compiler may emit Error[Go004]: Could not inline function
when handling functions marked as always_inline or inline=forced,
especially in complex kernel code

Signed-off-by: Thinh Le Cong <thinh.le.xr@bp.renesas.com>
2026-01-08 12:00:29 +00:00
Thinh Le Cong
b170738d9f testsuite: include: zephyr: add stub for timestamp inline on IAR builds
Add a minimal implementation of test_asm_inline_other.h to support
non-GNUC toolchains (e.g. IAR) during kernel benchmark tests

Signed-off-by: Thinh Le Cong <thinh.le.xr@bp.renesas.com>
2026-01-08 12:00:29 +00:00
Thinh Le Cong
b90df06299 cmake: compiler: iar: skip GCC-specific lib detection
Avoid calling flag print-liggcc-file-name when using IAR

Signed-off-by: Thinh Le Cong <thinh.le.xr@bp.renesas.com>
2026-01-08 12:00:29 +00:00
Thinh Le Cong
ffc8575e8a debug: fix IAR build due to alias type mismatch in thread_info.c
Fix IAR compiler error Pe1153 caused by mismatched alias type between
_kernel_openocd_offsets and _kernel_thread_info_offsets.

The alias now uses [] to match the array type. No functional change.

Signed-off-by: Thinh Le Cong <thinh.le.xr@bp.renesas.com>
2026-01-08 12:00:29 +00:00
Fabrice DJIATSA
955f376078 drivers: flash: stm32 ospi: use OPI erase opcode in correct mode
The commit c42c8a4da4 (do not invalidate bet at end of loop")
correctly restored the best erase type (bet) selection logic
based on SFDP/JESD216 erase types.
However, this caused a regression
in Octal OPI mode: when bet != NULL, the driver started using bet->cmd
(a standard SPI 1-byte opcode) directly, which is not valid in OPI mode
where the controller expects OPI opcodes (2-byte OCMD).

When bet != NULL:
- In OPI mode, ignore bet->cmd and use the OPI sector erase
opcode SPI_NOR_OCMD_SE.
- In SPI/QPI modes, keep using bet->cmd as intended.

Signed-off-by: Fabrice DJIATSA <fabrice.djiatsa-ext@st.com>
2026-01-08 11:59:49 +00:00
Nikhil Namjoshi
9151a32713 net: http: server: Enable HTTP1.0 request compatibility
Per RFC9112 (REF #1), HTTP/1.1 server is expected to be backward
compatible with HTTP1.0 request. Mainly HTTP/1.0 does
not support
1) Transfer Encoding : chunked
2) KeepAlives

So, this change will identify the HTTP protocol
version in the request and respond accordingly.

REF#
1) https://httpwg.org/specs/rfc9112.html

Tested:
1) Verified that HTTP/1.1 requests are served as usual
i.e. with chunked transfer encoding and the connection
is a Keep Alive connection

Query exits after 10s, indicating that the client connection to
the HTTP server is a Keep Alive.

```
time printf "GET /telem HTTP/1.1\r\nHost: 192.0.3.11\r\n\r\n" |
    nc 192.0.3.11 80

real    0m10.185s  <- Indicates connection was kept active for 10s
user    0m0.023s
sys     0m0.023s
```

`Transfer Encoding :  chunked` header and chunked encoding
metadata (chunk size hex bytes, crlf, termination byte 0)
are present in the response.

```
HTTP/1.1 200 OK
Transfer-Encoding: chunked <- Chunked encoding header
Content-Type: text/html

3e8 <- Chunk size hex bytes

:
/health/secondsdevice_ae:9a:22:48:0f:70"seconds0
+
/health/locatedevice_ae:9a:22:48:0f:70"0
/
/network/mac-addressdevice_ae:9a:22:48:0f:70"
.
.
.

3e8 <- Chunk size hex byte
_PLUS_rawdevice_ae:9a:22:48:0f:70"0
6
/dev/ISHARE_CBU_MINUS_rawdevice_ae:9a:22:48:0f:70"0
.
.
.
/dev/part_iddevice_ae:9a:22:48:0f:70"0���������
,
/dev/part_typedevice_ae:9a:22:48:0f:70"0
7
/dev/part_telemetry_disabledevice_ae:9a:22:48:0f:70"0
0 <- Termination Byte 0
```

2) Verfied that HTTP/1.0 requests are served with
response without chunked transfer encoding and the
connection is closed immediately.

Query exits immediately indicating the connection is closed immediately

```
time printf "GET /telem HTTP/1.0\r\nHost: 192.0.3.11\r\n\r\n" |
    nc 192.0.3.11 80

real    0m0.186s <- Indicates connection was terminated immediately.
user    0m0.018s
sys     0m0.030s

```

`Transfer Encoding : chunked` header and chunked encoding
metadata (chunk size hex bytes, crlf) not present in the
response

```
HTTP/1.1 200 OK
Content-Type: text/html

:
/health/uptimedevice_ae:9a:22:48:0f:70"seconds0
+
/health/locatedevice_ae:9a:22:48:0f:70"0
/
/network/mac-addressdevice_ae:9a:22:48:0f:70"
.
.
.
3

/dev/part_iddevice_ae:9a:22:48:0f:70"0���������
,
/dev/part_typedevice_ae:9a:22:48:0f:70"0
7
/dev/can_telemetry_disabledevice_ae:9a:22:48:0f:70"0
```

Signed-off-by: Nikhil Namjoshi <nikhilnamjoshi@google.com>
2026-01-08 11:59:43 +00:00
Jonas Berg
26b56d71ba boards: Add support for Adafruit Feather RP2040 Scorpio
Tested with the commands mentioned in index.rst

Product photo from https://learn.adafruit.com/assets/117239
with the license CC BY-SA 3.0

Signed-off-by: Jonas Berg <jonas.s.t.berg@gmail.com>
2026-01-08 11:59:33 +00:00
Aleksandr Khromykh
fccf76a857 bluetooth: mesh: add mesh api prefix to app key structure
Commit adds `bt_mesh_` prefix to `struct app_key`
to make it compatible with other internal API.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2026-01-08 11:58:09 +00:00
Aleksandr Khromykh
58667568ed bluetooth: mesh: move key primitives from mesh to keys header
Commit moves enumeration and definition related to keys
from mesh.h to keys.h

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2026-01-08 11:58:09 +00:00
Aleksandr Khromykh
ceec1fd047 doc: release-notes-4.4: add option for mesh key sync
Commit adds option description to keep keys in sync
between mesh core and cdb implementations.
Option changes default behavior so it should be added to
the release notes.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2026-01-08 11:58:09 +00:00
Aleksandr Khromykh
e6bb053efe samples: bluetooth: mesh: disable key sync for mesh provisioner
Commit disables key synchronization for mesh provisioner sample
to not refactor it according to key synchronization implementation.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2026-01-08 11:58:09 +00:00
Aleksandr Khromykh
9e7d75a59d tests: bluetooth: mesh: bsim tests to check key sync between core and cdb
Commit adds bsim tests those check key synchronization
between core implementation and cdb. Tests check both
network and application key synchronization.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2026-01-08 11:58:09 +00:00
Aleksandr Khromykh
0e2f88f31c tests: bluetooth: mesh: optimize persistent tests
bsim persistent test does not require cdb subnetwork update
for not primary network keys anymore.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2026-01-08 11:58:09 +00:00
Aleksandr Khromykh
afdf571b3b bluetooth: mesh: improve cdb debug logging
Commit improves cdb debug logging adding settings path
for subnetwork and removing unnecessary words.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2026-01-08 11:58:09 +00:00
Aleksandr Khromykh
1d50cd111d bluetooth: mesh: add key sync between core and cdb
Commit adds functionality that synchronizes network and
application keys between mesh core and cdb.
Additionally, subnetwork bridge bsim tests were fixed since
cdb cannot allocate subnetwork if it exists.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2026-01-08 11:58:09 +00:00
Aleksandr Khromykh
19bc2214f3 bluetooth: mesh: refactore app key event
Event about application key changes has been refactored.
Event provides access to the corresponding applicarion key
structure instead just key indexes.
The related code has been moved from mesh.h to app_keys.h.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2026-01-08 11:58:09 +00:00