2016-07-01 09:20 AM
Hi
I use DMA for transferring data from ADC to ADCConverted[300] . I stop DMA somewhere in my program and get the position of the current transferred value by this command: Current_Pos2= ((uint16_t)(DMA1_Channel1->CNDTR)); After a while I enable the DMA. I want to know does it begin to transfer the values from the zero index of array or from the last index of array that it was stop? Regards2016-07-05 02:36 AM
> I stop DMA somewhere in my program
The key question is, how do you do that.If you disable the DMA channel/stream by clearing DMA_CCRx.EN bit, upon re-enabling it, the *last written* CMAR/CPAR/CNDTR will become active, i.e. in your case it will write to array from the zeroth index up to the full size of array, regardless of what was the *read* value of CNDTR.If you disable the DMA channel/stream by disabling its trigger/request signal at the source (i.e. in the peripheral which triggers it) or in the multiplexer (this depends on the particular STM32 model you use), after re-enabling DMA will continue where left.JW