Commit graph

24538 commits

Author SHA1 Message Date
Loic Domaigne
28f37e522a drivers: crypto: crypto_ataes132a fix memset undefined behavior
Coverity reported a memory - illegal accesses when using memset in
ataes132a_aes_ecb_block(). This can happen when the input block is
exactly 16 bytes: memset(&param_buffer[19], 0x0, 0) is called. But this
is an undefined behaviour in C even if size is 0, as &param_buffer[19]
is an invalid pointer.

The fix consists of simply skipping memset() in this case, since there's
nothing to zero out.

Coverity CID: 434642

Signed-off-by: Loic Domaigne <tech@domaigne.com>
2025-07-10 10:13:17 -05:00
Thomas Altenbach
81f95f15fa drivers: flash: stm32_qspi: Fix flash configuration in dual flash mode
When the QSPI is used in dual flash mode, e.g. on the STM32H747I-DISCO
board, only the first flash memory was reset and configured in 4-byte
addressing mode. This was in particular causing data to be incorrectly
read from the second flash memory and only even bytes were valid during
a read.

The dual flash mode was only enabled after reading the SFDP table since
it is desired to read the table of only one flash memory, not both.

This commit changes the driver to only disable the dual mode temporarily
while reading the SFDP table, ensuring all other commands and in
particular configuration commands are sent to both flash memories.

Signed-off-by: Thomas Altenbach <altenbach.thomas@gmail.com>
2025-07-10 10:13:06 -05:00
Luis Ubieda
07c1d010f7 shell: spi: fix typo on spi cs command
Copy-paste error fixed from help text.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2025-07-10 10:12:31 -05:00
Fabrice DJIATSA
1804eb7bc3 drivers: i2c: stm32: exclude stm32f7 family for PM
The STM32F7 family does not yet support power management in Zephyr.

Besides, LL_I2C_EnableWakeUpFromStop and LL_I2C_DisableWakeUpFromStop

are not implemented in the H7 HAL/LL drivers

Signed-off-by: Fabrice DJIATSA <fabrice.djiatsa-ext@st.com>
2025-07-09 17:16:16 -05:00
Sylvio Alves
61147a3841 drivers: spi: esp32: fix volatile array zeroing to use explicit loop
Replace memset() with an explicit loop to zero the data_buf array,
which is part of a volatile struct. Standard memset does not guarantee
volatile stores, which can lead to incorrect hardware access.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2025-07-09 17:14:04 -05:00
Khaoula Bidani
618044ed78 drivers: clock_control: fix PLL input frequency
Correct PLL input frequency calculation to consider
HSI clock divider in clock_stm32_ll_h7.c file.
For sake of simplicity, use PLLSRC_FREQmacro that
already considers the HSI clock divider when applicable.

Signed-off-by: Khaoula Bidani <khaoula.bidani-ext@st.com>
2025-07-09 09:44:25 -05:00
Josuah Demangeon
e0b706b6c6 drivers: video: stm32_dcmipp: move video/ header directory to drivers/
During #89407 a driver-specific header stm32_dcmipp.h got introduced to
support new functionnalities not yet covered by video APIs.
Move this header into a new <include/zephyr/drivers/video/> include
direcctory like what other driver classes do.

Signed-off-by: Josuah Demangeon <me@josuah.net>
2025-07-09 09:42:43 -05:00
Filip Stojanovic
f0b5911d0a sensor: bme280: Fix bad chip id read after power cycle
Fix an issue where the BME280 sometimes returns an incorrect chip ID
immediately after a power cycle. This causes sensor initialization to fail.

According to the datasheet, the sensor requires a 2 ms start-up delay after
power is applied. This patch introduces a sleep delay to ensure the
required start-up time is respected before reading the chip ID.

Signed-off-by: Filip Stojanovic <filipembedded@gmail.com>
2025-07-09 00:25:33 -05:00
Emilio Benavente
0bdb9595b1 drivers: misc: mcux_flexio: Set the DOZEN bit
Setting the DOZEN bit in the flexio so the soc
does not force the peripheral to go into
low power mode when the soc is in idle.

Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
2025-07-09 00:24:14 -05:00
Petri Pitkanen
808ee1713d drivers: bluetooth: silabs: Fix indicating support for 2M phy
Previously we always had driver to support 2M PHY regardless of
configuration. As this was fixed the missing support statemenent
caused 2M support to miss regardless of configuration.

Signed-off-by: Petri Pitkanen <petri.pitkanen@silabs.com>
2025-07-08 13:44:51 -05:00
Fabrice DJIATSA
24af0c8ee1 drivers: pwm: stm32: add stm32h7rs bus prescalers
The clock tree of the STM32H7RS series uses the ppre1
and ppre2 naming convention instead of apb1_prescaler
and apb2_prescaler for bus prescaler.

