Commit graph

126,787 commits

Author SHA1 Message Date
Luis Ubieda
b48e649040 icm4268x: Various driver Improvements for streaming mode
This patch makes the following improvements:
- Helper APIs for simplifying RTIO transfers.
- Simplify RTIO Streaming implementation to reduce processing time.
- Add streaming mode atomic state, in order to track overruning the
callback events generation.
- Add device pointer address to logging on error-occurrences, as it is
useful when the app has multiple instances of the driver (e.g: NXP's
VMU RT1170 has two).

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2025-10-22 08:52:29 +02:00
Luis Ubieda
f71c0c8898 icm4268x: Do not enable GPIO Interrupts on trigger_init
Wait until the trigger or streaming mode is configured. Otherwise,
rebooting in-between runs may cause multiple callbacks invoked when
the trigger may have not been enabled yet.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2025-10-22 08:52:29 +02:00
Luis Ubieda
75ace90a2c icm4268x: Remove padding from Decoder struct
This induces extra-cycles in the encoding path while streaming, which
make it difficult to achieve high-bandidth performance. The use-case
being dealt with involves cranking the IMU at 8000 ODR in batches of
1.25 ms (10 samples at 800 Hz).

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2025-10-22 08:52:29 +02:00
Luis Ubieda
fa96f07a42 icm4268x: Remove RTIO Workqueue usage in streaming mode
As it introduces latencies due to switching to the threads pool.
Moreover, this is not required for streaming as it executes in a
non-blocking path.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2025-10-22 08:52:29 +02:00
Luis Ubieda
9de11f529a icm4268x: Add defensive code to prevent invalid submissions
Missing packets or overrunning/underrunning the queue should not result
in a system crash.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2025-10-22 08:52:29 +02:00
Luis Ubieda
2648e0190a icm4268x: Expand Bus RTIO queue
Based on performance observed when cranking the sensor at +1000 Hz ODR,
otherwise is not able to keep up with the pace.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2025-10-22 08:52:29 +02:00
Stanley Huang
a78bf4f180 board: Rename raytac_an54l15q_db to raytac_an54lq_db_15
Renamed raytac_an54l15q_db to raytac_an54lq_db_15.

Signed-off-by: Stanley Huang <stanley@raytac.com>
2025-10-22 08:52:18 +02:00
Scott Worley
b61986b2f3 dts: arm: microchip: mec: Add MEC5 HAL based GIRQ information
Microchip MEC SoC's include an interrupt aggregator affecting
the routing of interrupt to the ARM NVIC. IA can not be treated
as a true second level interrupt controller. All interrupt sources
with the exception of GPIOs and eSPI virtual wires can be routed
by IA to individial NVIC inputs. Each bank of GPIOs and VWires
are aggregated into a single NVIC input per bank. For the NVIC
to receive the interrupt signal the respective GIRQ enable must
be set. We attempted to add this informatation by encoding the
DT irq property. This exeperiment failed due to how Zephyr
builds the interrupt tables and MEC IA is not a true second
level interrupt controller. Therefore, drivers for MEC peripherals
need to GIRQ number and bit position to pass to HAL API's or
if a driver is implemented in the linux style without using
the full MEC HAL the GIRQ information is present in DT.

Signed-off-by: Scott Worley <scott.worley@microchip.com>
2025-10-22 08:52:08 +02:00
Titouan Christophe
b677e828d0 drivers: crypto: hash_pkt.in_buf is now constant
Previous commit made the input buffer of the hash packet constant.
Let's therefore adapt typing where used, and remove inappropriate
casts of constant buffers to non-constant ones.

All the "backend" hashing functions already take a constant input,
these changes only affect the "plumbing" between the Zephyr crypto
API and the actual implementation where applicable.

Signed-off-by: Titouan Christophe <titouan.christophe@mind.be>
2025-10-21 22:55:24 +03:00
Titouan Christophe
ebad819d98 crypto: hash: in_buf should be constant
Hashing takes an input buffer, and writes the result in a separate
output buffer. Therefore, the input can be marked as constant, so that
constants can be supplied directly to the hashing context without any
intermediate copy, and without having to perform a type-unsafe cast
from (const uint8_t *) to (uint8_t *)

