Commit graph

15409 commits

Author SHA1 Message Date
Camille BAUD
c3aa94fdcf drivers: display: Introduce Greyscale pixel format
This introduces greyscale Luminance 8 pixel format

Signed-off-by: Camille BAUD <mail@massdriver.space>
2025-03-12 14:05:14 +00:00
cyliang tw
47dfd857f9 soc: nuvoton: numaker: add support for m55m1x series
Add initial support for nuvoton numaker m55m1x SoC series
including basic init and device tree source include.

Signed-off-by: cyliang tw <cyliang@nuvoton.com>
2025-03-12 14:04:23 +00:00
Krzysztof Chruściński
4cbafc6bd4 tracing: Add sys_trace_idle_exit call
Add new tracing API which is called when core is exiting from idle.
Current implementation is using it to track CPU load. Implementation
in tracing_none is now weak so it can be used if given backend does
not support new API call.

When CONFIG_CPU_LOAD is enabled then sys_trace_idle also calls a
hook which stores the timing information when CPU entered idle.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2025-03-12 14:03:48 +00:00
Krzysztof Chruściński
c7d7aac2bd debug: Add cpu_load module
Add module which can measure CPU idle time. Idle time is measured in
the pre/post CPU idle hooks but they are not provided by this module.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2025-03-12 14:03:48 +00:00
Cla Mattia Galliard
294a26b2d1 net: mgmt: fix compiler warnings for static inline shims
Add ARG_UNUSED(x) for static inline shims inside net_mgmt.h. This avoids
compiler warnings for "unused variables".

Signed-off-by: Cla Mattia Galliard <cla-mattia.galliard@zuehlke.com>
2025-03-12 07:14:58 +01:00
Andrew Davis
d2d43b9d97 drivers: mm: rat: Move internal struct and definitions into source file
These struct and definitions are only used internally by this driver,
move them out of the public interface header and into the driver source.

Signed-off-by: Andrew Davis <afd@ti.com>
2025-03-12 07:13:22 +01:00
Andrew Davis
693172becd drivers: mm: rat: Pass region_config as a struct not void pointer
The struct address_trans_region_config is already defined, no reason
to pass this in as a void pointer then cast it later. Pass it in
as a struct pointer.

Signed-off-by: Andrew Davis <afd@ti.com>
2025-03-12 07:13:22 +01:00
Alberto Escolar Piedras
4ef35ed324 include/zephyr/linker/common-rom: Clarify commentary
Clarify the commentary about how the constructor initialization
is setup and why.
(The current text refers to native_posix, which does not
exist anymore).

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-03-12 02:27:36 +01:00
Alberto Escolar Piedras
d881e794ba drivers console: Deprecate native_posix_console.h
Deprecate this header which provides API compatibility since
the header was renamed in 2023, but was never deprecated.
Planned for removal in v4.4.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-03-12 02:27:36 +01:00
Yangbo Lu
b4f2553cd8 arch: arm: irq: allow custom irq control for multi-level interrupts
Custom irq control for multi-level interrupts should be allowed.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2025-03-11 18:54:40 +01:00
Henrik Brix Andersen
110cd6b806 kernel: fix compilation with CONFIG_TIMER_READS_ITS_FREQUENCY_AT_RUNTIME
Fix compilation with CONFIG_TIMER_READS_ITS_FREQUENCY_AT_RUNTIME=y and
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC unset at the board/SoC level.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2025-03-11 18:53:40 +01:00
Olivier Lesage
6f33793b41 bluetooth: Host: Rename CS tone antenna configurations
Improves readability by removing the need to check the table
to figure out how many antennas devices A and B are using.

Signed-off-by: Olivier Lesage <olivier.lesage@nordicsemi.no>
2025-03-11 08:59:19 +01:00
Nicolas Pitre
c7467f0c65 ring_buffer: constify some arguments
Functions that don't modify content should have pointers to it marked
const.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2025-03-11 08:59:05 +01:00
Nicolas Pitre
e1eead3925 ring_buffer: shrink size of struct ring_buf
Make struct ring_buf 12 bytes smaller by default. This comes with a 32KB
buffer size limit which covers almost all cases. The previous limit of
2GB can be restored with CONFIG_RING_BUFFER_LARGE=y.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2025-03-11 08:59:05 +01:00
Emil Gydesen
9d4cc4b49b Bluetooth: BAP: Add a set of suggested intervals to use with BAP
Add a selection of interval values that are suitable for BAP,
which will allow better coexistence between ISO and ACL,
for both broadcast and unicast. Some of these are defined
by the BAP spec, and some are defined by Zephyr, since they
do have a suggested value from BAP.

