Commit graph

17,121 commits

Author SHA1 Message Date
Michael Zimmermann
f07f0d288e net: mqtt_sn: Implement updating will topic and message
Since the protocol doesn't have message IDs in the responses to these
update messages, there's no reliable way to know, if an update succeeded or
not. I use that fact to simplify the implementation by:
- Not providing success/failure callbacks.
- Not handling updating the variables in the client struct while
  an update is in progess.

In addition to adding some tests, I tested this with the emqx server.

Signed-off-by: Michael Zimmermann <michael.zimmermann@sevenlab.de>
2025-10-02 09:31:53 +02:00
Alain Volmat
c2da6dea40 include: zephyr: dt-bindings: clock: h7: add MCO SEL/PRE macros
Add macros in order to select the MCO input clock and prescaler
value.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2025-10-02 09:31:36 +02:00
Alain Volmat
6b13cc8666 include: zephyr: dt-bindings: clock: l4: add MCO SEL/PRE macros
Add macros in order to select the MCO input clock and prescaler
value.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2025-10-02 09:31:36 +02:00
Jeppe Odgaard
f8a952f2fe include: drivers: sensor: add flow rate channel
Add flow rate to `enum sensor_channel` in litres per minute.

The SI unit for flow rate is cubic metres per second. Due to a sensor value
resolution of 1/100000 this unit is not granular enough for low flow rate
sensors.

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
2025-10-01 17:14:28 -04:00
Seppo Takalo
0025751414 modem: cmux: Rework the drop handling
Do not read extra byte when we decide to drop a frame.
Instead go directly to MODEM_CMUX_RECEIVE_STATE_SOF, so the next
flag character will start a new frame.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2025-10-01 17:12:50 -04:00
Johan Hedberg
0dfef14890 include: drivers: spi.h: Fix deprecation support for SPI_DT_IODEV_DEFINE
Commit a60f93d742 removed the delay parameter
from various SPI macros, but aimed to retain a clean migration path by
throwing a deprecation warning when the parameter is still passed. However,
the commit failed to have this feature included in the SPI_DT_IODEV_DEFINE
macro. This commit should fix the issue.

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2025-10-01 17:20:41 +03:00
Declan Snyder
1154c96459 include: drivers: spi.h: Get params from DT
- Get bit ordering from DT property in SPI_CONFIG_DT.
  More precisely, set LSB first if set in DT.

- Get CS polarity from DT property in SPI_CONFIG_DT.

- Add inter-word delay parameter to spi_config struct. If value is 0, the
  value will be half of the period.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-10-01 14:39:36 +03:00
Declan Snyder
a60f93d742 include: drivers: spi.h: Get CS delay parameters from DT
The CS delay parameter did not make a distinction between the setup and
hold time of the CS, and also did not specify very fine control which
can be done usually by a native controller CS. So use the new nanosecond
DT properties to get the delay values and make distinction.

Add deprecation warning if consumer supplies the delay parameter and
make it still work the old way in that case for backward compatibility
following API lifecycle process.

Update driver API version to 1.1.0 due to this change

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-10-01 14:39:36 +03:00
Andrzej Głąbek
ca79733388 drivers: pinctrl_nrf: Add support for SPIM CSN pin function
Certain SPIM instances in nRF52/53/54L/54H Series provide hardware
control of the CSN (chip select) line. Although the standard SPI
drivers do not use this feature, it should be possible to configure
this line through pinctrl in case some special driver needs this.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2025-10-01 14:37:46 +03:00
Chris Friedt
5cbb2a421d posix: switch to using posix_time.h and posix_signal.h
To avoid conflicts between the C library's `time.h` and signal.h use an
"override" header (when necessary) for C libraries that do not themselves
provide POSIX definitions in `time.h` or `signal.h`.

V2

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2025-10-01 14:36:55 +03:00
Chris Friedt
2feea755b3 posix: headers: create a more conformant posix_signal.h
Create a header for satisfying POSIX conformance requirements of signal.h
that is named posix_signal.h rather than signal.h.

The primary reason for doing so, is that the de-facto owner of signal.h is
the C library.

This new header only defines required POSIX symbols that form a strict
superset over the ISO C signal.h symbols.

V2

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2025-10-01 14:36:55 +03:00
Chris Friedt
5db2b58a21 posix: headers: create a more conformant posix_time.h
Create a header for satisfying POSIX conformance requirements of time.h
that is named posix_time.h rather than time.h.

The primary reason for doing so, is that the de-facto owner of time.h is
the C library.