Signed-off-by: Titouan Christophe <titouan.christophe@mind.be>
2025-10-21 22:55:24 +03:00
Lucien Zhao
c21b6d9e95 boards: nxp: add frdm_mcxe247 board support
- support XIP way to boot
- add board doc and picture
- enable cases below:
    hello_world/blinky/button/
    philosophers/synchronization/
    gpio_basic_api/uart_async_api

Signed-off-by: Lucien Zhao <lucien.zhao@nxp.com>
2025-10-21 22:55:08 +03:00
Lucien Zhao
ae0725bd5c dts: arm: nxp: add mcxe24x device tree
- Use specific_part.dtsi + full_devices.dtsi way to
  desribe all devices

Signed-off-by: Lucien Zhao <lucien.zhao@nxp.com>
2025-10-21 22:55:08 +03:00
Lucien Zhao
057eb6d281 soc: nxp: mcx: add mcxe24x series soc
- create 'mcxe' as family and 'mcxe24x' as series
- add pinctrl_soc.h
- add soc.c/.h to do system initialization
- Support flash boot if CONFIG_MCXE_FLASH_CONFIG==1

Signed-off-by: Lucien Zhao <lucien.zhao@nxp.com>
2025-10-21 22:55:08 +03:00
Lucien Zhao
a044862790 drivers: clock_control: adapt clock driver for mcxe24x series
- add CONFIG_SOC_SERIES_MCXE24X judgment in driver

Signed-off-by: Lucien Zhao <lucien.zhao@nxp.com>
2025-10-21 22:55:08 +03:00
Lucien Zhao
eebdcb7b4b dts: bindings: flash_controller: add nxp,kinetis-ftfc.yaml
- add nxp,kinetis-ftfc.yaml for mcxe24x flash controller

Signed-off-by: Lucien Zhao <lucien.zhao@nxp.com>
2025-10-21 22:55:08 +03:00
Lucien Zhao
b53ba6043a drivers: clock_control: add nxp_mc_cgm clock driver
- add clock_init function to initialize clock sources according
  devicetree settings
- finish basic clock api function

Signed-off-by: Lucien Zhao <lucien.zhao@nxp.com>
2025-10-21 22:55:08 +03:00
John Batch
fd3770d687 drivers: adc: Adding Infineon HPPASS ADC tests
Adding files to allow running the following tests for the Infineon
HPPASS SAR ADC driver on the PSOC C3 family of MCUs:
  * tests/drivers/adc/adc_api
  * tests/drivers/adc/adc_error_case
Modifies the adc_error_cases test to use add a KConfig option
for the valid resolution.

Signed-off-by: John Batch <john.batch@infineon.com>
2025-10-21 22:54:55 +03:00
John Batch
1bb33cde81 drivers: adc: Adding Infineon HPPASS ADC samples
Adding files to allow running the following samples for the
Infineon HPPASS SAR ADC driver on the PSOC C3 family of MCUs:
  * samples/drivers/adc_dt
  * samples/drivers/adc_sequence

Signed-off-by: John Batch <john.batch@infineon.com>
2025-10-21 22:54:55 +03:00
John Batch
75c731cbcc drivers: adc: Infineon HPPASS SAR ADC Driver
Adds HPPASS SAR ADC driver and HPPASS Analog driver files to support
ADC conversion for the PSOC C3 family of MCUs.

Signed-off-by: John Batch <john.batch@infineon.com>
2025-10-21 22:54:55 +03:00
John Batch
3ef1ff3082 dts: infineon: psc3m5 devicetree changes to support HPPASS ADC
* Separates HPPASS and HPPASS SAR ADC in the device tree
 * Makes HPPASS SAR ADC a child of the HPPASS system to reflect hardware
   architecture.
 * Adds binding files for HPPASS SAR ADC driver.

Signed-off-by: John Batch <john.batch@infineon.com>
2025-10-21 22:54:55 +03:00
Daniel Leung
38d49efdac kernel: mem_domain: keep track of threads only if needed
Adds a new kconfig CONFIG_MEM_DOMAIN_HAS_THREAD_LIST so that
only the architectures requiring to keep track of threads in
memory domains will have the necessary list struct inside
the memory domain structs. Saves a few bytes for those arch
not needing this.

