Commit graph

113274 commits

Author SHA1 Message Date
Pisit Sawangvonganan
cc0684351a kernel: system_work_q: make k_work_queue_config cfg as static const
Make `k_work_queue_config cfg` as `static const` to enable
compile-time instantiation instead of runtime allocation.
This modification saves substantial flash memory but has system-wide
effects that should be considered.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2025-04-04 21:15:40 +02:00
Mathieu Choplain
25fe4745e6 doc: kernel: fatal: update "Build Assertions" section intro paragraph
A long time ago, Zephyr had two macros that could be used for build-time
assertions: BUILD_ASSERT() and BUILD_ASSERT_MSG(). The latter has been
dropped in v2.7 and removed from the documentation; however, the intro
paragraph of the "Build Assertions" section has never been updated to
reflect this, and still confusingly claims that "Zephyr provides two
macros for performing build-time assertions" when only BUILD_ASSERT()
remains.

Update the introductory paragraph of "Build Assertions" section such that
it makes sense now that only one build-time assertion macro exists.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2025-04-04 21:15:29 +02:00
Peter Mitsis
5c36567c56 tests: Add benchmark for IPI performance
Adds tests to better gauge IPI performance on SMP. In each case, one
CPU is used as the source of IPIs while the remaining CPUs are busy
doing "work". Every 30 seconds the benchmark reports on the amount
of "work" done by the busy CPUs and the amount of work done by the
CPU generating the IPIs.

This can be used to ...
 1. Show how enabling IPI optimization affects system performance
 2. Show the cost of spinlock contention as the number of CPUs increase
 3. Measure the relative performance of scheduler changes on SMP.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2025-04-04 21:15:14 +02:00
Alberto Escolar Piedras
59b62243fa Bluetooth: HFP_AG: Initialize variable to avoid warning
gcc 11.4.0, seems to believe this variable may be used uninitialized,
and warns about it (causing a test build failure due to warnings
being treated as errors).
Let's just initialize the variable to 0 to avoid the issue, as the
cost is trivial.

subsys/bluetooth/host/classic/hfp_ag.c: In function
  ‘bt_hfp_ag_vts_handler’:
1095
subsys/bluetooth/host/classic/hfp_ag.c:3091:17: error: ‘code’ may be
  used uninitialized in this function [-Werror=maybe-uninitialized]
1096
 3091 |                 bt_ag->transmit_dtmf_code(ag, code);
1097
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1098

The issue can be reproduced for ex. with:
$ mkdir build ; cd build
$ cmake -GNinja -DBOARD=native_sim/native/64 ../tests/bluetooth/shell \
 -DCONF_FILE="prj_br.conf"
$ ninja

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-04-04 18:18:16 +02:00
Mahesh Mahadevan
83efaa7a69 west.yml: Update NXP HAL to fix HIFI DSP build
Get update to the SDK code to fix build on HIFI
DSP.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2025-04-04 18:17:57 +02:00
Andrej Butok
d4682ff5c9 tests: littlefs: fix test_lfs_basic for medium and large partitions
Fixes failed test_lfs_basic for medium partition > 960KB
and for large partition > 3MB.
Flashes with large erase size require larger test partition sizes
(e.g. s26ks512s0 has 256KB erase size).

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2025-04-04 18:17:48 +02:00
Valerio Setti
d75c2113a9 drivers: sensors: bma4xx: add I2C_RTIO Kconfig for I2C
Since #83575 bma4xx driver relies on RTIO to work. This means that
CONFIG_I2C_RTIO should be defined together with CONFIG_I2C in the
Kconfig, otherwise I2C_DT_IODEV_DEFINE() won't be available at
build time.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2025-04-04 18:17:41 +02:00
Robert Lubos
cf0b6068d2 net: coap_client: Fix CoAP client thread priority
The default thread priority for the CoAP client thread is set to
NUM_PREEMPT_PRIORITIES which is not a valid thread priority, as the
lowest application thread priority is actually
NUM_PREEMPT_PRIORITIES - 1. Because of this, CoAP client library gave an
assert on boot if assertions were enabled.

