drivers: spi: stm32h7: add a small delay after enabling
Add a small delay after enabling SPI to prevent transfer stalling. Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
This commit is contained in:
parent
1b9645c6a6
commit
c73c7d5728
1 changed files with 10 additions and 0 deletions
|
@ -28,6 +28,8 @@ LOG_MODULE_REGISTER(spi_ll_stm32);
|
||||||
|
|
||||||
#include "spi_ll_stm32.h"
|
#include "spi_ll_stm32.h"
|
||||||
|
|
||||||
|
#define WAIT_1US 1U
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check for SPI_SR_FRE to determine support for TI mode frame format
|
* Check for SPI_SR_FRE to determine support for TI mode frame format
|
||||||
* error flag, because STM32F1 SoCs do not support it and STM32CUBE
|
* error flag, because STM32F1 SoCs do not support it and STM32CUBE
|
||||||
|
@ -643,6 +645,14 @@ static int transceive(const struct device *dev,
|
||||||
|
|
||||||
LL_SPI_Enable(spi);
|
LL_SPI_Enable(spi);
|
||||||
|
|
||||||
|
#if CONFIG_SOC_SERIES_STM32H7X
|
||||||
|
/*
|
||||||
|
* Add a small delay after enabling to prevent transfer stalling at high
|
||||||
|
* system clock frequency (see errata sheet ES0392).
|
||||||
|
*/
|
||||||
|
k_busy_wait(WAIT_1US);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* This is turned off in spi_stm32_complete(). */
|
/* This is turned off in spi_stm32_complete(). */
|
||||||
spi_stm32_cs_control(dev, true);
|
spi_stm32_cs_control(dev, true);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue