Commit graph

15409 commits

Author SHA1 Message Date
Etienne Carriere
b78ada18b1 include: zephyr: dt-bindings: clock: stm32u5: fix refman reference
Correct references to STM32U5 series reference manual.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2025-03-26 16:19:09 +01:00
Etienne Carriere
175662eb72 include: zephyr: dt-bindings: clock: stm32n6: fix refman reference
Correct references to STM32N6 series reference manual.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2025-03-26 16:19:09 +01:00
Etienne Carriere
b228c075ad include: zephyr: dt-bindings: clock: stm32n6: add clock source IDs
Add some clock source identifiers that were missing for stm32n6xx
platforms.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2025-03-26 16:19:09 +01:00
Etienne Carriere
ce63ccfc5d include: drivers: clock_control: stm32n6 CPU clock selection macros
Add STM32_CPUCLK_SRC_* macros as helper macros to select which source
clock feeds the CPU clock on a STM32N6 SoC.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2025-03-26 16:19:09 +01:00
Tomasz Moń
75109707e3 usb: device_next: Do not add serial number without HWINFO
For many devices iSerialNumber is not required. The only device class
currently supported in Zephyr that requires iSerialNumber is MSC. If the
serial number is not available then iSerialNumber must be 0. Failure to
read the string descriptor for non-zero iSerialNumber fails USB Command
Verifier Chapter 9 tests.

When USBD_DESC_SERIAL_NUMBER_DEFINE() was used without CONFIG_HWINFO
then it did lead to runtime failure when requesting the string (thus
failing certification).

Fail USBD_DESC_SERIAL_NUMBER_DEFINE() at build-time if CONFIG_HWINFO is
not set to prevent the surprise at runtime. Only define serial number
descriptors if CONFIG_HWINFO is enabled.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2025-03-26 16:18:56 +01:00
Ivan Iushkov
ded9c1f44d bluetooth: CS: add bt_le_cs_get_antenna_path()
added function to calculate antenna path
based on the antenna permutation index and
total number of antenna paths

Signed-off-by: Ivan Iushkov <ivan.iushkov@nordicsemi.no>
2025-03-26 11:32:57 +01:00
James Roy
e38cc894e3 drivers: counter: Fix incorrect error codes
Unimplemented interfaces should return
-ENOSYS instead of -ENOTSUP.

Signed-off-by: James Roy <rruuaanng@outlook.com>
2025-03-26 08:54:58 +01:00
James Roy
355d904c67 drivers: counter: Add counter_reset function
Add a counter_reset function to the counter subsystem
to reset the counter value to zero. Introduce
a reset interface at the driver layer to implement
the counter_reset function.

Signed-off-by: James Roy <rruuaanng@outlook.com>
2025-03-26 08:54:58 +01:00
Jonas Spinner
a65e93a47d device: fix typo in device_deinit
Fix minor typo s/responsability/responsibility.

Signed-off-by: Jonas Spinner <jonas.spinner@burkert.com>
2025-03-26 07:09:00 +01:00
Håvard Reierstad
77b6035fce Bluetooth: Host: Doc: Name enums in gap.h
Names the enums declared in `gap.h` and replaces references to them
with Doxygen references (@ref).

Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
2025-03-26 07:08:44 +01:00
Ryan McClelland
9628d97ad9 drivers: i3c: remove group addr definition
The i3c group address support is rather very incomplete here. Remove
references to it. This could all easily come back when/if group support
comes in.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2025-03-26 00:47:00 +01:00
Jan Behrens
411ca58146 drivers: stepper: Added fault event
Adds a fault event to stepper_event for stall unrelated problems.

Signed-off-by: Jan Behrens <jan.behrens@navimatix.de>
2025-03-25 22:16:17 +01:00
Lars-Ove Karlsson
becfd02203 toolchain: Add IAR warning macros
Add warning macros for IAR tools analogue to CLANG and GCC.