This new header only defines required POSIX symbols that form a strict
superset over the ISO C time.h symbols.

V2

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2025-10-01 14:36:55 +03:00
Philipp Finke
5d05c4bcc6 sys: timeutil: Replaced pointer to rvalues
Replaced all pointer to rvalues used for the second parameter in calls of
timespec_compare() within function timespec_to_timeout(). This might be
legal syntax in C, but leads to compile errors when timeutil.h is included
and compiled in a C++ compilation unit.

Signed-off-by: Philipp Finke <philipp.finke@sick.de>
2025-10-01 14:36:00 +03:00
TaiJu Wu
61bc4451f6 kernel: essential work queue should not stop
consider follow case
```
ZTEST(workqueue_api, test_k_work_queue_stop_sys_thread)
{
	size_t i;
	struct k_work work;
	struct k_work_q work_q = {0};
	struct k_work works[NUM_TEST_ITEMS];
	struct k_work_queue_config cfg = {
		.name = "test_work_q",
		.no_yield = true,
		.essential = true,
	};

	k_work_queue_start(&work_q, work_q_stack,
			   K_THREAD_STACK_SIZEOF(work_q_stack),
			   K_PRIO_PREEMPT(4), &cfg);

	zassert_true(k_work_queue_drain(&work_q, true) >= 0,
	    "Failed to drain & plug work queue");
	zassert_not_ok(k_work_queue_stop(&work_q, K_FOREVER),
	    "Failed to stop work queue");
}
```

If we allow stop essential work queue, system will panic.

Signed-off-by: TaiJu Wu <tjwu1217@gmail.com>
2025-10-01 08:21:56 +02:00
Emil Gydesen
7d8315574f Bluetooth: Host: Add note about recycled for BT_LE_ADV_OPT_CONN
When a connectable advertising set is stopped, the
preallocated connection object is free by calling
bt_conn_unref which triggers a call to the recycled
callback.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-10-01 08:20:54 +02:00
TOKITA Hiroshi
9bdad1f871 drivers: xen: memory: add acquire_resource wrapper
Add XENMEM_acquire_resource wrapper to map device model related buffers.
This is required for communication with the ioreq server.

- memory
  - xendom_acquire_resource:
    HYPERVISOR_memory_op(XENMEM_acquire_resource)

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2025-10-01 08:15:36 +02:00
TOKITA Hiroshi
14ac666156 drivers: xen: change gnttab_[get|put]_pages for multi-page support
Replace `gnttab_get_page()`/`gnttab_put_pabes(addr)` with
`gnttab_get_pages(npages)`/`gnttab_put_pages(addr, npages)`
for supporting multi-page operation.

Note: This is a breaking change, update callers accordingly.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2025-10-01 08:14:47 +02:00
Peter Mitsis
972b54c676 kernel: doc: Update thread deadline APIs
Minor updates to both the k_thread_deadline_set() and
k_thread_absolute_deadline_set() API documentation.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2025-09-30 21:58:51 +02:00
Jilay Pandya
cf3dddf573 drivers: stepper: step_dir: fix 87698
During testing with teensy 4.0 it was discoverd that toggling
at high frequencies led to missed steps. As per the datasheets
of step-dir drivers an active edge needs to be maintained for
a certain timerperiod, for a step to be executed.

Instead of toggling pin twice instantaneously, the current fix
halves the step period and the step-pin is toggled on the timeout
of the respective timing source.

rework stepper stepper stop

set step pin to low if the driver does not support dual edge
and increment/decrement the actual position by one

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
2025-09-30 17:58:27 +03:00
Maximilian Werner
a88b1b86cb include: drivers: gpio_emul: add gpio_dt_spec helpers
Add gpio_dt_spec based helpers for easier access to:
* gpio_emul_input_set
* gpio_emul_output_get
* gpio_emul_flags_get

Signed-off-by: Maximilian Werner <maximilian.werner96@gmail.com>
2025-09-30 15:29:47 +03:00
Armando Visconti
b390cbd6b2 drivers/sensor: iis3dwb: add streaming capabality
Add read_and_decode streaming APIs support.

Triggers supported:
    - SENSOR_TRIG_FIFO_WATERMARK
    - SENSOR_TRIG_FIFO_FULL
    - SENSOR_TRIG_DATA_READY

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2025-09-30 11:01:12 +02:00
Armando Visconti
93a30e7806 drivers/sensor/st: add support to IIS3DWB accel
The IIS3DWB is a system-in-package featuring a 3-axis digital vibration
sensor with low noise over an ultrawide and flat frequency range.
The wide bandwidth, low noise, very stable and repeatable sensitivity,
together with the capability of operating over an extended temperature
range (up to +105 C), make the device particularly suitable for vibration
monitoring in industrial applications.

