Skip to content

stm32_dma.c - current sources camera (dmas = <&dma1 0 75 ... fails #207

@KurtE

Description

@KurtE

Recent change to stm32_dma.c:
Which includes:

DMA_STM32_EXPORT_API int dma_stm32_configure(const struct device *dev,
					     uint32_t id,
					     struct dma_config *config)
{
	const struct dma_stm32_config *dev_config = dev->config;
	DMA_TypeDef *dma = (DMA_TypeDef *)dev_config->base;
	LL_DMA_InitTypeDef DMA_InitStruct;
	struct dma_stm32_stream *stream;
	int ret;

	LL_DMA_StructInit(&DMA_InitStruct);

	/* Give channel from index 0 */
	id = id - STM32_DMA_STREAM_OFFSET;

	if (id >= dev_config->max_streams) {
		LOG_ERR("cannot configure the dma stream %d.", id);
		return -EINVAL;
	}
...

Fails with the updated code as: ID = 0, STM32_DMA_STREAM_OFFSET=1
so id updated to 0xffffffff which is > max_streams and we fail.

There is a Pull request on zephyr: zephyrproject-rtos/zephyr#95803
Which renumbers 3 of the DMA indexes.

Which also then requires us to change these in all of the overlays that define DCMI.
Wondering if maybe that part of the defines should go into the boards DTS files.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions