diff --git a/drivers/adc/adc_stm32.c b/drivers/adc/adc_stm32.c index e16471b6039f2..eeddf7b6f065e 100644 --- a/drivers/adc/adc_stm32.c +++ b/drivers/adc/adc_stm32.c @@ -1828,8 +1828,11 @@ static DEVICE_API(adc, api_stm32_driver_api) = { STM32_DMA_CHANNEL_CONFIG_BY_IDX(index, 0)), \ .dest_data_size = STM32_DMA_CONFIG_##dest_dev##_DATA_SIZE( \ STM32_DMA_CHANNEL_CONFIG_BY_IDX(index, 0)), \ - .source_burst_length = 1, /* SINGLE transfer */ \ - .dest_burst_length = 1, /* SINGLE transfer */ \ + /* single transfers (burst length = data size) */ \ + .source_burst_length = STM32_DMA_CONFIG_##src_dev##_DATA_SIZE( \ + STM32_DMA_CHANNEL_CONFIG_BY_IDX(index, 0)), \ + .dest_burst_length = STM32_DMA_CONFIG_##dest_dev##_DATA_SIZE( \ + STM32_DMA_CHANNEL_CONFIG_BY_IDX(index, 0)), \ .channel_priority = STM32_DMA_CONFIG_PRIORITY( \ STM32_DMA_CHANNEL_CONFIG_BY_IDX(index, 0)), \ .dma_callback = dma_callback, \ diff --git a/drivers/adc/adc_stm32wb0.c b/drivers/adc/adc_stm32wb0.c index 02d65e1c7ab5b..59173733581ba 100644 --- a/drivers/adc/adc_stm32wb0.c +++ b/drivers/adc/adc_stm32wb0.c @@ -1230,8 +1230,11 @@ static struct adc_stm32wb0_data adc_data = { STM32_DMA_CHANNEL_CONFIG_BY_IDX(ADC_INSTANCE, 0)), .dest_data_size = STM32_DMA_CONFIG_MEMORY_DATA_SIZE( STM32_DMA_CHANNEL_CONFIG_BY_IDX(ADC_INSTANCE, 0)), - .source_burst_length = 1, /* SINGLE transfer */ - .dest_burst_length = 1, /* SINGLE transfer */ + /* single transfers (burst length = data size) */ + .source_burst_length = STM32_DMA_CONFIG_PERIPHERAL_DATA_SIZE( + STM32_DMA_CHANNEL_CONFIG_BY_IDX(ADC_INSTANCE, 0)), + .dest_burst_length = STM32_DMA_CONFIG_MEMORY_DATA_SIZE( + STM32_DMA_CHANNEL_CONFIG_BY_IDX(ADC_INSTANCE, 0)), .block_count = 1, .dma_callback = adc_stm32wb0_dma_callback, /* head_block and user_data are initialized at runtime */ diff --git a/drivers/i2c/i2c_ll_stm32.c b/drivers/i2c/i2c_ll_stm32.c index 2e1ef4b2ed036..96b5b6b0110b6 100644 --- a/drivers/i2c/i2c_ll_stm32.c +++ b/drivers/i2c/i2c_ll_stm32.c @@ -509,8 +509,11 @@ void i2c_stm32_dma_rx_cb(const struct device *dma_dev, void *user_data, STM32_DMA_CHANNEL_CONFIG(index, dir)), \ .dest_data_size = STM32_DMA_CONFIG_##dest##_DATA_SIZE( \ STM32_DMA_CHANNEL_CONFIG(index, dir)), \ - .source_burst_length = 1, \ - .dest_burst_length = 1, \ + /* single transfers (burst length = data size) */ \ + .source_burst_length = STM32_DMA_CONFIG_##src##_DATA_SIZE( \ + STM32_DMA_CHANNEL_CONFIG(index, dir)), \ + .dest_burst_length = STM32_DMA_CONFIG_##dest##_DATA_SIZE( \ + STM32_DMA_CHANNEL_CONFIG(index, dir)), \ .dma_callback = i2c_stm32_dma_##dir##_cb, \ },)) diff --git a/drivers/i2s/i2s_ll_stm32.c b/drivers/i2s/i2s_ll_stm32.c index 3459d50925e0e..523ecda6dbddf 100644 --- a/drivers/i2s/i2s_ll_stm32.c +++ b/drivers/i2s/i2s_ll_stm32.c @@ -946,8 +946,9 @@ static const struct device *get_dev_from_tx_dma_channel(uint32_t dma_channel) .channel_direction = src_dev##_TO_##dest_dev, \ .source_data_size = 2, /* 16bit default */ \ .dest_data_size = 2, /* 16bit default */ \ - .source_burst_length = 1, /* SINGLE transfer */ \ - .dest_burst_length = 1, \ + /* single transfers (burst length = data size) */ \ + .source_burst_length = 2, \ + .dest_burst_length = 2, \ .channel_priority = STM32_DMA_CONFIG_PRIORITY( \ STM32_DMA_CHANNEL_CONFIG(index, dir)), \ .dma_callback = dma_##dir##_callback, \ diff --git a/drivers/i3c/i3c_stm32.c b/drivers/i3c/i3c_stm32.c index b85d2b331ad90..73fe603c01b99 100644 --- a/drivers/i3c/i3c_stm32.c +++ b/drivers/i3c/i3c_stm32.c @@ -2150,8 +2150,11 @@ static DEVICE_API(i3c, i3c_stm32_driver_api) = { STM32_DMA_CHANNEL_CONFIG(index, dir)), \ .dest_data_size = STM32_DMA_CONFIG_##dest_dev##_DATA_SIZE( \ STM32_DMA_CHANNEL_CONFIG(index, dir)), \ - .source_burst_length = 1, /* SINGLE transfer */ \ - .dest_burst_length = 1, \ + /* single transfers (burst length = data size) */ \ + .source_burst_length = STM32_DMA_CONFIG_##src_dev##_DATA_SIZE( \ + STM32_DMA_CHANNEL_CONFIG(index, dir)), \ + .dest_burst_length = STM32_DMA_CONFIG_##dest_dev##_DATA_SIZE( \ + STM32_DMA_CHANNEL_CONFIG(index, dir)), \ .block_count = 1, \ .dma_callback = i3c_stm32_dma_##dir##_cb, \ }, \ diff --git a/drivers/serial/uart_stm32.c b/drivers/serial/uart_stm32.c index 08b77ad362a35..4e276d8324373 100644 --- a/drivers/serial/uart_stm32.c +++ b/drivers/serial/uart_stm32.c @@ -2504,8 +2504,11 @@ static int uart_stm32_pm_action(const struct device *dev, enum pm_device_action STM32_DMA_CHANNEL_CONFIG(index, dir)),\ .dest_data_size = STM32_DMA_CONFIG_##dest_dev##_DATA_SIZE(\ STM32_DMA_CHANNEL_CONFIG(index, dir)), \ - .source_burst_length = 1, /* SINGLE transfer */ \ - .dest_burst_length = 1, \ + /* single transfers (burst length = data size) */ \ + .source_burst_length = STM32_DMA_CONFIG_##src_dev##_DATA_SIZE(\ + STM32_DMA_CHANNEL_CONFIG(index, dir)), \ + .dest_burst_length = STM32_DMA_CONFIG_##dest_dev##_DATA_SIZE(\ + STM32_DMA_CHANNEL_CONFIG(index, dir)), \ .block_count = 1, \ .dma_callback = uart_stm32_dma_##dir##_cb, \ }, \ diff --git a/drivers/spi/spi_ll_stm32.c b/drivers/spi/spi_ll_stm32.c index de3f2b48b68eb..0351a4916e666 100644 --- a/drivers/spi/spi_ll_stm32.c +++ b/drivers/spi/spi_ll_stm32.c @@ -1366,11 +1366,12 @@ static int transceive_dma(const struct device *dev, spi_stm32_cs_control(dev, true); uint8_t word_size_bytes = SPI_WORD_SIZE_GET(config->operation) / BITS_PER_BYTE; + struct dma_config *rx_cfg = &data->dma_rx.dma_cfg, *tx_cfg = &data->dma_tx.dma_cfg; - data->dma_rx.dma_cfg.source_data_size = word_size_bytes; - data->dma_rx.dma_cfg.dest_data_size = word_size_bytes; - data->dma_tx.dma_cfg.source_data_size = word_size_bytes; - data->dma_tx.dma_cfg.dest_data_size = word_size_bytes; + rx_cfg->source_data_size = rx_cfg->source_burst_length = word_size_bytes; + rx_cfg->dest_data_size = rx_cfg->dest_burst_length = word_size_bytes; + tx_cfg->source_data_size = tx_cfg->source_burst_length = word_size_bytes; + tx_cfg->dest_data_size = tx_cfg->dest_burst_length = word_size_bytes; while (data->ctx.rx_len > 0 || data->ctx.tx_len > 0) { size_t dma_len; @@ -1712,8 +1713,11 @@ static int spi_stm32_init(const struct device *dev) STM32_DMA_CHANNEL_CONFIG(index, dir)), \ .dest_data_size = STM32_DMA_CONFIG_##dest_dev##_DATA_SIZE( \ STM32_DMA_CHANNEL_CONFIG(index, dir)), \ - .source_burst_length = 1, /* SINGLE transfer */ \ - .dest_burst_length = 1, /* SINGLE transfer */ \ + /* use single transfers (burst length = data size) */ \ + .source_burst_length = STM32_DMA_CONFIG_##src_dev##_DATA_SIZE( \ + STM32_DMA_CHANNEL_CONFIG(index, dir)), \ + .dest_burst_length = STM32_DMA_CONFIG_##dest_dev##_DATA_SIZE( \ + STM32_DMA_CHANNEL_CONFIG(index, dir)), \ .channel_priority = STM32_DMA_CONFIG_PRIORITY( \ STM32_DMA_CHANNEL_CONFIG(index, dir)), \ .dma_callback = dma_callback, \ diff --git a/drivers/video/video_stm32_dcmi.c b/drivers/video/video_stm32_dcmi.c index d59cc50c2090e..6a5c720343ec7 100644 --- a/drivers/video/video_stm32_dcmi.c +++ b/drivers/video/video_stm32_dcmi.c @@ -482,8 +482,11 @@ static void video_stm32_dcmi_irq_config_func(const struct device *dev) STM32_DMA_CHANNEL_CONFIG_BY_IDX(index, 0)), \ .dest_data_size = STM32_DMA_CONFIG_##dest_dev##_DATA_SIZE( \ STM32_DMA_CHANNEL_CONFIG_BY_IDX(index, 0)), \ - .source_burst_length = 1, /* SINGLE transfer */ \ - .dest_burst_length = 1, /* SINGLE transfer */ \ + /* single transfers (burst length = data size) */ \ + .source_burst_length = STM32_DMA_CONFIG_##src_dev##_DATA_SIZE( \ + STM32_DMA_CHANNEL_CONFIG_BY_IDX(index, 0)), \ + .dest_burst_length = STM32_DMA_CONFIG_##dest_dev##_DATA_SIZE( \ + STM32_DMA_CHANNEL_CONFIG_BY_IDX(index, 0)), \ .channel_priority = STM32_DMA_CONFIG_PRIORITY( \ STM32_DMA_CHANNEL_CONFIG_BY_IDX(index, 0)), \ .dma_callback = dcmi_dma_callback, \ diff --git a/subsys/mgmt/ec_host_cmd/backends/ec_host_cmd_backend_spi_stm32.c b/subsys/mgmt/ec_host_cmd/backends/ec_host_cmd_backend_spi_stm32.c index 34dbe422ca662..eeb695968cbab 100644 --- a/subsys/mgmt/ec_host_cmd/backends/ec_host_cmd_backend_spi_stm32.c +++ b/subsys/mgmt/ec_host_cmd/backends/ec_host_cmd_backend_spi_stm32.c @@ -196,8 +196,11 @@ static int prepare_rx(struct ec_host_cmd_spi_ctx *hc_spi); DT_DMAS_CELL_BY_NAME(id, dir, channel_config)), \ .dest_data_size = STM32_DMA_CONFIG_##dest_dev##_DATA_SIZE( \ DT_DMAS_CELL_BY_NAME(id, dir, channel_config)), \ - .source_burst_length = 1, /* SINGLE transfer */ \ - .dest_burst_length = 1, /* SINGLE transfer */ \ + /* single transfers (burst length = data size) */ \ + .source_burst_length = STM32_DMA_CONFIG_##src_dev##_DATA_SIZE( \ + DT_DMAS_CELL_BY_NAME(id, dir, channel_config)), \ + .dest_burst_length = STM32_DMA_CONFIG_##dest_dev##_DATA_SIZE( \ + DT_DMAS_CELL_BY_NAME(id, dir, channel_config)), \ .channel_priority = STM32_DMA_CONFIG_PRIORITY( \ DT_DMAS_CELL_BY_NAME(id, dir, channel_config)), \ .dma_callback = dma_callback, \