Also rename the struct fields to be most descriptive of what
they are.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2025-10-21 22:54:44 +03:00
Daniel Leung
579225f370 tests: kernel/smp: intel_adsp needs more relaxing NOPs
It has been observed that, during the switching stress test,
the context switching becomes very slow due to enough CPUs
doing RCW transaction on hardware bus (e.g. spin locks).
Since the number of NOPs are the same for all CPUs, they are
simply entering and exiting the relax loop at the same time,
and hitting the bus with RCW transactions at the same time.
Not exactly a deadlock but it slows down the execution
enough to result in the test timing out. The SoC layer has
added an option to offset the number of NOPs per CPU by
adding the CPU to the number of NOPs. So enabling it for
the Intel ADSP boards to workaround the above mentioned
issue. I haven't encountered another slowdown after turning
on this option. So hopefully this lowers the probability of
that happening such that a simple retry can pass the test.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2025-10-21 22:54:34 +03:00
Daniel Leung
5ec79bf556 soc: intel_adsp/ace: allows more spin relax loop per CPU
This allows adding the CPU ID to the number of NOPs in
the custom arch_spin_relax(). With the same number of NOPs
for all CPUs, it is possible to have them all doing RCW
transactions at the same time over and over again if they
enter and exit the spin relax loop at the same time.
This behavior has been observed when doing lots of context
switching, like in the SMP switching stress test. So adds
a new kconfig to fine tune the relax loop behavior if
needed. The new kconfig allows adding the CPU ID to
the number of NOPs which will add some minimal offsetting
to workaround the above mentioned situation.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2025-10-21 22:54:34 +03:00
Mathieu Choplain
bccf183531 samples: subsys: usb: testusb: improve usage instructions
Add some content in the testusb sample's README to provide a few more hints
that can be handy for USB newcomers trying to get the sample running along
with testusb.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2025-10-21 22:54:06 +03:00
Felix Wang
fe247a92c5 tests: drivers: pwm: pwm_loopback: Enable QTMR test.
Provide kconfig conf file to set timing parameters.
Provide overlay file for QTMR channel and pin configuration.

Signed-off-by: Felix Wang <fei.wang_3@nxp.com>
2025-10-21 22:53:53 +03:00
Felix Wang
8ebc2f42bc tests: drivers: pwm: pwm_loopback: test improvement.
Move TEST_PWM_PERIOD and TEST_PWM_PULSE to kconfig
and update macro name with "CONFIG_" prefix.

The default timing parameters may be too big for timer
peripheral, because they have high frequence, can not
generate such slow PWM wave.

To keep compatibility, the default value in kconfig
are consistent with the code.

Signed-off-by: Felix Wang <fei.wang_3@nxp.com>
2025-10-21 22:53:53 +03:00
Felix Wang
190c6dd567 drivers: pwm: Fix qtmr set cycles bug.
The mcux_qtmr_pwm_set_cycles can not set 100% and 0%
duty cycle PWM wave.
Set output compare setting based on pulse_cycles and
period_cycles:
1. If pulse_cycles is 0, generate 0% duty cycle wave.
2. If pulse_cycles equals period_cycles but not 0,
   generate 100% duty cycle wave.
3. Otherwise toggle output when compare value matched.

Signed-off-by: Felix Wang <fei.wang_3@nxp.com>
2025-10-21 22:53:53 +03:00
Felix Wang
8af0f0387f drivers: pwm: enable pwm capture for qtmr driver
Supported mode: single capture, continus capture,
pulse capture, period capture.

Signed-off-by: Felix Wang <fei.wang_3@nxp.com>
2025-10-21 22:53:53 +03:00
Felix Wang
cfd2e10d41 tests: drivers: pwm: pwm_api: enable qtmr test
Add mimxrt1180_evk_mimxrt1189_cm33_qtmr.overlay for test.

Signed-off-by: Felix Wang <fei.wang_3@nxp.com>
2025-10-21 22:53:53 +03:00
Biwen Li
8e97541ce4 drivers: dma: mcux_edma: get irq number for multi level int
Get irq number when multi level intrerrupts is enabled.

Signed-off-by: Biwen Li <biwen.li@nxp.com>
2025-10-21 22:53:41 +03:00
Biwen Li
fa68798528 drivers: dma: mcux_edma: print SADDR, DADDR
- Print SADDR, DADDR for debugging.