Datasheet: https://www.st.com/en/mems-and-sensors/iis3dwb.html

This driver is currently only supporting the polling-mode read_and_decode
APIs (both blocking and non-blocking).

This driver is based on stmemsc HAL i/f v2.9.1.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2025-09-30 11:01:12 +02:00
Alexander Apostolu
1f50947271 include: zephyr: drivers: sensor.h: update decode doxygen
Update sensor_decoder_api.decode Doxygen to reflect changes in the
parameters, including the change from the channel parameter to
channel spec.

Signed-off-by: Alexander Apostolu <apostolu240@gmail.com>
2025-09-30 10:59:47 +02:00
Alexander Apostolu
35c45a66e8 include: zephyr: drivers: sensor.h: corrected name of chan_spec parameter
Change name of the struct sensor_chan_spec paramater from "channel" to
"chan_spec" to reflect its type.

Signed-off-by: Alexander Apostolu <apostolu240@gmail.com>
2025-09-30 10:59:47 +02:00
Seppo Takalo
b8541c53ee modem: modem_cellular: Allow PPP interface to wake up the device
Allow PPP device to wake up the underlying cellular modem.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2025-09-29 12:47:57 -04:00
Michael Zimmermann
0e2e3c2ece net: mqtt_sn: implement predefined topics
Making the assumption, that mqtt_sn_connect does not process any incoming
data allows for this to be a very simple, additional API function instead
of adding more complexity to the connect function. This also means that the
user has to re-add predefined topics upon reconnects which don't reuse the
old session though.

Signed-off-by: Michael Zimmermann <michael.zimmermann@sevenlab.de>
2025-09-29 12:45:15 -04:00
Daniel Leung
cf7e2e63c1 soc: intel_adsp: rework host IPC using IPC service
This reworks the Intel audio DSP host IPC driver as a backend of
the IPC service. This is the first step to rework IPC in SOF
(Sound Open Firmware) into using a more generic IPC API instead
of a SoC specific one.

For now, it keeps the old interface to maintain usability
as it is going to be a multiple process to rework IPC
over there.

Also, the structure of the new IPC backend resembles
the SoC specific driver to make it easier to compare
between them at this first iteration. Future optimizations
will probably be needed once we start modifying the SOF
side to utilize the IPC interface.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2025-09-29 12:42:00 -04:00
Lee Trager
e876dee6f2 arch: riscv: Move reg_read()/reg_write() into userspace test
Various drivers have their own static versions of reg_read()/reg_write().
When building for riscv the macros conflict with the driver function
causing compiler failures. Prefix them with riscv_ to avoid conflict
and move them into the unit test which is the only place they are
used.

Signed-off-by: Lee Trager <lee@trager.us>
2025-09-29 12:41:30 -04:00
Gerard Marull-Paretas
4b4dcbbf4a drivers: dma: sf32lb: add initial driver
Add an initial driver for SiFli SF32LB DMAC DMA controller.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2025-09-29 12:40:15 -04:00
Gerard Marull-Paretas
5bb6741c67 dts: bindings: dma: add sifli,sf32lb-dmac
Add binding for SiFli SF32LB DMAC DMA controller. Also add defines for
configuring `dmas` cells (requests and config fields).

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2025-09-29 12:40:15 -04:00
Håvard Reierstad
ff17e601d0 Bluetooth: Host: Add userdefined fixed l2cap chans
Adds support for the user defining their own channels within the
fixed L2CAP channel range. To make this possible, the
`bt_l2cap_fixed_chan` struct and `BT_L2CAP_CHANNEL_DEFINE` macro
needed to converted to public API. In the process of doing so, the
`_destroy` parameter was removed from the `BT_L2CAP_CHANNEL_DEFINE`
macro as it was never used (fixed channels will not be destroyed over
the lifetime of the connection). `BT_L2CAP_CHANNEL_DEFINE` is renamed
`BT_L2CAP_FIXED_CHANNEL_DEFINE` to avoid confusion

The `bt_l2cap_chan_send` function is updated to be able to send data
on fixed l2cap channels.

Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
2025-09-29 12:38:19 -04:00
Tim Pambor
6633ed5782 logging: Disable used but marked unused warning
Clang's -Wused-but-marked-unused warns when variables marked as
__unused are actually used. Logging macros can trigger this warning
depending on CONFIG_LOG_* settings, leading to noisy builds.

