cancel
Showing results for 
Search instead for 
Did you mean: 

ADC with DMA arrest on STM32F4

yoshi
Associate II
Posted on December 09, 2014 at 14:19

Dear All,

My board is 429I-DISCO. I tried to code a continuous A/D conversion via DMA on FreeRTOS.

At first A/D conversion shortly after power-up was starting nomally by ADC_SoftwareStartConv(ADC3).

On the rest of the next sequence, the value of uhADC3ConvertedValue - mostly copy & paste from STM's Peripheral_Examples\ADC_DMA - is not updated.

According to single step execution, it seems to stopped the conversion in vTaskStartScheduler().

Does anyone knows why stop the A/D conversion process? How should I fix this?

tyro

11 REPLIES 11
yoshi
Associate II
Posted on December 14, 2014 at 06:56

I found that OVR(overrun) register is assarted on ADC3 Status Register.

yoshi
Associate II
Posted on January 08, 2015 at 08:53

Problem solved - Maybe.

ADC_DR was overwitten with new converted value before DMA readout, OVR is set to 1 and DMA transfer is disabled. The reason why framework-side DMA transfer interfere withmyreadout cycle. So Iregulated to slow ADC clock.

/* ADC Common Init */
ADC_CommonInitStructure.ADC_Mode = ADC_Mode_Independent;
//ADC_CommonInitStructure.ADC_Prescaler = ADC_Prescaler_Div2;
ADC_CommonInitStructure.ADC_Prescaler = ADC_Prescaler_Div8; 
// ADC works without overrun
ADC_CommonInitStructure.ADC_DMAAccessMode = ADC_DMAAccessMode_Disabled;
ADC_CommonInitStructure.ADC_TwoSamplingDelay = ADC_TwoSamplingDelay_5Cycles;
ADC_CommonInit(&ADC_CommonInitStructure);

tyro