Signed-off-by: Biwen Li <biwen.li@nxp.com>
2025-10-21 22:53:32 +03:00
Luis Ubieda
cb8c8d666e tests: sensor: build_all: Add Async API test validation
This covers both Read-Decode and Streaming mode. Since we haven't had
it there have been a few issues (addressed prior to this commit). From
now on, we should maintain this test similar to the others.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2025-10-21 22:53:20 +03:00
Luis Ubieda
c1b5cc4c3f tests: sensor: build_all: Add ADXL345 to SPI tests
Additionally, add fifo-watermark property required for Streaming mode.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2025-10-21 22:53:20 +03:00
Luis Ubieda
4ca0f189fe sensor: icm45686: Fix build-time failure on I3C mode
Missed while simplifying RTIO bus transfers on #94832.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2025-10-21 22:53:20 +03:00
Luis Ubieda
f28b1b74b1 sensor: all: Fix missing result argument on RTIO callbacks
If there's an error/result checked, consider the callback result in
such solution.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2025-10-21 22:53:20 +03:00
Nicolas Pitre
8d1da57d57 kernel: mmu: k_mem_page_frame_evict() fix locking typo
... when CONFIG_DEMAND_PAGING_ALLOW_IRQ is set.

Found during code inspection. k_mem_page_frame_evict() is otherwise
rarely used,

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2025-10-21 22:53:04 +03:00
Nicolas Pitre
d93561da68 samples: zbus: benchmark: Filter SMP from benchmark_sync test
The benchmark_sync test produces incorrect results on SMP systems due to
a race condition between the producer thread and subscriber threads that
only occurs with parallel execution.

Thread configuration:
- Producer thread: priority 5 (lower priority, runs later)
- Subscriber threads (8): priority 3 (higher priority, runs first)

Expected behavior on uniprocessor:
  1. Producer publishes message
  2. Subscriber immediately preempts producer (priority 3 < 5)
  3. Subscriber processes message, calls atomic_add(&count, 256)
  4. Producer resumes, continues to next message

  Result: All messages counted before producer checks final count.

Race condition on SMP:
  CPU 0 (Producer):              CPU 1-3 (Subscribers):
  -----------------              ----------------------
  Publish msg 1
  k_msgq_put(sub1) ✓
                                 k_msgq_get() → processing
  Publish msg 2
  k_msgq_put(sub2) ✓
                                 k_msgq_get() → processing
  ...continues...
  Publish msg 128 ✓
  atomic_get(&count)             Still processing...
  → Reports incomplete count!    atomic_add() comes later

On SMP, the producer doesn't get preempted since it runs on a different
CPU from the subscribers. It races ahead and checks atomic_get(&count)
while subscriber threads on other CPUs are still processing messages.

Observed results:
- Non-SMP: Bytes sent = 262144, received = 262144 ✓
- SMP: Bytes sent = 262144, received = 260352 ✗ (7 messages lost)

This is a benchmark test design issue, not a zbus bug. The test assumes
subscribers complete before the producer finishes, which doesn't hold on
SMP systems. Filter SMP configurations from this test variant for now.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2025-10-21 22:52:47 +03:00
Nicolas Pitre
43371bc7ee samples: zbus: msg_subscriber: Filter SMP from pool exhaustion tests
The "_too_small" test variants intentionally configure an isolated buffer
pool with only 2 buffers to validate proper error handling when the pool
is exhausted during notification of 16 msg_subscriber observers. These
tests are likely to fail on SMP systems due to a buffer recycling race
condition:

Expected behavior (uniprocessor):
  Publisher Thread:
    1. Allocate buf1 for bar_msg_sub1 ✓
    2. k_fifo_put(sub1_fifo, buf1)
    3. Allocate buf2 for bar_msg_sub2 ✓
    4. k_fifo_put(sub2_fifo, buf2)
    5. Try allocate buf3 for bar_msg_sub3 → FAIL -ENOMEM

  Subscriber threads process messages after notification completes,
  pool exhausts at subscriber #3 as expected.

SMP race condition:
  CPU 0 (Publisher):         CPU 1 (bar_msg_sub1):  CPU 2 (bar_msg_sub2):
  ------------------         ---------------------  ---------------------
  Alloc buf1 ✓
  k_fifo_put(sub1, buf1)
                             k_fifo_get() → buf1
                             zbus_sub_wait_msg()
                             net_buf_unref()
                             → buf1 FREED!
  Alloc buf2 ✓
  (reuses buf1!)
  k_fifo_put(sub2, buf2)
                                                    k_fifo_get() → buf2
                                                    net_buf_unref()
                                                    → buf2 FREED!
  Alloc buf3 ✓
  (reuses buf1 again!)
  ...continues...
  All 16 allocations succeed!