Samples and tests have been updated to use these new values.
Peripheral samples have also been updated with
CONFIG_BT_GAP_AUTO_UPDATE_CONN_PARAMS so that the connection
parameters from the centrals aren't updated to something else
shortly after.

The shell has also been updated to use the LE Audio (BAP) values
if audio is enabled, and the audio.conf file has disabled automatic
updating of the connection parameters as the peripheral, as we rarely
(if ever) want to do that.

Due to the connection interval change, CI hit an issue
with test_bass_broadcast_code in test_main_client_sync, where
the reading of the long receive state did not finish before we
attempted to do another procedure, so the function was updated to have
a retry.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-03-11 08:58:51 +01:00
Luis Ubieda
05e8a65ba0 sensor: icm45686: Add low-pass filter configuration options
Both for Gyro and Accelerometer.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2025-03-11 05:37:06 +01:00
Luis Ubieda
25793fe33c sensor: icm45686: Add basic sensor functionality
- Add support for Fetch/Get API.
- Add support for Read/Decode API.
- Add config settings through device-tree.
- Add bus support for SPI (although easily extensible to others as
based on RTIO).

Fetch/Get API tested with accel_polling sample.
Read/Decode API tested with sensor_shell sample.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2025-03-11 05:37:06 +01:00
Helmut Lord
f31b4a67be lib: utils: add consistent overhead byte stuffing
Implementation uses netbufs.

