From bbb65432d9c51b06feb8c9a3623cec0b593a39ef Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 18 Feb 2014 13:42:20 -0600 Subject: [PATCH] STM32 SPI: Disable SPI before modifying CR1 --- arch/arm/src/stm32/stm32_spi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/src/stm32/stm32_spi.c b/arch/arm/src/stm32/stm32_spi.c index 3f33818574..e66a580a67 100644 --- a/arch/arm/src/stm32/stm32_spi.c +++ b/arch/arm/src/stm32/stm32_spi.c @@ -1110,7 +1110,9 @@ static void spi_setmode(FAR struct spi_dev_s *dev, enum spi_mode_e mode) return; } + spi_modifycr1(priv, 0, SPI_CR1_SPE); spi_modifycr1(priv, setbits, clrbits); + spi_modifycr1(priv, SPI_CR1_SPE, 0); /* Save the mode so that subsequent re-configurations will be faster */