Skip to content
7 changes: 5 additions & 2 deletions drivers/adc/adc_stm32.c
Original file line number Diff line number Diff line change
Expand Up @@ -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, \
Expand Down
7 changes: 5 additions & 2 deletions drivers/adc/adc_stm32wb0.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
7 changes: 5 additions & 2 deletions drivers/i2c/i2c_ll_stm32.c
Original file line number Diff line number Diff line change
Expand Up @@ -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, \
},))

Expand Down
5 changes: 3 additions & 2 deletions drivers/i2s/i2s_ll_stm32.c
Original file line number Diff line number Diff line change
Expand Up @@ -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, \
Expand Down
7 changes: 5 additions & 2 deletions drivers/i3c/i3c_stm32.c
Original file line number Diff line number Diff line change
Expand Up @@ -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, \
}, \
Expand Down
7 changes: 5 additions & 2 deletions drivers/serial/uart_stm32.c
Original file line number Diff line number Diff line change
Expand Up @@ -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, \
}, \
Expand Down
16 changes: 10 additions & 6 deletions drivers/spi/spi_ll_stm32.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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, \
Expand Down
7 changes: 5 additions & 2 deletions drivers/video/video_stm32_dcmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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, \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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, \
Expand Down