1-byte write in mt9m114_write_reg() was not assigned to `val` variable,
which caused uninitialized value to be written to the register, and
causing corrupted / invalid byte write.
Introduced from commit e3a7a32334
Signed-off-by: Hong Nguyen <hong.nguyen.k54@gmail.com>
Following #109468, GPIO is now disabled by default on STM32 boards.
On the other hand, the STM32 LTDC driver optionally uses 2 GPIOs to
control the display on/off and backlight, and will configure them
automatically when they are given in the device tree. Consequently,
without any further change, this leads to this kind of error:
[00:00:00.000,000] <err> stm32_gpioport_mgr:
Attempting to use GPIO API without enabling it!
[00:00:00.000,000] <err> display_stm32_ltdc:
Configuration of display on/off control GPIO failed
(as seen with samples/drivers/display on STM32H7S78-DK)
Therefore enable GPIO when the LTDC uses them.
Signed-off-by: Titouan Christophe <titouan.christophe@mind.be>
When enabling CONFIG_NET_L2_ETHERNET_RESERVE_HEADER
and increasing CONFIG_NET_BUF_DATA_SIZE a net_pkt can
just contain one fragment, for that we need to make sure, that
the first and last bit can be set at the same time.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
- Add DMA transfer mode handling in the QSPI MSPI transceive path
- Allow HAL QSPI to configure DMA direction per transfer
instead of setting a fixed direction during DMA setup.
Signed-off-by: Mohammad Odeh <zephyr@exalt.ps>
Add an 'i2s' shell that streams a generated test tone over any I2S
controller via the generic i2s.h API: 'i2s tone start <dev> [hz]
[rate]', 'i2s tone stop' and 'i2s tone info'. Transport-only pairs
with the 'codec' shell to route audio through a codec.
Gated by CONFIG_I2S_SHELL.
Signed-off-by: Alexpandi Muniyandi <alexpandi@linumiz.com>
Add gyro_odr to the encoded header so the decoder knows the sample
rate. Fix base_timestamp_ns to reflect the time of the first FIFO
sample (trigger_time - (N-1)*period) and add timestamp_delta per
sample, matching the lsm6dsv16x reference implementation.
Fixes: #98720
Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
(cherry picked from commit 396a5615ee758c156fc340b3e2a496b6d1590ffc)
Add accel_odr to the encoded header so the decoder knows the sample
rate. Fix base_timestamp_ns to reflect the time of the first FIFO
sample (trigger_time - (N-1)*period) and add timestamp_delta per
sample, matching the lsm6dsv16x reference implementation.
Fixes: #98720
Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
(cherry picked from commit 674f1aff9143bbd8191eff4844fd5d84c938e421)
Adjust base_timestamp_ns backward from the trigger timestamp by
(N-1)*period so it reflects the time of the first FIFO sample,
matching the lsm6dsv16x reference implementation.
Fixes: #98720
Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
(cherry picked from commit 6fa8569d5ded7c6a2578ea3b30a5033861224497)
Adjust base_timestamp_ns backward from the trigger timestamp by
(N-1)*period so it reflects the time of the first FIFO sample,
matching the lsm6dsv16x reference implementation.
Fixes: #98720
Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
(cherry picked from commit beb67e32e8e91250ec1ed877c89e4b140fd95673)
Adjust base_timestamp_ns backward from the trigger timestamp by
(N-1)*period so it reflects the time of the first FIFO sample,
matching the lsm6dsv16x reference implementation.
Fixes: #98720
Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
(cherry picked from commit 31e23771424d99a99392a94ae459be836d91dc3c)
Record base_timestamp_ns as the time of the first sample in the FIFO
by adjusting backward from the trigger timestamp using the total frame
count and ODR period, matching the lsm6dsv16x reference implementation.
Fixes: #98720
Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
(cherry picked from commit 36386844a6a0da009cca6bc730034f849e4b9dcf)
This reverts commit 794134a5ab.
NOTE: This is not a pure revert as conflicts needed to be resolved.
The "simplified" version was incorrect as it did not properly
account for elapsed cycles. This accounting lapse would allow
the timer to get programmed for some point in the past. As a
result, the timer would no longer be firing as expected.
Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
In the initialization function, when calling out to other functions,
save the returned status code in a dedicated variable which can then be
used to (1) print the error code in the LOG_ERR() message and (2) return
the error code as-is to the initialization function's caller.
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
The REGULATOR_STM32_VREFBUF_INIT_PRIORITY Kconfig option is only needed
when the associated driver is enabled. Gate it behind the driver option
REGULATOR_STM32_VREFBUF instead of merely whether a node is enabled,
DT_HAS_ST_STM32_VREFBUF_ENABLED.
Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
Fix standalone HL78XX builds when optional low-power, GPIO, KSTATEV, and
IPv6 paths are disabled or enabled in different combinations.
Guard low-power registration bootstrap state behind
CONFIG_MODEM_HL78XX_LOW_POWER_MODE so builds without low-power support do
not reference low-power-only status fields.
Only keep the modem config pointer in hl78xx_init() when GPIO validation
is compiled in, and compile the GPIO validation block only when at least
one GPIO is configured.
Build the LTE-disable/GSM-enable registration status script only when
KSTATEV URC support is available and the GSM or AutoRAT paths require it.
Update IPv6 socket state references to use the grouped network.ipv6
storage.
Signed-off-by: Zafer SEN <zafersn93@gmail.com>
Instantiate HL78XX modem, GNSS, and socket offload devices by devicetree
node instead of by DT_DRV_COMPAT instance.
This allows the standalone driver to support multiple HL78XX compatibles
without relying on a single active DT_DRV_COMPAT value. Generate unique
config, data, PM, and offload identifiers from the devicetree node hash.
Replace the HL78XX variant choice with hidden symbols selected by the
presence of matching devicetree nodes. This lets HL7800, HL7802, HL7810,
and HL7812 support be enabled from devicetree instead of requiring a
manual Kconfig variant selection.
Update modem, GNSS, and socket offload instantiation to use
DT_FOREACH_STATUS_OKAY() for the supported HL7800 and HL7812 compatible
nodes.
Signed-off-by: Zafer SEN <zafersn93@gmail.com>
Create APLIC direct mode test cases to exercise APLIC with direct mode,
and include direct-mode QEMU in places where other qemu_riscv32 variants
are included.
Signed-off-by: Omar Naffaa <onaffaa@qti.qualcomm.com>
Move the per-SoC clock logic out of the single clock_control_esp32.c
into two family files selected at build time: one for the RTC_CNTL
based parts (esp32, s2, s3, c2, c3) and one for the PMU/LP_CLKRST
based parts (c5, c6, h2, p4). Shared device API ops, init and the
common includes move to a shell file and a private header.
This removes the cross-series preprocessor chains that dominated the
CPU and slow-clock routines and matches how other multi-SoC clock
drivers are organized in the tree.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
data is only used if CONFIG_I2C_TARGET is enabled.
Let's move its declaration into that ifdef to avoid a compiler
warning.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
The SPI_STM32_BUSY_FLAG_TIMEOUT option had no help text, leaving
users with no explanation of its purpose when browsing menuconfig. Add
a description that documents how long the driver polls for the BSY flag
to clear after a DMA transfer on STM32F7 and STM32L4 devices affected
by the busy-flag errata.
Assisted-by: OpenAI Codex:gpt-5
Signed-off-by: Collins Culbert <coculbert@icloud.com>
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 (STM32F40x/41x), Rev 18, section 2.10.1
- ES0392 (STM32H74x/75x), Rev 15, section 2.19.4
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.
This change (including description above) port commit 74ae38ceeb
("drivers: i2c: stm32: ignore spurious BERR in controller mode") in
the STM32 I2C RTIO drivers.
Reword inline comments and make them consistent across STM32 I2C v1 and
v2 drivers, non-RTIO and RTIO.
Co-authored-by: Raguraj Rajendran <raguraj.rajendran@rapyuta-robotics.com>
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
When BTF fires after the last byte is transmitted, it calls handle_txe()
with data->xfer_len already at 0. The else branch generates a stop
condition and signals completion, but does not disable ITBUFEN first.
Since TXE is level-triggered and remains asserted until DR is written,
the event ISR can re-fire on the stale TXE flag.
During a write-read combined transfer (e.g., register read), the write
phase completes and msg_read() calls enable_transfer_interrupts() which
re-enables ITBUFEN. However, the TXE flag from the write phase is still
asserted (hardware only clears it on DR write or ADDR clear). The event
ISR sees TXE=1 but is_write is now false, so no handler matches and the
ISR returns without clearing TXE — causing an infinite interrupt loop.
Catch TXE active during a read transfer Iin i2c_stm32_event() and
disable ITBUFEN to quench the stale TXE interrupt source.
Re-enable ITBUFEN after clearing ADDR in handle_addr(). The ADDR
clear implicitly clears TXE, so re-enabling ITBUFEN at this point
is safe and ensures RXNE interrupts work correctly for the read
phase.
This change (including the above description) ports commit 83f8c21a23
("drivers: i2c: stm32_v1: fix ISR storm on write-read repeated START")
in the STM32 I2C v1 RTIO driver.
Co-authored-by: Gowtham Palanichamy <gowtham.palanichamy@rapyuta-robotics.com>
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
When BTF fires after the last byte is transmitted, it calls handle_txe()
with data->xfer_len already at 0. The else branch generates a stop
condition and signals completion, but does not disable ITBUFEN first.
Since TXE is level-triggered and remains asserted until DR is written,
the event ISR can re-fire on the stale TXE flag.
Add LL_I2C_DisableIT_BUF() at the top of the else branch as a defensive
measure so the level-triggered TXE cannot re-enter the ISR after the
transfer is logically complete.
This change (including the description above) ports commit 83f8c21a23
("drivers: i2c: stm32_v1: disable ITBUFEN in handle_txe on completion")
in the STM32 I2C v1 RTIO driver.
Co-authored-by: Gowtham Palanichamy <gowtham.palanichamy@rapyuta-robotics.com>
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Fix handling of cancelled transfers in MCUX USB device controller
drivers (EHCI and IP3511). When a transfer is cancelled, the MCUX
controller returns USB_CANCELLED_TRANSFER_LENGTH as the transfer
length. Previously, this special value was treated as a valid
transfer length and callback 0 for this transfer, causing incorrect
transfer operations in class codes.
Add proper detection of cancelled transfers by checking for
USB_CANCELLED_TRANSFER_LENGTH and returning -ECONNABORTED error
code.
Signed-off-by: Mark Wang <yichang.wang@nxp.com>
Add a native Zephyr WiFi driver for the BL616/BL618 SoC family.
The driver interfaces with the vendor macsw blob through wl80211 and
implements the Zephyr wifi_mgmt API for station connect/disconnect,
scanning, and AP mode. WPA supplicant integration is provided via
the hostap subsystem.
Signed-off-by: William Markezana <william.markezana@gmail.com>
Extend bflb_rf_init() to support WiFi mode (WL_API_MODE_ALL) with
TX power targets and country code configuration when CONFIG_BFLB_WIFI
is enabled.
Add WiFi platform glue: MAC ISR wiring, task creation, low-power
stubs, wl80211 RTOS primitives (heap, RNG, timers), and the linker
section for WiFi shared RAM.
Introduce CONFIG_BFLB_BL61X_WL_RMEM_SIZE for PHY/RF retention memory
sizing.
Signed-off-by: William Markezana <william.markezana@gmail.com>
Correct inline comment that should refer to DT_DRV_INST() macro
instead of DT_DRV_COMPAT macro.
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
The comma was removed during the migration in commit ad1e5ac253. All
usages of this driver inside the Zephyr tree use only one channel,
which doesn't trigger the issue.
Signed-off-by: Marek Maškarinec <marek@mrms.cz>
The variable ret was not used, and the compiler warned as much.
Let's just remove it.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Update the driver used for ESP32, ESP32-S2 and ESP32-S3 to the
latest version and add support for ESP32-P4.
Signed-off-by: Tiago Medicci <tiago.medicci@espressif.com>
- Removes the compile-time guard so the peripheral clock is always
enabled in the driver init path, ensuring the WWDT registers
are accessible.
Otherwise, at least for MCXA, WWDT register access by
mcux_wwdt_config_func()->WWDT_ClearStatusFlags() triggers
data bus fault.
- Tested on frdm-mcxa266.
Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
Add bus recovery in STM32 I2C RTIO drivers using a work to ensure it
does not execute from an interrupt context. For sake of simplicity,
always use this sequence even if the initial call already executes
from a thread context.
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Move the STM32 bus recovery sequence to STM32 I2C common driver
to factorize when used with the RTIO drivers flavors.
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Support collection of the most common ethernet statistics.
This currently does not utilize any hardware statistics counters,
but rather collects the stats in software.
Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
Add blobs presence dependency to the KConfig IEEE802154_STM32WBA
Add zephyr_blobs_verify() CMake function for STM32 HAL
Signed-off-by: Vincent Tardy <vincent.tardy@st.com>
Add pre-checks on w_index before accessing target_in_buffer to prevent
OOB memory access triggered by an oversized I2C transaction.
Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
Lis2dh interrupts were only fired for up events. Fixed it by adding
down event enable bits to the ANYM_CFG.
Signed-off-by: Matthias Alleman <matthias.alleman@basalte.be>