Signed-off-by: Lars-Ove Karlsson <lars-ove.karlsson@iar.com>
2025-03-25 22:15:32 +01:00
Håvard Reierstad
c77587a76b Bluetooth: Host: Clarify use of identity in docs
Clarifies the use of identity in `bluetooth.h` by specifying whether the
documentation refers to the identity address, i. e. the actual address
`bt_addr_le_t`, or the identity handle, i. e. an index corresponding to
a specific identity address.

Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
2025-03-25 22:14:55 +01:00
Fredrik Gihl
83b1422f9c drivers: sensor: tmp114: Support setting odr
Add support for setting the sample frequency via `attr_set` and the
output data rate from device tree source.

Signed-off-by: Fredrik Gihl <fgihl@hotmail.com>
2025-03-25 22:12:11 +01:00
Krzysztof Chruściński
1ac19d3e98 sys: cbprintf: logging: Fix opaque struct pointer warning
Use compiler trick to allow operations with all types of arguments.
Previous solution was using arg+0 with suppressing compiler warning
about pointer arithmetic operations but it was not covering for
opaque struct pointers.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2025-03-25 11:00:42 +01:00
Jukka Rissanen
0a0297229d net: Add helper to get sockaddr from sockaddr_storage struct
As one should not instantiate sockaddr struct (only have pointers
to it), but only use struct sockaddr_storage to store the
socket address information. In order to simplify the casting,
create net_sad() macro that casts a "struct sockaddr_storage *" to
"struct sockaddr *" which can then be used by other macros in the
networking stack.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-03-25 11:00:33 +01:00
Jukka Rissanen
95d352779e net: virtual: Add capability flag for VPN type interface
Allow user to mark the virtual interface as a VPN one.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-03-25 11:00:33 +01:00
Ryan McClelland
9bce73a6e0 drivers: i3c: cleanup const
There is const used in a few places and some hacks to get around
that const. Just remove the const as well as remove the hacks.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2025-03-25 08:44:02 +01:00
Yangbo Lu
ded3ce2974 dts: arm: nxp_imx95_m7: add power domain node and definitions
Added power domain node and i.MX95 power domain header file.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2025-03-25 05:59:30 +01:00
Martin Durietz
c7453da082 dt-bindings: clock: Add MCO register definition for STM32WL
Added MCO register definition to support MCO functionality in the STM32WL
series. This update also includes the addition of MCO_PRE_DIV and MCO_SEL
defines.

Signed-off-by: Martin Durietz <martin.durietz@gmail.com>
2025-03-24 19:23:09 +01:00
AbdElRahman Khalifa
b11703623c net: Add support for IPv4_MULTICAST_LOOP in net_context
Add support for the IP_MULTICAST_LOOP socket option to control
multicast packet loopback.

Signed-off-by: AbdElRahman Khalifa <abdelrahman.5alifa@gmail.com>
2025-03-24 09:54:05 +01:00
Irfan Ahmad
58d5e35f0d toolchain: Add assembly-side counterpart of __aligned
Zephyr toolchain abstraction provides a macro __aligned(x) to add specified
alignment, in bytes, to a chosen symbol for C/C++ source files but there is
no portable counterpart available for symbols defined in assembly source
files. This change-set adds a new macro ALIGN(x) for this purpose.

Signed-off-by: Irfan Ahmad <irfan.ahmad@siemens.com>
2025-03-24 09:53:55 +01:00
Fin Maaß
2a4b3148ed drivers: entropy: add maxq10xx
add maxq10xx entropy device.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-03-23 13:18:44 +01:00
Luca Burelli
3fcd90339d llext: optimize allocations for read-only sections
When loading an extension, read-only sections that do not have
relocations and whose data is accessible from the ELF buffer can be
directly mapped as-is in the extension memory. This avoids the need to
allocate and copy unmodified data from the ELF buffer to the LLEXT heap.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2025-03-21 14:41:30 -04:00
Luca Burelli
9fa6a95e30 llext: add storage-specific buffer loaders
This patch adds three new macros to initialize an llext_buf_loader
structure with a specific storage type. The existing LLEXT_BUF_LOADER
macro is discouraged, since its storage type is not explicitly defined
in the code but relies on the CONFIG_LLEXT_STORAGE_WRITABLE option.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2025-03-21 14:41:30 -04:00
Luca Burelli
6c2b5f6c92 llext: introduce 'enum llext_storage_type'
This patch introduces an 'enum llext_storage_type' that defines the
storage type of the ELF data that will be loaded:

