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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Add support for the IP_MULTICAST_LOOP socket option to control
multicast packet loopback.
Signed-off-by: AbdElRahman Khalifa <abdelrahman.5alifa@gmail.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
The TOOLCHAIN_DISABLE_WARNING/TOOLCHAIN_ENABLE_WARNING macros are easier
to read and compiler agnostic.
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>