Signed-off-by: Fabrice DJIATSA <fabrice.djiatsa-ext@st.com>
2025-07-08 13:40:50 -05:00
Jacob Wienecke
112cd172c1 drivers: mdio_nxp_enet_qos: fix CR overwrite
Current Implementation to write to MAC_MDIO_ADDRESS causes CR to be
set to 0. This leads to the divide always being 42 (on FRDM_MCXN947)
so, by default the clock is running at ~3.6MHz which is out of spec
range (1.0-2.5MHz)

This stops the do_transaction function from overwriting CR.
It also saves off the CR register before DMA reset

Signed-off-by: Jacob Wienecke <jacob.wienecke@nxp.com>
2025-07-08 13:40:17 -05:00
Chaitanya Tata
e728f80416 drivers: nrf_wifi: Fix TX drop statistics
In case FMAC API fails, increment the TX drop counter, helpful in
debug.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2025-07-08 13:39:17 -05:00
Luis Ubieda
a2acc86429 fix: icm42688: fix: Override FSR settings when high-res is enabled
When IMU is set to stream with High-res mode, the FSR settings are
fixed for ICM42688 at 16g and 2000dps.

Unless this is enforced, the driver will provide incorrect scaling for
readings coming through streaming when the current FS setting is any
different than these.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2025-07-08 13:38:36 -05:00
Gaetan Perrot
087b7b8890 drivers: ethernet: xilinx: remove unused variable
Clean up unused variable 'ret' and 'link_state' in eth_xilinx_axienet.c to
improve code clarity.

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2025-07-08 13:37:47 -05:00
Gaetan Perrot
c86f570401 drivers: ethernet: sy1xx: remove unused variable
Clean up unused variable 'rand_mac_addr' in eth_sensry_sy1xx_mac.c to
improve code clarity.

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2025-07-08 13:37:47 -05:00
Lidor T
0654fb49d8 counter: cmsdk_apb_timer: Use clock freq from DT clocks
Previously, the CMSDK APB timer driver hardcoded the
counter clock frequency to 24 MHz, which limits reuse
across SoCs and boards with different timer clock
sources.
This patch replaces the hardcoded frequency with a value
derived from the device tree's `clocks` phandle, using
the `clock-frequency` property of the referenced clock
controller node. If the property is missing, it falls
back to a default 24 MHz and issues a build-time
warning.

Signed-off-by: Lidor T <lidor@exibit-iot.com>
2025-07-08 13:36:58 -05:00
Johann Fischer
56b359b8f5 drivers: udc_dwc2: do not throw error when FIFO settings can be reused
When the endpoint is re-enabled, check if the current FIFO settings can
be reused. Further work is needed to improve FIFO memory handling for
more advanced interface configurations.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2025-07-07 16:06:34 -05:00
Armando Visconti
0d7c751bad drivers/sensor: lis2dux12: add 'return' if data has to be dropped
In lis2dux12_read_status_cb() add a return instruction in case of
SENSOR_STREAM_DATA_NOP/SENSOR_STREAM_DATA_DROP.

Fixes: CID 529855

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2025-07-07 16:06:13 -05:00
Armando Visconti
df1832e32d drivers/sensor: lsm6dsv16x: add 'return' if data has to be dropped
In lsm6dsv16x_read_status_cb() add a return instruction in case of
SENSOR_STREAM_DATA_NOP/SENSOR_STREAM_DATA_DROP.

Fixes: CID 529864

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2025-07-07 16:06:13 -05:00
Armando Visconti
79c098a9d9 drivers/sensors: st: fix Null pointer dereferences
Fix Null pointer dereferences in lis2dux12_read_status_cb() and
lsm6dsv16x_read_status_cb().

Fixes: CID 529873
Fixes: CID 529862

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2025-07-07 16:06:13 -05:00
Armando Visconti
1d8bd6bd53 drivers/sensor: lis2dux12: fix uninitialized variable fifo_mode
Set fifo_mode structure to zero and initialize it properly according
to what interrupt event the user has selected.

Fixes: CID 529871
Fixes: CID 529865

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2025-07-07 16:06:13 -05:00
Armando Visconti
5792a429c8 drivers/sensor: lsm6dsv16x: fix unreachable code in decoder_decode()
Fix unreachable code in decoder_decode() as reported by Coverity scan.

Fixes: CID 529878

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2025-07-07 16:06:13 -05:00
Van Petrosyan
960a6f036e sensor: lis2dh: cache CTRL1 on PM_DEVICE_ACTION_TURN_ON
Cache CTRL1 into reg_ctrl1_active_val inside lis2dh_init_chip()
in the PM_DEVICE_ACTION_TURN_ON path.  This prevents the first
runtime-PM RESUME from writing 0x00 to CTRL1 and disabling the sensor
when runtime-PM is enabled.

