DMA's CT register is not changing after conversion
Hello,
I'm trying to get multi-buffer DMA on ADC working. I modified `HAL_ADC_Start_DMA` function to use `HAL_DMAEx_MultiBufferStart_IT`instead of `HAL_DMA_Start_IT.
But for some reason, M0 Completion Callback is executed multiple times before switching to M1 buffer.
uint32_t bit = READ_BIT(((DMA_Stream_TypeDef *)hadc1.DMA_Handle->Instance)->CR, DMA_SxCR_CT);
printf("BIT: %s\r\n", bit ? "1" : "0");I have this in IRQ handler (on M0 or M1 conversion complete callback), and for some reason, flow is following:
BIT: 1
BIT: 1
BIT: 1
BIT: 0
BIT: 0
BIT: 1
BIT: 1
BIT: 1
BIT: 0
BIT: 0
BIT: 1
BIT: 1
BIT: 0
As you can see, it doesn't switch CT like it should (M0 M1 M0 M1 M0 etc...) but the buffer is used multiple times before it's switched. Any ideas where can be an issue?
Thanks.