Kconfig does not allow for arithmetics when setting integer defaults,
therefore handle this at the preprocessor stage by limiting the actual
priority assigned to the CoAP client thread to a valid range.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-04-04 18:17:30 +02:00
Declan Snyder
0875499664 spi_nxp_lpspi: Remove mcux branding from tokens
Since these drivers mainly do not use MCUX except for the configure
function (which will soon also be changed), change namespace prefix to
lpspi_ instead of spi_mcux_ to avoid confusion.

Also improve descriptions of kconfigs to clarify what they are for.
Not changing the kconfig names for now since they are user-facing.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-04-04 18:17:19 +02:00
Declan Snyder
fa3a51bc29 spi_nxp_lpspi: Remove SDK items from header file
Remove SDK types and defines from header file.

And since now the common file is the only consumer of SDK header, move
that include there.

Also rename the tristate boolean to be more clean about what it does
rather than trying to be similar to the SDK config name.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-04-04 18:17:19 +02:00
Declan Snyder
ef60f88162 spi_nxp_lpspi: Refactor validation args to func
Minor refactor to make a separate function to validate configuration
arguments.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-04-04 18:17:19 +02:00
Declan Snyder
6a283c0a1f spi_nxp_lpspi: Convert CPU version to native code
Convert the CPU-based lpspi driver to native code.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-04-04 18:17:19 +02:00
Declan Snyder
1c00f368d9 spi_nxp_lpspi: Convert DMA version to native code
Convert the DMA-based LPSPI driver to native code.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-04-04 18:17:19 +02:00
Declan Snyder
29213b5e7c spi_nxp_lpspi: Fix DMA driver async return
We should not release context until transfer ends. The code previously
would return from wait_for_completion and then release the context. This
is only supposed to be done in the dma callback except for the case of
error in the transceive call. For async transfer this was most likely
always happening wrong and probably broken for multi threads trying to
access the bus due to this premature release of the context.

Also we should not enable CS and leave enabled in case of error, move CS
enable to after the error check.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-04-04 18:17:19 +02:00
Declan Snyder
5acee4ad9d spi_nxp_lpspi: Prevent edge case causing DMA error
Stop the transfer with error if at any point there is some
execution reached where transfer is being set up for 0 length, this can
cause problems where for example eDMA set up with this nonsense 0 length
channels can get an infinite error interrupt.

And this is probably an erroneously crafted transfer request anyways.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-04-04 18:17:19 +02:00
Declan Snyder
2f678bd56c spi_nxp_lpspi: Reset/clock peripheral
If there are HAL definitions available, do these two things:

Ungate the clock for the device from the zephyr driver. Eventually it
would be better to have a clocks property in the LPSPI DT node and get
the resources from there rather than the HAL.

Some platforms require the peripheral to be reset at system level, add
code to do this. Eventually it would be more ideal to have Zephyr
reset drivers for all of the NXP platforms and use DT to describe the
reset resources, but for now we can just do this to get the LPSPI
supported.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-04-04 18:17:19 +02:00
Hank Wang
e11634e733 drivers: i2c: tca954x: add support for idle disconnect
Add support for an optional "idle disconnect" feature in the TCA954x
I2C multiplexer. When enabled via the `i2c-mux-idle-disconnect` device
tree property, the driver will disconnect all channels after each
transfer. This helps avoid address conflicts when multiple multiplexers
are present on the same I2C bus.

Even if the I2C transfer fails, the driver will still attempt to
disconnect the channels to ensure the bus is left in a consistent state.
If the disconnect operation itself fails, its error code will be returned
unless the transfer already failed with a different error.

This implementation is inspired by the Linux kernel driver for PCA954x
I2C multiplexers. Special thanks to Ofir Shemesh for valuable suggestion.

Signed-off-by: Hank Wang <wanghanchi2000@gmail.com>
2025-04-04 18:17:07 +02:00
Emil Gydesen
2dbc10ab6b Bluetooth: BAP: Fix bad cast to void * instead of void for memcpy
The result of memcpy should be cast to (void) and not (void *).

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-04-04 18:16:54 +02:00
Jordan Yates
e661a55044 sensor: bme280: clamp humidity to non-negative
Clamp the returned humidity to a non-negative value. This ensure that
the return value is always within the expected range, even if the
calibration parameters are read out incorrectly or corrupted.