This change suppresses those warnings, allowing the warning flag to
be used alongside logging functionality.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2025-09-29 12:36:15 -04:00
Emil Gydesen
55a72f6103 Bluetooth: CAP: Implement broadcast to unicast handover
Implement the broadcast to unicast handover procedure,
as per the Bluetooth CAP specificiation.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-09-29 12:36:00 -04:00
TOKITA Hiroshi
c6608fcd80 drivers: virtio: Separate macros into a common header
Move macros derived from the VIRTIO specification to a shared include.
This change allows the VIRTIO standard definitions to be referenced
from outside the driver implementation.

The following definitions have also been added:

- VIRTIO_F_VERSION_1
- VIRTIO_F_ACCESS_PLATFORM
- VIRTIO_RING_F_INDIRECT_DESC
- VIRTIO_RING_F_EVENT_IDX
- VIRTQ_AVAIL_F_NO_INTERRUPT
- VIRTQ_USED_F_NO_NOTIFY

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2025-09-26 20:45:00 -04:00
Benjamin Cabé
676673fec2 include: drivers: opamp: doxygen fixups
minor fixes to align docs with other drivers

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-09-26 16:01:54 -04:00
Shreehari HK
7735be8c75 include: zephyr: drivers: i3c: add open-drain timing configuration
This commit adds the I3C handling of open-drain
timing configurations with the following changes:
- Add scl_od_min structure to i3c_config_controller for
  high/low period settings
- Define Open-drain mixed bus SCL timing constants

Requirement (MIPI Specification for I3C Basic v1.2 (16-Dec-2024),
             Section 4.3.11.2 & Table 49):
- The MIPI I3C specification mandates different open-drain speeds during
  bus initialization as defined in
  "I3C Basic Open Drain Timing Parameters".