- LLEXT_STORAGE_TEMPORARY: ELF data is only available during
  llext_load(); even when the loader supports directly accessing the
  memory via llext_peek(), the buffer contents will be discarded
  afterwards.
  LLEXT will allocate copies of all required data into its heap.

- LLEXT_STORAGE_PERSISTENT: ELF data is stored in a *read-only* buffer
  that is guaranteed to be always accessible for as long as the
  extension is loaded.
  LLEXT may directly reuse constant data from the buffer, but may still
  allocate copies if relocations need to be applied.

- LLEXT_STORAGE_WRITABLE: ELF data is stored in a *writable* memory
  buffer that is guaranteed to be always accessible for as long as the
  extension is loaded.
  LLEXT may freely modify and reuse data in the buffer; so, after the
  extension is unloaded, the contents should be re-initialized before a
  subsequent llext_load() call.

To keep full compatibility with existing code, the storage type of
LLEXT_BUF_LOADER is determined by the CONFIG_LLEXT_STORAGE_WRITABLE Kconfig
option between LLEXT_STORAGE_PERSISTENT and LLEXT_STORAGE_WRITABLE.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2025-03-21 14:41:30 -04:00
Andrzej Głąbek
a117d12ba6 include: spi: Restore warning in spi_config structure documentation
It was added in commit 7a8a4c9b3e,
but then, presumably unintentionally, was removed in commit
4c4e2c5213.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2025-03-21 17:06:29 +01:00
Aleksander Wasaznik
b2d21f9b87 Bluetooth: Host: Improve documentation of bt_le_ext_adv_start_param
This clarifies the documentation of `bt_le_ext_adv_start_param` and
`bt_le_ext_adv_cb.sent`, and links them by via references.

Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
2025-03-21 17:05:50 +01:00
Lucas Tamborrino
0b9e4e013a soc: espressif: esp32c6: Add LP Core
Add ULP Coprocessor support for ESP32C6.

Signed-off-by: Lucas Tamborrino <lucas.tamborrino@espressif.com>
2025-03-21 17:05:20 +01:00
Sayooj K Karun
273d60164d net: sockets: IPv6_MULTICAST_LOOP Support
Add support for the IPV6_MULTICAST_LOOP socket option.
This option allows enabling or disabling the consumption of multicast
packets by the sender. By default, the socket option will be enabled.

Co-authored-by: Pieter De Gendt <pieter.degendt@gmail.com>

Signed-off-by: Sayooj K Karun <sayooj@aerlync.com>
2025-03-21 14:19:08 +01:00
Robert Lubos
a61287e876 net: lib: tls_credentials: Rename TLS_CREDENTIAL_SERVER_CERTIFICATE
TLS_CREDENTIAL_SERVER_CERTIFICATE credential type is misleading, as in
fact it just represents a public certificate, it does not matter if the
certificate belongs to a server or a client. And actually, it was
already used in-tree for clients as well, for example in LwM2M.