This check is applied in the example Bosch driver for the float
conversion case, so there are situations that warrant it.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-04-04 14:57:43 +02:00
Aksel Skauge Mellbye
295975019a dts: arm: silabs: Fix clock and interrupt definitions for xg22
The WDOG and IADC clock node definitions were missing for xg22,
and interrupt numbers were wrong for WDOG on xg27.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2025-04-04 14:57:15 +02:00
Markus Lassila
392fda02b3 net: Add CONFIG_NET_CONN_PACKET_CLONE_TIMEOUT
Add CONFIG_NET_CONN_PACKET_CLONE_TIMEOUT to allow for longer
timeouts. This can be used to prevent dropping packets when
transmitting large amounts of data (with PPP).

Signed-off-by: Markus Lassila <markus.lassila@nordicsemi.no>
2025-04-04 14:57:06 +02:00
Eric Holmberg
84d3cafbce net: websocket: fix masked data when server sends close
When sending the close command as a server, the data is incorrectly
masked which violates RFC6455 section 5.1.

Use the is_client flag to avoid masking if the close is for a websocket
server.

Signed-off-by: Eric Holmberg <eric.holmberg@northriversystems.co.nz>
2025-04-04 14:56:58 +02:00
Lyle Zhu
00ffb5ba97 Tests: Bluetooth: Classic: Bumble power_on() will fail on Linux
On Linux, the function `power_on()` of Bumble will fail when executing
even-numbered test cases.

From the `btmon` log, the controller will not reply the `HCI Command:
Reset` when the issue occurs.

Add a try-except to catch the exception of the function `power_on()`,
and retry to call the function `power_on()` until issue no longer
occurs. Or, the test will fail due to the timeout.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
2025-04-04 14:56:48 +02:00
Torsten Rasmussen
483c76759d scripts: support quoted sysbuild Kconfig settings in twister
Kconfig settings of string type is passed to CMake with quotes to ensure
they are properly handled, for example when specified in testcase.yml as
>   extra_args:
>    - CONFIG_FOO="bar"

Support sysbuild Kconfig settings `SB_CONFIG` by performing the same
quoting for settings starting with `SB_CONFIG_`.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2025-04-04 14:56:39 +02:00
Camille BAUD
da45a76fce MAINTAINERS: Introduce WCH platforms
Introduce WCH platforms, assign myself and hal_wch maintainers

Signed-off-by: Camille BAUD <mail@massdriver.space>
2025-04-04 14:56:30 +02:00
Aurelie Fontaine
e5d39819c9 MAINTAINERS: add tdk team as TDK Sensors maintainers and collaborators
We would like to take maintainership of TDK drivers as discussed:
 https://github.com/zephyrproject-rtos/zephyr/pull/85963
teburd and MaureenHelm moves to collaborators

Signed-off-by: Aurelie Fontaine <aurelie.fontaine@tdk.com>
2025-04-04 14:56:20 +02:00
Lars-Ove Karlsson
bf29b2a8d7 bluetooth: host: Fixed missing guard for BT_SETTINGS_DEFINE
While linking with the IAR linker using generated linker scripts,
and with errors if unhandled sections are encountered, many of the
bluetooth tests failed because CONFIG_SETTINGS was not set.

The section that was not handled was
'._settings_handler_static.static.settings_handler_bt_ccc_'

Now it's only set if CONFIG_SETTINGS is set.

Signed-off-by: Lars-Ove Karlsson <lars-ove.karlsson@iar.com>
2025-04-04 14:56:10 +02:00
Jimmy Zheng
dbd0ac40ce drivers: interrupt_controller: intc_clic: add indirect access clic reg
Add indirect CSR access to access CLIC register to satisfy the current
CLIC spec (Version v0.9, 2024-06-28: Draf).

Add CONFIG_LEGACY_CLIC_MEMORYMAP_ACCESS for legacy CLIC implementation
with memory-mapped CLIC register.