Fixes: #92196

Signed-off-by: Van Petrosyan <van.petrosyan@sensirion.com>
2025-07-05 11:56:00 -05:00
Yong Cong Sin
9696765b56 drivers: syscon: remove unnecessary checks for dev pointer
The `dev` pointer passed to the implementation should never be `NULL`,
remove the checks.

Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2025-07-04 16:42:53 -10:00
Jordan Yates
9c6e6d781d drivers: lora: rylrxxx: fix snprintf usage
The second argument should unconditionally be the size of the output
memory area, not computationally derived from the input payload length.
The previous length validations would be incorrect when
`cmd_len == CONFIG_LORA_RYLRXX_CMD_BUF_SIZE`, as `snprintf` would be
told the output buffer was `CONFIG_LORA_RYLRXX_CMD_BUF_SIZE + 1` bytes
long.

Fixes #92619
Fixes #92624

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-07-04 16:40:46 -10:00
Peter Mitsis
ec80ab5bb6 drivers: timer: Clean up Cortex-M systick Kconfig
Makes the choice CORTEX_M_SYSTICK_LPM dependent upon the
CORTEX_M_SYSTICK to prevent its default from showing up in
the .config of projects that do not use the CORTEX_M_SYSTICK
timer driver.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2025-07-04 16:40:31 -10:00
Peter van der Perk
41ef8c3c2f drivers: spi_nxp_lpspi: Don't fetch clockrate from api during configure
The clock get rate api can be slow in certain targets and thus slowing
each SPI transaction. Instead on startup fetch the clock rate and store
this in ram. Then each spi configure action is simply reading that
variable

Signed-off-by: Peter van der Perk <peter.vanderperk@nxp.com>
2025-07-04 14:21:35 -10:00
Fin Maaß
19a3b217e5 drivers: ethernet: nxp: don't fail with -EALREADY
don't fail with -EALREADY being returned from
phy_configure_link.

Fixes: #92281
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-07-04 14:20:55 -10:00
Benjamin Cabé
ee2b9a4e6d drivers: virtio: move virtio headers to zephyr/drivers
Virtio headers are moved to zephyr/drivers/ as they have no reason to be
top-level headers since virtio is a driver class.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-07-04 15:49:54 -05:00
Raffael Rostagno
26818ee100 drivers: clock_control: esp32c6: Fix clock init at JTAG reset
Peripheral clocks are currently not being disabled for JTAG reset
condition, which causes driver init failures when debugging the SoC
with JTAG. Fix by disabling all clocks for this reset type.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2025-07-04 15:49:17 -05:00
Gaetan Perrot
9207749e83 drivers: sensor: bma4xx: Avoid potential overflow
Coverity reports a potential integer overflow in the accel_range
computation due to the use of a left shift on an int type.

CID 520269: Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN)

Even though the register value is constrained to 0–3 by the BMA456 spec,
and no real overflow occurs, an explicit cast to int64_t prevents false
positives and aligns with safe coding practices.

Fixes: #90517

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2025-07-04 15:49:09 -05:00
Gaetan Perrot
ad38ef7333 drivers: counter: Fix redundant identical condition
There was an unnecessary nested `if` in `ifx_cat1_counter_init` with the
same condition already checked in the outer block.

This results in dead and redundant code with no functional impact but
harms readability.

The inner `if (rslt != CY_RSLT_SUCCESS)` was removed to clean up the
function.

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2025-07-04 15:48:58 -05:00
Gaetan Perrot
f1c27b6e4a drivers: counter: Fix possible null pointer dereference
The function counter_rz_gtm_set_alarm was accessing alarm_cfg->flags and
alarm_cfg->ticks before verifying that alarm_cfg is non-NULL.

This could lead to undefined behavior or crashes if a NULL pointer is
passed.

The pointer check has been moved before any dereference to fix this bug.

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2025-07-04 15:48:49 -05:00
Ryan McClelland
b6d955c648 drivers: i3c: check addr slot is free only if it's different
The bus helpers for SETDASA and SETNEWDA could have the same
dynamic address assigned as it's static addr for SETDASA or
as it's dynamic addr for SETNEWDA. (Althrough, only a clown
would set the new dynamic address to the same old dynamic
address, it is still a valid address to set to).

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2025-07-04 13:08:33 -05:00
Sylvio Alves
c358861280 drivers: i2c: esp32: drop transfer log error
Drop LOG_ERR calls from driver level related to transfer calls.
Application can handle the result and decide whether to log or not.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2025-07-04 13:08:23 -05:00
Sylvio Alves
5b876d4c4c drivers: uart: esp32: apply correct mask for TX/RX signal inversion
Build a combined mask from the tx_invert and rx_invert flags and pass it
to uart_hal_inverse_signal(). Only invoke the HAL call when the mask is
non-zero, preventing unintended inversions and eliminating redundant
calls when no inversion is requested.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2025-07-04 13:08:14 -05:00
Alain Volmat
772fbfe9cc display: stm32: ltdc: fix RGB565/BGR565 format to match sample expectations
The LTDC RGB565 format corresponds to the PIXEL_FORMAT_BGR565 format.
Update the LTDC driver to advertise PIXEL_FORMAT_BGR565 as the supported
format instead of PIXEL_FORMAT_RGB565. This change ensures correct color
rendering in the sample display application and enables usage of the
video capture sample application.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2025-07-04 13:07:55 -05:00
Alex Hogen
075662d8dc drivers: i2c: gecko: Fix EFM32 I2C target
clang-format on drivers/i2c/i2c_gecko.c

