From f6554b6135a1ca9cb4b2aa05b7cbc94f828ed996 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 6 Jul 2010 16:44:00 +0000 Subject: [PATCH] git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2061 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/STM32/spi_lld.c | 8 ++++---- readme.txt | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/os/hal/platforms/STM32/spi_lld.c b/os/hal/platforms/STM32/spi_lld.c index af4fdfc3d..c70e127e8 100644 --- a/os/hal/platforms/STM32/spi_lld.c +++ b/os/hal/platforms/STM32/spi_lld.c @@ -87,14 +87,14 @@ static void spi_start_wait(SPIDriver *spip, size_t n, spip->spd_dmatx->CNDTR = (uint32_t)n; spip->spd_dmatx->CCR |= ccr; - /* DMAs start.*/ - spip->spd_dmarx->CCR |= DMA_CCR1_EN; - spip->spd_dmatx->CCR |= DMA_CCR1_EN; - /* SPI enable.*/ chSysLock(); spip->spd_spi->CR1 |= SPI_CR1_SPE; + /* DMAs start.*/ + spip->spd_dmarx->CCR |= DMA_CCR1_EN; + spip->spd_dmatx->CCR |= DMA_CCR1_EN; + /* Wait for completion event.*/ spip->spd_thread = currp; chSchGoSleepS(THD_STATE_SUSPENDED); diff --git a/readme.txt b/readme.txt index fe07dc7a7..68eaa757a 100644 --- a/readme.txt +++ b/readme.txt @@ -59,6 +59,8 @@ ***************************************************************************** *** 2.1.1 *** +- FIX: Fixed race condition in STM32 SPI driver (bug 3025854)(backported to + 2.0.2). - FIX: Fixed H_LOCK and H_UNLOCK redefined with CH_USE_MALLOC_HEAP (bug 3025549)(backported to 2.0.2). - FIX: Added option to enforce the stack alignment to 32 or 64 bits in the