zephyr/drivers/spi/Kconfig.stm32
Benedikt Schmidt 3441fee460 drivers: spi: Implement workaround for unreliable busy flag
For some STM32 MCUs the busy flag of SPI is unreliable. This is a known
issue of the device and described in the device errata.
As a fix implement a configurable timeout which ensures that a call
to spi_transceive will eventually return.
Fixes #64927

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2023-11-17 09:22:18 +01:00

54 lines
1.3 KiB
Plaintext

# STM32 SPI driver configuration options
# Copyright (c) 2015-2016 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
menuconfig SPI_STM32
bool "STM32 MCU SPI controller driver"
default y
depends on DT_HAS_ST_STM32_SPI_ENABLED
select USE_STM32_LL_SPI
help
Enable SPI support on the STM32 family of processors.
if SPI_STM32
config SPI_STM32_INTERRUPT
bool "STM32 MCU SPI Interrupt Support"
help
Enable Interrupt support for the SPI Driver of STM32 family.
config SPI_STM32_DMA
bool "STM32 MCU SPI DMA Support"
select DMA
select CACHE_MANAGEMENT if CPU_HAS_DCACHE
help
Enable the SPI DMA mode for SPI instances
that enable dma channels in their device tree node.
config SPI_STM32_USE_HW_SS
bool "STM32 Hardware Slave Select support"
default y
help
Use Slave Select pin instead of software Slave Select.
config SPI_STM32F7_ERRATA_BUSY
bool
default y
depends on SOC_STM32F745XX || SOC_STM32F746XX || \
SOC_STM32F750XX || SOC_STM32F756XX
help
Handles erratum "BSY bit may stay high at the end of a data
transfer in Slave mode".
Seen in Errata Sheet 0290 §2.11.2
if SPI_STM32F7_ERRATA_BUSY
config SPI_STM32_BUSY_FLAG_TIMEOUT
int "timeout in us for the STM32 busy flag workaround"
default 10000
endif # SPI_STM32F7_ERRATA_BUSY
endif # SPI_STM32