Therefore rename the credential type to a more generic
TLS_CREDENTIAL_PUBLIC_CERTIFICATE and deprecate the old one.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-03-21 14:18:52 +01:00
Mahesh Mahadevan
0cd23dc5b7 drivers: gpio_mcux_lpc: Provide an API to fire callbacks
Provide an API for other drivers to fire GPIO callbacks

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2025-03-21 09:51:38 +01:00
Lars-Ove Karlsson
4edb8af70c cmake: linker: Removed unnecessary regexp in link generator
In the linker script generator there was one error checking
construct that used regexp and that ended up in the generated
linker file, which caused parsing problems with the IAR
linker. It was unnecessary. Also updated
common-rom-kernel-devices.ld.

Signed-off-by: Lars-Ove Karlsson <lars-ove.karlsson@iar.com>
2025-03-20 21:58:14 +01:00
Tom Hughes
15411747e7 everywhere: Use correct macro for gcc-specific warnings
Many warnings were disabled for all compilers, even though they are
gcc-specific warnings. Now that clang has -Wunknown-warning-option
enabled, this can cause compilation failures when building with clang
toolchains.

Use TOOLCHAIN_DISABLE_GCC_WARNING for all gcc-specific macros.

https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
https://clang.llvm.org/docs/DiagnosticsReference.html

Fixes: #84138

Signed-off-by: Tom Hughes <tomhughes@chromium.org>
2025-03-20 21:57:47 +01:00
Tom Hughes
11d70c61e5 everywhere: Replace diagnostic pragmas with TOOLCHAIN_* macros
The TOOLCHAIN_DISABLE_WARNING/TOOLCHAIN_ENABLE_WARNING macros are easier
to read and compiler agnostic.

Signed-off-by: Tom Hughes <tomhughes@chromium.org>
2025-03-20 21:57:47 +01:00
Tom Hughes
6f6d6d0f76 toolchain: Replace TOOLCHAIN_IGNORE_WSHADOW_BEGIN/END
The TOOLCHAIN_IGNORE_WSHADOW_BEGIN and TOOLCHAIN_IGNORE_WSHADOW_END
macros can be replaced with the more generic
TOOLCHAIN_DISABLE_WARNING(TOOLCHAIN_WARNING_SHADOW) and
TOOLCHAIN_ENABLE_WARNING(TOOLCHAIN_WARNING_SHADOW) macros.

Signed-off-by: Tom Hughes <tomhughes@chromium.org>
2025-03-20 21:57:47 +01:00
Fabio Baltieri
c60ffe1e1b linker: update section names to be unambiguous
Recently 0ae0c3dc44 allowed for three digit priorities, this resulted
in objects potentially matching multiple sections, for example:

.z_init_PRE_KERNEL_2_0_0_
.z_init_PRE_KERNEL_2_?_*
.z_init_PRE_KERNEL_2_???_*

This does not seem to be detected by ld, but the IAR linker emits a
warning.

Add some extra qualifiers in the object section name to make it
unambiguous, this has the extra value of making it easier to interpret,
for example going from:

.z_init_POST_KERNEL_90_00012_

to

.z_init_POST_KERNEL_P_90_SUB_00012_

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2025-03-20 12:20:55 -04:00
Adrian Warecki
3df1ffe1d5 xtensa: mmu: Fix partition permission definitions
Fix K_MEM_PARTITION_P_RX_U_RX definition to allow code execution from
userspace. Add K_MEM_PARTITION_P_RX_U_NA definition that allows code
execution only by kernel.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2025-03-20 17:18:44 +01:00
Jukka Rissanen
410bd4b0be net: utils: Add helper to parse ip address string with a mask len
Adding a helper to parse one or more IPv4/6 strings with optional
netmask or prefix length.

Example of the string:

   2001:db8::1/64,192.0.2.1,2001:db8::2,192.0.2.2/24

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-03-20 17:16:10 +01:00
Emil Gydesen
d19abff476 Bluetooth: CSIP: Add support for dynamically setting set size
The set size can now be dynamically set and notified.
The rank is added as a argument in the case that changing
the set size, also affects the device's rank, as ranks
in a coordinated set needs to be continuous.

The set coordinator implementation has been updated
to support receiving the new set size, and providing
this information to the upper layers.

