Skip to content

Commit df2c254

Browse files
committed
drivers: i2s: stm32 h7xx fix rx PeriphInc and MemInc
This change fixes rx dma setup. PeriphInc and MemInc should be the same for both directions Signed-off-by: Mario Paja <mariopaja@hotmail.com>
1 parent 0d794df commit df2c254

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

drivers/i2s/i2s_stm32_sai.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,8 @@ static int i2s_stm32_sai_dma_init(const struct device *dev)
289289
hdma->Init.MemDataAlignment = DMA_PDATAALIGN_HALFWORD;
290290
hdma->Init.Priority = DMA_PRIORITY_HIGH;
291291
hdma->Init.FIFOMode = DMA_FIFOMODE_DISABLE;
292+
hdma->Init.PeriphInc = DMA_PINC_DISABLE;
293+
hdma->Init.MemInc = DMA_MINC_ENABLE;
292294
#else
293295
hdma->Instance = LL_DMA_GET_CHANNEL_INSTANCE(stream->reg, stream->dma_channel);
294296
hdma->Init.BlkHWRequest = DMA_BREQ_SINGLE_BURST;
@@ -307,10 +309,7 @@ static int i2s_stm32_sai_dma_init(const struct device *dev)
307309
if (stream->dma_cfg.channel_direction == (enum dma_channel_direction)MEMORY_TO_PERIPHERAL) {
308310
hdma->Init.Direction = DMA_MEMORY_TO_PERIPH;
309311

310-
#if defined(CONFIG_SOC_SERIES_STM32H7X)
311-
hdma->Init.PeriphInc = DMA_PINC_DISABLE;
312-
hdma->Init.MemInc = DMA_MINC_ENABLE;
313-
#else
312+
#if !defined(CONFIG_SOC_SERIES_STM32H7X)
314313
hdma->Init.SrcInc = DMA_SINC_INCREMENTED;
315314
hdma->Init.DestInc = DMA_DINC_FIXED;
316315
#endif
@@ -319,10 +318,7 @@ static int i2s_stm32_sai_dma_init(const struct device *dev)
319318
} else {
320319
hdma->Init.Direction = DMA_PERIPH_TO_MEMORY;
321320

322-
#if defined(CONFIG_SOC_SERIES_STM32H7X)
323-
hdma->Init.PeriphInc = DMA_PINC_ENABLE;
324-
hdma->Init.MemInc = DMA_MINC_DISABLE;
325-
#else
321+
#if !defined(CONFIG_SOC_SERIES_STM32H7X)
326322
hdma->Init.SrcInc = DMA_SINC_FIXED;
327323
hdma->Init.DestInc = DMA_DINC_INCREMENTED;
328324
#endif

0 commit comments

Comments
 (0)