Signed-off-by: Jimmy Zheng <jimmyzhe@andestech.com>
2025-04-04 14:55:50 +02:00
Jimmy Zheng
46a828e787 drivers: interrupt_controller: intc_clic: add CLIC parameters
Add support for CLIC hardware parameters based on the hardware
implementation.

  1. CLIC_PARAMETER_INTCTLBITS
    Specifies the number of modifiable bit in interrupt control register.

  2. CLIC_PARAMETER_MNLBITS
    Specifies the number of bits are assigned to interrupt level in the
    interrupt control bits.

Signed-off-by: Jimmy Zheng <jimmyzhe@andestech.com>
2025-04-04 14:55:50 +02:00
Jimmy Zheng
ed97af9309 drivers: interrupt_controller: intc_clic: add CLIC SMCLICCONFIG extension
Add support for CLIC SMCLICCONFIG extension, allowing user to configure
the number of available interrupt level bits at runtime.

Signed-off-by: Jimmy Zheng <jimmyzhe@andestech.com>
2025-04-04 14:55:50 +02:00
Jimmy Zheng
8dca182b14 driver: interrupt_controller: intc_clic: fixed access CLIC w/o privileged
Temporarily disabled PMP stack guard to allow access to CLIC M-mode
register, because U-mode load/store (mstatus.MPRV=0x1,MPP=0x0) is
restricted.

Signed-off-by: Jimmy Zheng <jimmyzhe@andestech.com>
2025-04-04 14:55:50 +02:00
Jimmy Zheng
9349d54074 driver: interrupt_controller: intc_clic: rework to standard CLIC driver
Rework intc_clic to standard CLIC driver with Nuclei ECLIC extention.

Signed-off-by: Jimmy Zheng <jimmyzhe@andestech.com>
2025-04-04 14:55:50 +02:00
Jimmy Zheng
21f0ee0383 driver: interrupt_controller: rename intc_nuclei_eclic to intc_clic
Rename intc_nuclei_eclic to intc_clic, and separate CLIC register
definitions into intc_clic.h.

Signed-off-by: Jimmy Zheng <jimmyzhe@andestech.com>
2025-04-04 14:55:50 +02:00
Jimmy Zheng
477d56ecea dts: bindings: interrupt-controller: add riscv,clic yaml
Add RISC-V CLIC (Core-Local Interrupt Controller) yaml.

Signed-off-by: Jimmy Zheng <jimmyzhe@andestech.com>
2025-04-04 14:55:50 +02:00
Petri Pitkanen
a1a92a20a6 dts: silabs: interrupt levels corrected
Downgrading interrupt priority for non critical interrupts for the
supported SOCs.

Previously almost all interrupts were at level 0 i.e. meaning no interrupt
had priority over the others. In reality only radio interrupts are critical
while others can be served with less haste.

Now the level zero is reserved for interrupts that need higher priority
than the radio without bypassing irq locks (zero-latency interrupts)
Level 1 for radio and levels 2 and 3 for rest of the services.

Signed-off-by: Petri Pitkanen <petri.pitkanen@silabs.com>
2025-04-04 12:14:44 +02:00
Serhiy Katsyuba
7f818b5e72 Revert "drivers: dma: intel_adsp_hda: change L1_EXIT defaults"
This reverts commit c2f02533a6.

DMA_INTEL_ADSP_HDA_TIMING_L1_EXIT should be enabled for all ACE platforms.
Any new platform in the ACE series will likely need it as well.

Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
2025-04-04 12:07:08 +02:00
Yakun Xu
eddb1af9aa openthread: map Thread network interface state
The current mapping gets the network interface into dormant state when
Thread is not attached. While the node is not capable of doing multi-hop
communication when it's not attached, it should be able to do link-local
communication. This commit changes the mapping to look at OpenThread's
own network interface state instead without further checking Thread's
device role, so that link-local communication is supported when a node
in detached state.