This commit adds a babblesim test for the new API,
as well as a shell command.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-03-20 14:23:40 +01:00
Sudan Landge
d7c629696d arch: arm: Add PXN support for Armv8.1-M
What is the change?
This commit adds support for Armv8.1-M MPU architecture's PXN attribute.
This includes support for configuring MPU regions with PXN via
custom mpu_config, devicetree and static mpu_config.
The existing MPU region attribute macros are updated to retain existing
behaviour with this change with an addition of REGION_RAM_ATTR_PXN to be
used if one needs to configure a RAM region with PXN MPU attribute.

Why do we need this change?
Armv8.1-M architecture introduced a new MPU region attribute called
Privilege eXecute Never (PXN).
If an MPU region is configured with the PXN attribute set and if the,
processor attempts to execute code in this region while at
privileged level, a Memory Management Fault exception is triggered.

This ensures that specific tasks are executed only in unprivileged mode
and helps in preventing secure privilege escalation attacks.

Signed-off-by: Sudan Landge <sudan.landge@arm.com>
2025-03-20 12:17:11 +01:00
Josh DeWitt
0ae0c3dc44 linker: Allow for 999 priority levels in init levels
Some projects may have needs for more than 99 priority levels, so add
a third linker input section for each obj level.

Signed-off-by: Josh DeWitt <josh.dewitt@garmin.com>
2025-03-19 18:53:22 -04:00
Josh DeWitt
0f46359cbf linker: Add underscore between the init level and priority
Ensure the priority is surrounded by underscores for clarity. This makes
sections show up as
z_init_PRE_KERNEL_1_0_0_ instead of
z_init_PRE_KERNEL_10_0_

Signed-off-by: Josh DeWitt <josh.dewitt@garmin.com>
2025-03-19 18:53:22 -04:00
Josh DeWitt
a87f6fef60 linker: Fix clang-format breaking linker macros
clang-format will remove the space after the equals sign causing link
issues. Disable clang-format for some linker macros since they should
not be formatted as C code.

Signed-off-by: Josh DeWitt <josh.dewitt@garmin.com>
2025-03-19 18:53:22 -04:00
Anisetti Avinash Krishna
15a45e6fa8 include: zephyr: sys: time_units: Fix precision bug in z_tmcvt_32
Fixing the precedence of the cast in z_tmcvt_int_div_32 and
z_tmcvt_int_mul_32 functions so the final result is of type
uint32_t.

Fixes #87226

Signed-off-by: Anisetti Avinash Krishna <anisetti.avinash.krishna@intel.com>
2025-03-19 20:27:26 +01:00
James Roy
a6f5897e21 drivers: i2c: Add an i2c_configure_dt function
Add an i2c_configure_dt function, that is equivalent
to calling i2c_configure(spec->bus, dev_config) to
simplify the calling.

Signed-off-by: James Roy <rruuaanng@outlook.com>
2025-03-19 20:26:45 +01:00
Kyra Lengfeld
2ae411017d Bluetooth: Host: Improve bluetooth documentation
This commit imrpoves the bluetooth.h documentation by adding @briefs and
@details to all the structs and enums lacking such, as well as
clarifying the existing documentation.

Signed-off-by: Kyra Lengfeld <kyra.lengfeld@nordicsemi.no>
2025-03-19 17:14:31 +01:00
Alex Fabre
3c4c6fae2e kernel: add missing member initializer
This commit eliminates warning message raised by GCC when option
'-Wmissing-field-initializers' or '-Wextra'  is used.

Signed-off-by: Alex Fabre <alex.fabre@rtone.fr>
2025-03-19 17:12:15 +01:00
Lyle Zhu
11fc9642c0 Bluetooth: Classic: Add a function bt_conn_get_dst_br()
Add a function `bt_conn_get_dst_br()` to get the peer address of the
classic connection.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-03-19 09:01:51 -04:00