Signed-off-by: Helmut Lord <kellyhlord@gmail.com>
2025-03-11 05:36:49 +01:00
Gerard Marull-Paretas
627e83c47d device: add DEVICE[_DT[_INST]_DEINIT_DEFINE
Add a new set of macros to define devices with de-init capabilities.
This allows to move gradually to de-init without introducing breaking
changes.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2025-03-10 21:32:40 +01:00
Gerard Marull-Paretas
0d4b957b11 device: allow initializing any device
Remove restrictions from device_init by allowing to perform device
initialization if the device state flags it being not initialized.
This makes the API usable in contexts where device_deinit has been
called before.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2025-03-10 21:32:40 +01:00
Gerard Marull-Paretas
8e59d4cd9d device: add new device_deinit API
Add a new API to de-initialize a device. When a device is
de-initialized, it will release any resources it has acquired
(e.g. pins, memory, clocks, DMA channels, etc.) and its status
will be left as in its reset state.

It is the responsability of the caller to ensure that the device is
ready to be de-initialized.

For now, deinit call always initializes to NULL. New macros will be
introduced to not break existing device APIs.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2025-03-10 21:32:40 +01:00
Gerard Marull-Paretas
766bfe7b2e device: introduce struct device_ops
Instead of passing a single init function, create
struct device_ops with the init function inside. This allows to easily
extend device's capabilities in the future without too much breakage,
e.g. to add a de-init call.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2025-03-10 21:32:40 +01:00
Gerard Marull-Paretas
f44a30109c device: introduce device flags
Introduce a new field to store device flags. Only device deferred init
flag has been added, replacing usage of linker hackery to know wether a
device requires initialization at boot time or not. This change will be
helpful in the near future as devices will become reference counted, so we
will need to know wether they have been initialized or not.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2025-03-10 21:32:40 +01:00
Gerard Marull-Paretas
3f6add69da init: drop device union from struct init_entry
Such union is rather redundant, considering a simple const cast can be
done when initializing the init entry. Note that the init_entry does not
need to be touched now that struct device stores the init call. It is
merely an init entry sorted by linker scripts, so we can intertwine
devices and SYS_INIT.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2025-03-10 21:32:40 +01:00
Gerard Marull-Paretas
ed3377ae78 init: drop init_fn union
Device init function is no longer taken from `struct init_entry`, so
there's no need to keep such union.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2025-03-10 21:32:40 +01:00
Gerard Marull-Paretas
a0a907c90e device: store init function in struct device
Preparation work for device init/de-init functionality.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2025-03-10 21:32:40 +01:00
Gerard Marull-Paretas
9b5083bb89 init: drop anonymous union
It just complicates things. It is not C99 strandard, and since C11 is
not mandatory, it is better to play safe here.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2025-03-10 21:32:40 +01:00
Paul Wedeck
1cfec8c19a drivers: dma_wch: add support for the WCH DMA controller
This patch adds an initial driver for the WCH DMA
controller. All hardware features and most interface
features are implemented.

Signed-off-by: Paul Wedeck <paulwedeck@gmail.com>
2025-03-10 21:32:27 +01:00
Cla Mattia Galliard
875d11af29 net: hostname: Fix compiler warning unused argument
For the `static inline` replacement of the `hostname_set`-function add
`ARG_UNUSED`-macros, such that the compiler does not warn about the unused
arguments.

Signed-off-by: Cla Mattia Galliard <cla-mattia.galliard@zuehlke.com>
2025-03-10 15:19:59 +01:00
Manu Sutela
6c02e809c6 drivers: haptics: Fix drv2605 C++ compatibility
Add `extern "C"` guard around the function declarations in drv2605.h.
Without this guard, compiling code with a C++ compiler fails due to name
mangling issues.

Signed-off-by: Manu Sutela <manu.sutela@gmail.com>
2025-03-08 08:47:03 +01:00
Björn Bergman
d34d554d60 arch: arm: mpu: Fix BUILD_ASSERT on pointer value
Some compilers (iccarm included) does not support BUILD_ASSERT()
to check alignment of arrays.

This fix checks if an IAR compiler is used and disables the
start-alignment check if it is.

Signed-off-by: Björn Bergman <bjorn.bergman@iar.com>
2025-03-08 08:46:43 +01:00
Peter Mitsis
ec4df64dc7 kernel: make order_key field in thread conditional
The 'order_key' field in the thread structure '_thread_base' is only
required when CONFIG_SCHED_SCALABLE and/or CONFIG_WAITQ_SCALABLE are
enabled (neither of which is a default setting). Making the existence
of this field conditional slightly reduces the size of the k_thread
structure when neither of those Kconfig options are selected.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2025-03-08 03:38:37 +01:00
Josuah Demangeon
26db5c2aef drivers: video: introduce VIDEO_FOURCC_TO_STR
This adds a macro to generate a C99 compound literal string, which allow
to use it in debug log messages, such as:
LOG_DBG("The pixel format is '%s'", VIDEO_FOURCC_STR(fmt->pixelformat));

Signed-off-by: Josuah Demangeon <me@josuah.net>
2025-03-08 03:37:38 +01:00
Peter Mitsis
427f2c60da kernel: arch: add directed IPIs to x86/intel64
Adds support for directed IPIs to x86/intel64. Use of direct IPIs
can further reduce the number of schedule IPIs sent and processed
in a system. Fewer IPI related ISRs mean that ...
 1. Application code is interrupted less frequently
 2. Lower likelihood of scheduler spinlock contention

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2025-03-07 20:22:40 +01:00
Andy Ross
8b4ed6655a kernel: Clamp k_sleep() return value on overflow
k_sleep() returns a 32 bit count of milliseconds, as that was its
historical API.  But it now accepts a potentially 64 bit tick count as
an argument, leading to situations where an early wakeup will produce
sleep times that aren't representable.  Clamp this instead of
truncating to an arbitrary value.

Naive code will likely do the right thing with the large return (just
sleeping an extra round), and sophisticated apps can detect INT_MAX to
enable more elaborate retry logic.

(Also fixes a somewhat unfortunate puncutation error in the docs that
implied that it returns zero on early wakeup!)

Fixes: #84669

Signed-off-by: Andy Ross <andyross@google.com>
2025-03-07 20:20:25 +01:00
Carlo Kirchmeier
3d1370f094 net: http: Add compression support in HTTP server
Add compression support using the accept-encoding
header to the http server static filesystem resource.

Signed-off-by: Carlo Kirchmeier <carlo.kirchmeier@zuehlke.com>
2025-03-07 20:19:44 +01:00
Jilay Pandya
1f1bec86f3 drivers: stepper: shell: add stop function
Add stop function to stepper shell. align the function order to match
the one in __subsystem stepper_driver_api struct

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
2025-03-07 20:17:38 +01:00
Jilay Pandya
2cd5a373a1 drivers: stepper: api: add stop function
add stop function
update enable & set_interval specification

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
2025-03-07 20:17:38 +01:00
Andre Heinemans
da3d029b14 drivers: firmware: scmi: add nxp specific processing
An option is added to allow vendor specific processing at
scmi_shmem_write_message() and scmi_shmem_read_message().
Additionally code has been added specific to NXP which has
some extended validation features.

Signed-off-by: Andre Heinemans <andre.heinemans@nxp.com>
2025-03-07 20:02:17 +01:00
Cla Mattia Galliard
19f192cfb5 net: net_context: Make use of timeout for sending
Use the newly added timeout in various send functions from within
net_context_sendto.

Signed-off-by: Cla Mattia Galliard <cla-mattia.galliard@zuehlke.com>
2025-03-07 19:58:45 +01:00
Cla Mattia Galliard
5b89a5c4b8 net: add try variant with timeout for various send functions
Allows to send with different timeouts to not block caller in some
situations. Stable API is kept and just calls `try`-variant with a timeout
of `K_FOREVER`.

Signed-off-by: Cla Mattia Galliard <cla-mattia.galliard@zuehlke.com>
2025-03-07 19:58:45 +01:00
Emil Gydesen
4619611326 Bluetooth: Conn: Add const for conn in bt_conn_get_remote_info
The connection object is, and should not, be modified by the function.
Making it const makes it possible to do this simple operation
in functions that also won't change the conn object (i.e.
that uses `const`).

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-03-07 19:58:23 +01:00
Emil Gydesen
44c5c1da3d Bluetooth: Host: Add API for reading LE controller features
The function supports reading multiple controller-based values.
It is effectively a copy of struct bt_dev_le but in a more
application-oriented definition.

