diff --git a/os/hal/ports/STM32/LLD/SPIv1/i2s_lld.c b/os/hal/ports/STM32/LLD/SPIv1/i2s_lld.c index 821688d51..6be5df7bd 100644 --- a/os/hal/ports/STM32/LLD/SPIv1/i2s_lld.c +++ b/os/hal/ports/STM32/LLD/SPIv1/i2s_lld.c @@ -342,15 +342,6 @@ void i2s_lld_start(I2SDriver *i2sp) { #endif } #endif - - if (NULL != i2sp->dmarx) { - dmaStreamSetMode(i2sp->dmarx, i2sp->rxdmamode); - dmaStreamSetPeripheral(i2sp->dmarx, &i2sp->spi->DR); - } - if (NULL != i2sp->dmatx) { - dmaStreamSetMode(i2sp->dmatx, i2sp->txdmamode); - dmaStreamSetPeripheral(i2sp->dmatx, &i2sp->spi->DR); - } } /* I2S (re)configuration.*/ @@ -412,6 +403,8 @@ void i2s_lld_start_exchange(I2SDriver *i2sp) { /* RX DMA setup.*/ if (NULL != i2sp->dmarx) { + dmaStreamSetMode(i2sp->dmarx, i2sp->rxdmamode); + dmaStreamSetPeripheral(i2sp->dmarx, &i2sp->spi->DR); dmaStreamSetMemory0(i2sp->dmarx, i2sp->config->rx_buffer); dmaStreamSetTransactionSize(i2sp->dmarx, size); dmaStreamEnable(i2sp->dmarx); @@ -419,6 +412,8 @@ void i2s_lld_start_exchange(I2SDriver *i2sp) { /* TX DMA setup.*/ if (NULL != i2sp->dmatx) { + dmaStreamSetMode(i2sp->dmatx, i2sp->txdmamode); + dmaStreamSetPeripheral(i2sp->dmatx, &i2sp->spi->DR); dmaStreamSetMemory0(i2sp->dmatx, i2sp->config->tx_buffer); dmaStreamSetTransactionSize(i2sp->dmatx, size); dmaStreamEnable(i2sp->dmatx); diff --git a/readme.txt b/readme.txt index e454ae5af..d4669d8ca 100644 --- a/readme.txt +++ b/readme.txt @@ -95,6 +95,8 @@ - HAL: Introduced support for TIM21 and TIM22 in STM32 ST driver. - HAL: Updated STM32F0xx headers to STM32CubeF0 version 1.3.0. Added support for STM32F030xC, STM32F070x6, STM32F070xB devices. +- HAL: Fixed problem with STM32 I2S driver restart (bug #630)(backported + to 3.0.2). - HAL: Fixed STM32F3xx ADC driver uses US2RTC directly (bug #629)(backported to 3.0.2). - HAL: Fixed CEC clock cannot be disabled on STM32F0xx (bug #628)