On SMP systems, subscriber threads on other CPUs may consume and free
buffers quickly enough that they are recycled back to the pool before the
publisher's notification loop can exhaust it. The test's assumption that
notification completes before subscribers run does not hold with parallel
execution.

Since this is a test design limitation (not a zbus bug), filter SMP
configurations from these specific test variants rather than attempt to
artificially slow down subscribers or change thread priorities.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2025-10-21 22:52:47 +03:00
Allen Zhang
35c3698448 dts: mcxw23x: Correct the flash0 in common dtsi
According to the RM, erasing must be done per sector. So, the start
address and the size of an erase operation must be a multiple of 8192
bytes. So, the erase-block-size should be 8192 bytes.
Programming can be done per phrase (start address and size a multiple
of 16 bytes). So, write-block-size should be 16 bytes.

Signed-off-by: Allen Zhang <chunfeng.zhang@nxp.com>
2025-10-21 22:52:37 +03:00
Neil Chen
8a11ef30f9 soc: nxp: mcx: update config NUM_IRQS value
Update mcxa NUM_IRQS value according to part number.
Correct mcxn NUM_IRQS value to 156.

Signed-off-by: Neil Chen <cheng.chen_1@nxp.com>
2025-10-21 22:52:11 +03:00
Alessandro Manganaro
6ceeb56d53 drivers: bluetooth: hci: fix a typo in stm32wbax ble hci driver
Typo fix in assert condition used by stm32wbax ble hci driver.

Signed-off-by: Alessandro Manganaro <alessandro.manganaro@st.com>
2025-10-21 22:52:02 +03:00
Robert Lubos
f7e51d7b5c net: sockets: tls: Remove leftover todo comment
Logs were added, but the todo comment about this was overlooked,
remove it.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-10-21 22:51:49 +03:00
Torsten Rasmussen
c6c08e0390 MAINTAINERS: mone Kconfig into maintained
Move Kconfig into maintained state and add tejlmand as maintainer.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2025-10-21 22:51:29 +03:00
Eric Ocasio
196a1da504 pmci: mctp: samples: Add support for MCTP over USB.
Adds support for the USB device binding for MCTP. Binding created based on
the DMTF specification for USB Transport Binding. The overall design of
this binding follows the existing UART and I2C+GPIO bindings that already
exist in Zephyr.

Signed-off-by: Eric Ocasio <eric.ocasio@nxp.com>
2025-10-21 12:25:56 -04:00
Clément Laigle
fc2e63048b drivers: sensor: omron 2smpb_02e: add FPU selection
Co-authored-by: Luis Ubieda <luisubiedas@gmail.com>
Signed-off-by: Clément Laigle <c.laigle@catie.fr>
2025-10-21 12:25:45 -04:00
Clément Laigle
3920294751 drivers: sensor: add support for OMRON 2SMPB_02E pressure sensor
Support for the OMRON 2SMPB_02E digital barometric pressure sensor.

Signed-off-by: Clément Laigle <c.laigle@catie.fr>
2025-10-21 12:25:45 -04:00
Neil Chen
df4f70469e boards: frdm_mcxa344: add frdm_mcxa344 board
enable board support for frdm_mcxa344

Signed-off-by: Neil Chen <cheng.chen_1@nxp.com>
2025-10-21 12:25:29 -04:00
Neil Chen
4b3eb6cc69 soc: mcxa344: add SOC support for MCXA344
Add soc MCXA153 for board frdm_mcxa344

Signed-off-by: Neil Chen <cheng.chen_1@nxp.com>
2025-10-21 12:25:29 -04:00
Neil Chen
015c593303 dts: mcxa344: add dts for MCXA344
add dts support for board frdm_mcxa344

Signed-off-by: Neil Chen <cheng.chen_1@nxp.com>
2025-10-21 12:25:29 -04:00
Tahsin Mutlugun
9625f00929 boards: adi: Add MAX32658EVKIT secure and nonsecure boards
Adds MAX32658EVKIT board with secure and nonsecure variants.

Signed-off-by: Tahsin Mutlugun <Tahsin.Mutlugun@analog.com>
2025-10-21 12:25:13 -04:00