STM32F413VGT6 DMA is triggered but no data is copied
Hello,
I'm trying to use DMA with an Usart to receive incoming data in a circular buffer. Basically this is my code for configuration using UART5. I can send data, so i assume, that port und clock configuration is correct. When receiving data, NDTR is couting down but there is no data copied into the buffer M0AR. Uart5 uses DMA1 Stream0, Channel 4. FIFOs are not used.
When i switch to polling receiving without dma, everything works. What can be the issue?
dma = DMA1_Stream0;
dma->CR &= ~DMA_SxCR_EN;
dma->CR |= 4 << DMA_SxCR_CHSEL_Pos;
dma->PAR = (uint32_t)&oConfig.oUSART->DR;
dma->M0AR = (uint32_t)&buf_rx[0];
dma->NDTR = BUFFER_SIZE;
dma->CR |= DMA_SxCR_PL_1;
dma->CR |= DMA_SxCR_PL_0;
dma->CR |= DMA_SxCR_MINC;
dma->CR |= DMA_SxCR_CIRC;
dma->CR |= DMA_SxCR_EN;
oConfig.oUSART->CR1 &= ~USART_CR1_UE;
oConfig.oUSART->CR3 |= USART_CR3_DMAR;
oConfig.oUSART->CR1 = USART_CR1_TE | USART_CR1_RE;
oConfig.oUSART->CR1 |= USART_CR1_UE;
setBaudrate(oConfig.u32Baudrate);