- The first broadcast address (7'h7E+W) must be transmitted at a slower
  open-drain speed to ensure visibility to all devices on the I3C bus,
  including legacy I2C devices. This slow speed (minimum 200ns Thigh)
  allows I2C devices to properly detect the I3C mode transition and
  disable their spike filters before switching to I3C mode. After the
  initial broadcast, normal I3C open-drain speeds can be used for
  regular operation.

Signed-off-by: Shreehari HK <shreehari.hk@alifsemi.com>
2025-09-26 16:00:42 -04:00
Chris Friedt
584b73a8d4 timeutil: make timespec_normalize() a regular function
Since the timespec_normalize() function is not branchless, and since it
can also generate a fair bit of code, make the function non-inline and
place it in timeutil.c instead.

This should save some code space on most systems.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2025-09-26 09:35:33 -04:00
Chris Friedt
d02235cad3 timeutil: timespec: mitigate warnings when -Wtype-limits is used
Previously, warnings could be promoted to errors in timeutil.h. Those
warnings were of the form below.

warning: comparison is always true due to limited range of data type
warning: comparison is always false due to limited range of data type

Specifically, in the speed-optimized version of timespec_normalize() and
in the macro SYS_TICKS_TO_NSECS().

The speed-optimized version of timespec_normalize(), which used the
__builtin_add_overflow() function, was mainly intended to be branchless.
However, many targets generate branching instructions regardless.

The speed optimized version is less valuable in that case, so remove it.

Additionally, SYS_TICKS_TO_NSECS() does not generate the above warnings
when k_ticks_to_ns_floor64() is used instead of k_ticks_to_ns_floor32(),
so use the former.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2025-09-26 09:35:33 -04:00
Mark Wang
e82a9951e8 bluetooth: a2dp: fix spelling error of STEREO
change A2DP_SBC_CH_MODE_STREO as A2DP_SBC_CH_MODE_STEREO

Signed-off-by: Mark Wang <yichang.wang@nxp.com>
2025-09-26 06:40:29 +02:00
Declan Snyder
a4225b1ee8 pm: Add constraint lists and APIs
Some pieces of the system may have custom types of constraints that they
define based on different effects and reasons than just the standard
"zephyr,disabling-states". To avoid every single one of these component
reinventing the wheel, make some common APIs to handle these type of
custom constraint lists.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-09-25 14:18:05 -04:00
Declan Snyder
ae1f13149f pm: Extend pm notifier to be able to report substate
I am surprised this notifier didn't already report the substate id, it
seems important since different substate obviously are defined for a
reason, they can be having a different effect on the system.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-09-25 14:18:05 -04:00
Lucien Zhao
c503850cd4 boards: nxp: rt1180: migrate mpu setting under board folder
- add NXP_BOARD_SPECIFIC_MPU_SETTINGS kconfig to provide a switch
  for developer if they want to use private mpu settings
    CONFIG_NXP_BOARD_SPECIFIC_MPU_SETTINGS==1  | NXP default setting
    CONFIG_NXP_BOARD_SPECIFIC_MPU_SETTINGS==0  | User specific

- Use DT function to get memory base address and region size for cm7

- CM33 use dts to set mpu settings

- Add REGION_CUSTOMED_MEMORY_SIZE macro provide a common mapping ways
  to map actual memory_size_kb to "region_size"

-  The settings of the unified memory on cm33/cm7 cores:
    ocram1/flexspi2 -> REGION_RAM_NOCACHE_ATTR
    ocram2/dtcm -> REGION_RAM_NOCACHE_ATTR
    flexspi/itcm -> REGION_FLASH_ATTR

Signed-off-by: Lucien Zhao <lucien.zhao@nxp.com>
2025-09-25 14:17:57 -04:00
Grzegorz Swiderski
620bf58a1e zms: Initial support for 64 bit IDs
Allow the ZMS API to optionally accept 64 bit IDs. A typedef `zms_id_t`
is added, so that the maximum ID width can be controlled using Kconfig.

The current ATE structure is already large enough that it is possible to
reserve 64 bits for IDs without increasing its total size (128 bits).
This makes the feature a natural, low footprint alternative to Settings,
for cases where the supported key namespace must be larger than 32 bit
but not arbitrarily large.

The ATE format does have to be altered to accommodate larger IDs, but
the default "32 bit" format is left as is. Now, the `struct zms_ate`
describes one of two supported formats, selected by an `#if` condition.
In the future, it may be possible to support multiple ATE formats at
runtime, in which case the structure can be turned into a union.

In the new, "64 bit" ATEs, the `offset` and `metadata` fields are moved
into a union, because they are found to be mutually exclusive. With the
old format, the same fields are in different locations, but one of them
always gets filled with a dummy value, depending on the given ATE type.
To cover both cases, a `memset` is used, which should be optimized away
by the compiler when appropriate.

The only limitation is that the new ATE format has no room for data CRC,
but an alternative integrity check can be implemented by the caller.

Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2025-09-25 14:17:24 -04:00
Fabio Baltieri
fc5ded27cc Revert "posix: headers: create a more conformant posix_time.h"
This reverts commit 63abc20f12.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2025-09-25 14:15:57 -04:00
Fabio Baltieri
f8d2b5e219 Revert "posix: headers: create a more conformant posix_signal.h"
This reverts commit 5287699796.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2025-09-25 14:15:57 -04:00
Fabio Baltieri
9384cc5b96 Revert "posix: switch to using posix_time.h and posix_signal.h"
This reverts commit 1eb5c97bd6.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2025-09-25 14:15:57 -04:00
Chris Friedt
1eb5c97bd6 posix: switch to using posix_time.h and posix_signal.h
To avoid conflicts between the C library's `time.h` and signal.h use an
"override" header (when necessary) for C libraries that do not themselves
provide POSIX definitions in `time.h` or `signal.h`.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2025-09-25 12:01:23 +01:00
Chris Friedt
5287699796 posix: headers: create a more conformant posix_signal.h
Create a header for satisfying POSIX conformance requirements of signal.h
that is named posix_signal.h rather than signal.h.

The primary reason for doing so, is that the de-facto owner of signal.h is
the C library.

This new header only defines required POSIX symbols that form a strict
superset over the ISO C signal.h symbols.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2025-09-25 12:01:23 +01:00
Chris Friedt
63abc20f12 posix: headers: create a more conformant posix_time.h
Create a header for satisfying POSIX conformance requirements of time.h
that is named posix_time.h rather than time.h.

The primary reason for doing so, is that the de-facto owner of time.h is
the C library.

This new header only defines required POSIX symbols that form a strict
superset over the ISO C time.h symbols.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2025-09-25 12:01:23 +01:00
Khoa Tran
92fbcbe10b drivers: clock_control: Add support for RA8T2
Add additional clocks to support for RA8T2.

Signed-off-by: Khoa Tran <khoa.tran.yj@bp.renesas.com>
2025-09-25 11:02:54 +02:00