It was chosen to keep the features as an array rather than a
64-bit value, as the comparison macros work on arrays and that
there already exists new bits > 64 in the core spec which is not
yet supported by Zephyr.

It is being smoke tested in a generic GATT client test,
as the individual values may depend on several Kconfig options.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-03-07 19:58:23 +01:00
Robin Kastberg
ddd1063715 soc: stm32: handle CCM in LINKER_GENERATOR
Currently, the soc/stm32/ccm.ld is not handled in
CMAKE_LINKER_GENERATOR.

This commit adds support, making STM32 supportable by
alternative linkers such as AC6 and IAR.

This commit also renames a variable to match all other
LOADADDR symbols.

Signed-off-by: Robin Kastberg <robin.kastberg@iar.com>
2025-03-07 19:54:24 +01:00
Povilas Selevicius
37ddeb459c net: coap_client: expose has_ongoing_exchange function
The coap_client has a static/internal function, has_ongoing_exchange(),
which can be an useful addition to the public API. This would provide
a mechanism to determine when it is safe to close a socket gracefully.

Signed-off-by: Povilas Selevicius <povilas.selevicius@quadigi.com>
2025-03-07 19:52:22 +01:00
Krzysztof Chruściński
074215a30f drivers: clock_control: nrf: Move NRF_PERIPH_GET_FREQUENCY
Move macro from nrf_clock_control.h to soc_nrf_common.h. Clock control
header fetches many dependencies (e.g. onoff.h) so move macro to more
low level header.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2025-03-07 19:52:10 +01:00
Utsav Munendra
2b48ef62ba portability: cmsis: Implement osThreadJoin using Zephyr k_thread_join
Bugfix previous `osThreadJoin()` implementation where a thread which
exited with `osThreadExit()` could not be joined upon by other threads.

Signed-off-by: Utsav Munendra <utsavm@meta.com>
2025-03-07 19:51:50 +01:00
Jordan Yates
7ab8e27e26 net: lib: sntp: async query API
Add a variant of the SNTP API that does not block while waiting for a
response from the SNTP server. Instead it takes advantage of
`CONFIG_NET_SOCKETS_SERVICE` to read the response asynchronously when
the response is received.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-03-07 19:51:40 +01:00
Ryan McClelland
15f004b366 drivers: i3c: fix up argument alignment spaceing
fixup the function argument spacing to align

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2025-03-07 19:50:08 +01:00
Ryan McClelland
b495907ae5 drivers: i3c: cleanup target config descrition and add inline helpers
It shouldn't be possible to just 'enable' target mode of a device.
It is required by the specification to perform a handoff or request to
become a target or controller from the active controller. Not to just flip
a switch internally. Can the parameter from `enable` to `enabled` to report
if it is currently a target or a controller otherwise.

Also, add inline helpers for `i3c_config_get` and `i3c_configure` to ensure
the proper struct is passed in.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2025-03-07 19:50:08 +01:00