cancel
Showing results for 
Search instead for 
Did you mean: 

DMA fails to complete (STM32F303x)

gbigden
Associate III
Posted on November 12, 2015 at 10:26

This is a rather complex problem. I have an interrupt routine running under the systick handler with a period of 10mS. Within this I do 4096 reads of ADC3 via DMA2_Channel5, which works fine. Single shot mode

The problem comes when I have data coming in from USART2 via DMA1_Channel6. Occasionally DMA2 fails to complete the transfer, that is, it's counter decrements but does not get to zero.

AFAIK I have set up the interrupts with systick having the highest priority, followed by DMA2 and then DMA1

Any ideas as to what might be happening?

#triage-nurse #stm32
10 REPLIES 10
gbigden
Associate III
Posted on November 20, 2015 at 13:15

The answer appears to be to change this line

  ADC_InitStructure.ADC_OverrunMode = ADC_OverrunMode_Disable;   

to this

  ADC_InitStructure.ADC_OverrunMode = ADC_OverrunMode_Enable;