diff --git a/os/hal/platforms/STM32/spi_lld.c b/os/hal/platforms/STM32/spi_lld.c index 265669ee1..0dc47a81e 100644 --- a/os/hal/platforms/STM32/spi_lld.c +++ b/os/hal/platforms/STM32/spi_lld.c @@ -294,15 +294,15 @@ void spi_lld_start(SPIDriver *spip) { RCC->APB1ENR |= RCC_APB1ENR_SPI3EN; } #endif + + /* DMA setup.*/ + spip->spd_dmarx->CPAR = (uint32_t)&spip->spd_spi->DR; + spip->spd_dmatx->CPAR = (uint32_t)&spip->spd_spi->DR; } /* SPI setup.*/ spip->spd_spi->CR1 = spip->spd_config->spc_cr1 | SPI_CR1_MSTR; spip->spd_spi->CR2 = SPI_CR2_SSOE | SPI_CR2_RXDMAEN | SPI_CR2_TXDMAEN; - - /* DMA setup.*/ - spip->spd_dmarx->CPAR = (uint32_t)&spip->spd_spi->DR; - spip->spd_dmatx->CPAR = (uint32_t)&spip->spd_spi->DR; } /** diff --git a/readme.txt b/readme.txt index e0348b722..dd7a74714 100644 --- a/readme.txt +++ b/readme.txt @@ -81,6 +81,7 @@ option is not compatible with the 64 bits stack alignment now default in the Cortex-Mx port. Note that the 64 bits alignment has a cost both as performance and as space but it is the "standard". +- OPT: Small speed optimization in the STM32 SPI driver. - Fixed various documentation errors. *** 2.1.0 ***