Signed-off-by: Alex Hogen <alex@edt.com>
2025-07-04 13:07:45 -05:00
Alex Hogen
257bcb8d58 drivers: i2c: gecko: Fix EFM32 I2C target
Fix I2C target implementation so NACKs are issued if the callback returns
an error. This allows for proper signaling to the I2C host when commands
or data are invalid for the I2C target.

Signed-off-by: Alex Hogen <alex@edt.com>
2025-07-04 13:07:45 -05:00
Alex Hogen
92f7e8d84b drivers: i2c: gecko: Fix EFM32 I2C target
Fix compile error due to unknown macro when building CONFIG_I2C_TARGET for
Silabs Thunderboard EFM32GG12 (SLTB009A). The previous macro exists in
(all?) EFR32 part headers but not EFM32.

Signed-off-by: Alex Hogen <alex@edt.com>
2025-07-04 13:07:45 -05:00
Van Petrosyan
4197953d3f drivers: modem_cellular: fix bg95dial cmd resp
bg95 modem should respond "CONNECT <text>" when run dial cmd
similar to eg25g

Signed-off-by: Van Petrosyan <van.petrosyan@sensirion.com>
2025-07-04 13:07:12 -05:00
Etienne Carriere
9b022972d8 drivers: rtc: stm32: narrow backup domain access window during interrupts
Change backup domain access gating in STM32 RTC interrupt handler
to only request access when RTC registers ar to be modified
instead of during the whole RTC interrupts service including
interrupt consumer callback execution.

Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
2025-07-04 13:06:36 -05:00
Etienne Carriere
007d3e3c85 drivers: rtc: stm32: fix unbalanced backup domain access request
Fix the backup domain access request in STM32 RTC initialization that
was unbalanced in case of clock configuration failure.

Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
2025-07-04 13:06:36 -05:00
Etienne Carriere
c35ddccce4 drivers: counter: stm32: Fix RTC write access requests
Add missing backup domain access requests in STM32 RTC counter
driver that are needed to modify RTC registers.

Remove backup domain access requests in rtc_stm32_read() since this
function only reads RTC registers and backup domain access protection
protects RTC registers against write accesses only.

Fixes issue 92511.

Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
2025-07-04 13:06:36 -05:00
Gaetan Perrot
de1fa4776b drivers: sensor: bmp581: add const qualifier when casting
Add the 'const' qualifier when casting 'dev->config' to 'struct
bmp581_config *' to preserve const-correctness and fix SonarQube warning :

 "A cast shall not remove any const or volatile qualification from the
 type of a pointer or reference."

This improves maintainability by respecting the const contract and resolve
static analysis issues.

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2025-07-04 13:06:22 -05:00
Gaetan Perrot
032c5301de drivers: sensor: bmp581: fix potential null dereference
Move null check for 'dev' before dereferencing it to access dev->config.

This ensures the check is meaningful and avoids undefined behavior in case
of a null device pointer.

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2025-07-04 13:06:22 -05:00
David Leach
a132ebfe17 drivers: watchdog: Add enableWait setting for wdt_mcux_imx_wdog
When WDT_OPT_PAUSE_IN_SLEEP option is passed in set enableWait flag
in addition to the enableStop.

Fixes #86437

Signed-off-by: David Leach <david.leach@nxp.com>
2025-07-03 11:57:17 -05:00
Jonathan Nilsen
b18c326946 soc: nordic: move nrf_ironside from drivers/firmware to soc/nordic
Move the IronSide APIs to soc/nordic from drivers/firmware since
these are vendor specific APIs. The header files are now included
from <nrf_ironside/*.h>. Adjust code that uses these APIs accordingly.

Also move the DT binding for "nordic,ironside-call" from
bindings/firmware to bindings/misc.

Signed-off-by: Jonathan Nilsen <jonathan.nilsen@nordicsemi.no>
2025-07-02 17:57:45 -05:00
Grzegorz Swiderski
75dd614437 drivers: firmware: nrf_ironside: Update the spelling
s/IRONside/IronSide/g

Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2025-07-02 17:57:45 -05:00