Signed-off-by: Yakun Xu <xyk@google.com>
2025-04-04 12:06:59 +02:00
Johann Fischer
1ac9b14804 drivers: udc: fix it82xx2 and numaker drivers compilation
The dev argument is missing.
Introduced in the commit 1cccf28d5e
("drivers: usb: udc: Reduce unnecessary ep config lookups").

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2025-04-04 12:06:50 +02:00
Jamie McCrae
2f55dc8add scripts: ci: check_compliance: Disallow board hooks in defconfigs
Adds board hooks to the disallowed defconfig symbol list as
these should be selected, not put in a defconfig

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-04-04 12:06:38 +02:00
Christopher Cichiwskyj
7dcec3384e soc: add support for STM32F479
This chip shares its design with STM32F469, but with
an added cryptography accelerator.

Signed-off-by: Christopher Cichiwskyj <cichiwskyj@gmail.com>
2025-04-04 12:06:29 +02:00
Emil Gydesen
acd7080350 Bluetooth: BAP: Call bis_sync_req for all BIS sync state changes
Previously bis_sync_req was only called when requested_bis_sync
was changed. However that meant that there were cases where the
requested_bis_sync was the same as the new request, but where
the actual BIS sync state were different. This was mostly
the case when the scan delegator had autonousmly
added or modified the receive state.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-04-04 12:06:19 +02:00
Emil Gydesen
f39feb8aa7 Bluetooth: BAP: Fix bad overwrite of requested_bis_sync
The scan_delegator_mod_src accidentally may have overwritten
the value of internal_state->requested_bis_sync before the
entire request had been verified, causing a mismatch between
what the application knows and what the stack stored.

Fixed by storing the request in a temporary value until
everything has been verified and accepted.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-04-04 12:06:19 +02:00
Sven Ginka
18fcf771ef board: sensry: ganymed-bob - add west flash support
Adding support for using west flash to install new firmware
on the board.

Signed-off-by: Sven Ginka <s.ginka@sensry.de>
2025-04-04 12:06:07 +02:00
Sven Ginka
de6f1873c8 west: runners: add flash runner for sensry sy1xx socs
With this commit we add a runner that is capable of flashing
the sensry sy1xx socs via uart to support the onboard OTP
bootloader. Added the sy1xx runner to the list for
automated test.

Signed-off-by: Sven Ginka <s.ginka@sensry.de>
2025-04-04 12:06:07 +02:00
Chaitanya Tata
4875978d39 modules: nrf_wifi: Remove unnecessary check
The Zephyr base variable is not used below and also is deprecated and
not needed to be set.

Fixes #87950.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2025-04-04 09:35:47 +02:00
Adrian Bonislawski
e64cce9053 soc: intel_adsp: ace30: set MMU permissions for rom_ext sections
This patch will set MMU permissions for rom_ext sections
It is possible to call the rom_ext code located in IMR

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2025-04-04 09:35:29 +02:00
Adrian Bonislawski
368f6cfee4 soc: intel_adsp: ace30: extend hwreg1 MMU mapping
This patch will extend MMU mapping range for hwreg1 entry
because it is required to access lower register addresses

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2025-04-04 09:35:29 +02:00
Vinayak Kariappa Chettimada
47c7918393 Bluetooth: Controller: Single recv thread for HCI-only builds
Updated implementation to use single receive thread to
enqueue HCI ISO data, ACL data and events towards Host when
building HCI-Only samples/applications, i.e. when building
hci_uart, hci_spi or hci_ipc samples (CONFIG_BT_HCI_RAW=y).

This implementation will serialize HCI events and data as
they occur corresponding to on-air timelines of their
occurrences which is how they are generated by the Link
Layer.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2025-04-04 09:35:16 +02:00
Julien Racki
ee6bb6e849 boards: st: Add support for stm32mp135f_dk board
Add support for STM32MP135F DK board.

Signed-off-by: Julien Racki <julien.racki@st.com>
2025-04-04 09:35:03 +02:00
Julien Racki
7512391da4 dts: arm: st: mp13: stm32mp13 new series with cortex A7
Put the flash in DDR 0xC0000000
Put the SRAM in DDR 0xD0000000

Signed-off-by: Julien Racki <julien.racki@st.com>
2025-04-04 09:35:03 +02:00