The STM32 I2C V1 and V2 peripherals can generate spurious Bus Error
(BERR) flags in controller mode. This is documented in multiple
errata sheets:
- ES0182 (STM32F405/407/415/417) section 2.10.1
- ES0305 (STM32F412) section 2.11.1
- ES0206 (STM32F2) section 2.10.1
The recommended workaround is to clear the BERR flag and take no
further action, letting the transfer continue normally. If a real
bus error occurs, the transfer will time out.
The V2 driver already had a comment documenting this errata but
the code still aborted the transfer with is_err=1 and goto end.
Fix both V1 and V2 drivers to return 0 (continue) in controller
mode when BERR is detected. In target mode, BERR is still reported
as a real error since the errata only applies to controller mode.
Signed-off-by: Raguraj Rajendran <raguraj.rajendran@rapyuta-robotics.com>
Simplify the `modem_cellular.c` file by pulling out all the individual
modem macros and instantiation to a dedicated file per modem.
Signed-off-by: Jordan Yates <jordan@embeint.com>
Move the common 3GPP message handlers to the header to enable OOT modems
to use the common implementations.
Signed-off-by: Jordan Yates <jordan@embeint.com>
Replace the placeholder help text for BT_STM32_IPM with a short
description of the driver. This makes the option clearer in Kconfig
interfaces and avoids leaving a visible TODO in user-facing text.
Signed-off-by: Manaam Rehan <manaamrehan2k19@gmail.com>
Current implementation does not allow omitting a port. Also, if a port is
disabled, the last port is not present in ports array.
Use fixed index for each port in ports array, i.e. porta is always index 0,
portb is index 1, etc. If a port is ommitted or disabled, NULL is assigned
instead of port address.
Signed-off-by: Michal Smola <michal.smola@nxp.com>
Create a parent-child relation for I2C-I3C APIs, this allow
DEVICE_API_IS(i2c, i3c_dev) to return true.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
Add driver supporting the comp module in TI MSPM0 G and L series
with interrupt trigger and reference voltage support.
Add a window comparator mode feature for mspm0 g series
Signed-off-by: Alexpandi Muniyandi <alexpandi@linumiz.com>
The supplicant's mbedTLS crypto backend always compiles
crypto_mbedtls-ec.c when ESP32_WIFI_MBEDTLS_CRYPTO is enabled, so
the ECC PSA primitives it references are required regardless of
WPA3-SAE. Building with only ESP32_WIFI_MBEDTLS_CRYPTO=y previously
emitted PSA warnings because the ECC selects lived solely under
ESP32_WIFI_ENABLE_WPA3_SAE.
Move the always-needed ECC selects (ECDH, ECDSA, SECP_R1_256,
KEY_PAIR_BASIC, KEY_PAIR_IMPORT, PUBLIC_KEY) onto
ESP32_WIFI_MBEDTLS_CRYPTO. Keep KEY_PAIR_GENERATE and
KEY_PAIR_EXPORT under ESP32_WIFI_ENABLE_WPA3_SAE since those paths
are exercised only by SAE/DPP keypair generation.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
During read operations, the same buffer was previously used for both TX
and RX, causing arbitrary data from the RX buffer to be transmitted on
MOSI. This could lead to unintended signaling on the bus and unreliable
device behavior, including corrupted reads (e.g. incorrect JEDEC ID).
Fix this by separating TX and RX buffers:
- Do not drive MOSI during read transactions (TX buffer set to NULL)
- Initialize the RX buffer to 0 before use
This ensures clean read operations without spurious data on MOSI.
During SPI operation, the TX buffer supports a maximum length of
6 bytes. It was set to 5 bytes, which could lead to a potential
overflow.
Signed-off-by: Flavien Carvalho <flavien.carvalho@wiifor.com>
- Initial implementation for the numaker watchdog timer peripheral.
- Add binding to the m48x series soc.
Signed-off-by: Scott Laboe <scottyl2.718@gmail.com>
Set poll revents even when epoll didn't signal any event. This particularly
fixes the case when epoll didn't have a chance to run (blocking APi with
timeout=0).
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
Propagate 'revents' after calling nsos_adapt_poll_update(), by copying
'poll->mid.revents' (which gets updated by this function) to the
'pfd->revents' object (which is read by caller function).
Fixes: ea44e2715a ("drivers: net: nsos: update unwatched file descriptor
with poll()")
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
Use nsi_host_{*alloc,free,strdup} to utilize host side libc heap memory.
This removes dependency on Zephyr heap configurations: kernel heap and
embedded libc heap.
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
If both CONFIG_MSPI_DMA and
CONFIG_MSPI_DW_HANDLE_FIFOS_IN_SYSTEM_WORKQUEUE are enabled then
a compilation error would occur as dev_data would be defined twice.
Signed-off-by: David Jewsbury <david.jewsbury@nordicsemi.no>
Add logging/log.h include instead of relaying on it being included
indirectly from other headers
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Add logging/log.h include instead of relaying on it being
included indirectly from other headers
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Don't clear DMA status flags when DMA controller is managed by the HAL.
The same logic was introduced in the dmav1/dmav2 driver by commit
110c61bfea.
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
config->adc is of type 'const struct device *', assigned via
DEVICE_DT_GET(). It has no '.dev' member — that field exists only
in 'struct adc_dt_spec'.
The LOG_ERR_DEVICE_NOT_READY() call in lpadc_temp40_init() was
using config->adc.dev, causing a compile error on all platforms
that select NXP_PMC_TMPSNS:
error: 'config->adc' is a pointer; did you mean to use '->'?
Remove the spurious '.dev' dereference. LOG_ERR_DEVICE_NOT_READY()
accepts 'const struct device *' directly, so passing config->adc
is correct and consistent with the device_is_ready() call on the
line above.
Signed-off-by: Bartlomiej Fijal <StaryAnoda@Gmail.com>
config->adc is of type 'const struct device *', assigned via
DEVICE_DT_GET(). It has no '.dev' member — that field exists only
in 'struct adc_dt_spec'.
The LOG_ERR_DEVICE_NOT_READY() call in lpadc_temp40_init() was
using config->adc.dev, causing a compile error on all platforms
that select NXP_LPADC_TEMP40:
error: 'config->adc' is a pointer; did you mean to use '->'?
Remove the spurious '.dev' dereference. LOG_ERR_DEVICE_NOT_READY()
accepts 'const struct device *' directly, so passing config->adc
is correct and consistent with the device_is_ready() call on the
line above.
Signed-off-by: Bartlomiej Fijal <StaryAnoda@Gmail.com>
When flash_stm32_xspi_init() returns early in the XIP fast path it
leaves layout.pages_size unset. This causes problems for code that
relies on the page layout being available, even in XIP mode. This
commit adds a fallback to ensure a valid page layout is always
available.
Signed-off-by: Julien Racki <julien.racki-ext@st.com>
Add a die temperature sensor driver for Bouffalo Lab SoCs using
the internal TSEN peripheral integrated into the GPADC.
The driver uses the ADC subsystem for hardware initialization and
raw sample acquisition via adc_bflb_tsen_read_phase(). Temperature
is computed from two ADC measurement phases (TSVBE_LOW toggle)
using the formula: temp = (|v0 - v1| - tsen_offset) / 7.753
The TSEN calibration offset is read from efuse when available,
falling back to the default value of 2042.
Includes:
- Sensor driver at drivers/sensor/bflb/bflb_tsen/
- DT binding for compatible "bflb,tsen"
- TSEN nodes (disabled) in bl60x, bl61x, bl70x, bl70xl dtsi files
Tested on BL602, BL616, BL706, and BL704L hardware.
Signed-off-by: William Markezana <william.markezana@gmail.com>
Add temperature sensor (TSEN) support to the BFLB ADC driver.
When input_positive is set to the TSEN channel (14), the driver
automatically configures CONFIG2 for TSEN mode: enables TS_EN,
sets VREF to 2.0V, CHOP_MODE to Vref AZ, and clears test/debug
bits. ADC calibration is skipped for TSEN channels since the
temperature formula uses raw values.
A new adc_bflb_tsen_read_phase() function is exposed for the TSEN
sensor driver to perform the two-phase measurement (TSVBE_LOW
toggle) needed for temperature calculation.
Also makes efuse calibration failure non-fatal (warning instead
of error) since some chips lack programmed trim data.
Signed-off-by: William Markezana <william.markezana@gmail.com>
The current flow sets CS before the SPIM peripheral actually drives
the bus. This can cause SCK to be in the incorrect initial state
dictated by CPOL. New flow enables SPIM after it has been configured,
before CS is set, and disabled is after CS is cleared, thus the bus
is driven by SPIM during the entire transfer.
Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
The gpiote_nrfx.h header is needed for a macro used when handling
NRF52_ANOMALY_58
Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
The spi context tx_buf, rx_buf, tx_count and rx_count members are
modified during the transfer. These members are currently accessed
in spi_context_wait_for_completion when calculating the expected
timeout, which happens concurrently with the transfer being in
progress. This can lead to concurrency issues as the mentioned
members may be modified independently as they are being accessed by
the thread setting up the wait.
Remove this potential conflict by calculating the number of bytes
as part of spi_context_buffers_setup and store it, before the
transfer is started. Then used the stored value when setting up
the wait.
Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
Ensure SPI pins are correctly configured before setting CS, by
configuring the SPIM before setting CS.
Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
The common pm_suspend implementation for the spi_nrfx_spim drivers
unconditionally sets the sleep state. The sleep state may not be
available, in which case we should not try to set it. Check
CONFIG_PINCTRL_KEEP_SLEEP_STATE and only try to set sleep state if
true.
Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
The header at drivers/spi/rtio.h was moved to a relative path, and
renamed "spi_rtio.h".
Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
Add soc-nv-flash child nodes to the six NXP FlexSPI boards
not yet converted: mimxrt595_evk, mimxrt685_evk, vmu_rt1170
(mx25um51345g), and mimxrt1050_evk, mimxrt1060_evk,
mimxrt1062_fmurt6 (hyperflash).
Update FlexSPI NOR and HyperFlash drivers to read
write_block_size from the soc-nv-flash node. Remove
soc-nv-flash.yaml from hyperflash and mx25um51345g
bindings.
Signed-off-by: Ofir Shemesh <ofirshemesh777@gmail.com>
Apply the formatting-only adjustments flagged by the
ClangFormat compliance check in the STM32 I2C v2 driver.
Keep these style-only changes separate from the functional
commits in the branch.
Signed-off-by: Narek Aydinyan <aydinyan.narek@gmail.com>
Use an explicit boolean comparison for the
target-preempt helper call in the IRQ path to address
review feedback without mixing the style-only change
into the functional commits.
Signed-off-by: Narek Aydinyan <aydinyan.narek@gmail.com>
Replace the hard-coded bus-wait timeout with
CONFIG_I2C_STM32_WAIT_BUS_IDLE_TIMEOUT_USEC and use it when
waiting for the bus to become idle before starting a new
controller session with target mode attached.
Keep wait_bus_idle() thread-context only, switch timeout
tracking to k_timepoint_t, and sleep briefly between BUSY
polls.
Also document why the IRQ transfer path resets
device_sync_sem before arming a new transfer.
Signed-off-by: Narek Aydinyan <aydinyan.narek@gmail.com>
In target+controller mode, the STM32 I2C v2 peripheral can
recognize its own target address while a controller transfer is
being started. If the driver stays on the controller path,
target IRQ handling may be blocked and the bus can hang.
Wait briefly for BUSY to clear before starting a new controller
session when target mode is attached. If own-address recognition
still happens after a controller request has been queued, abort
the controller path and continue immediately with target
handling.
Fold the later handover-only cleanup into this change so the
branch keeps a single commit for the controller/target race
handling behavior.
Fixes#99074
Signed-off-by: Narek Aydinyan <aydinyan.narek@gmail.com>
In multi-master scenarios, controller mode may mark itself active before
START is actually issued. If the controller then waits for BUSY while an
ADDR event arrives in target mode, target IRQ handling can be blocked,
which may leave the bus stuck.
Abort the pending controller START when ADDR is detected so target-side
handling can proceed correctly.
Fixes#99074
Signed-off-by: Narek Aydinyan <aydinyan.narek@gmail.com>
Add QDEC driver support for Realtek Bee series SoCs,
including RTL87x2G (AON QDEC) and RTL8752H (Basic QDEC).
This driver supports:
- X, Y, and Z axis count reading
- Hardware interrupt-based event trigger
Signed-off-by: Yuzhuo Liu <yuzhuo_liu@realsil.com.cn>
The SAM0 SPI driver previously supported DMA only for asynchronous
operations, which required higher-level drivers needing blocking DMA
transfers to implement workarounds. This patch extends DMA support
to the synchronous transfer path, enabling efficient blocking SPI
transactions without driver-specific hacks.
With this change, both synchronous and asynchronous SPI operations
can leverage DMA for improved performance and reduced CPU overhead.
Signed-off-by: Ramya T <ramya.t@microchip.com>
Signed-off-by: Parthiban Veerasooran <parthiban.veerasooran@microchip.com>
Use the sys_ringq instead of the custom ring_buffer implementation for
SiWx91x I2S driver.
The aim is to reduce code duplication and improve maintainability.
Signed-off-by: Måns Ansgariusson <mansgariusson@gmail.com>