cancel
Showing results for 
Search instead for 
Did you mean: 

timer + ADC + DMA (ADC ISR overrun)

clee.10
Associate III

Hi all,

I want to use timer 2 to trigger ADC function (ADC3) on STM32H743ZI2 platform.

After DMA & timer starting, I stuck in HAL_ADC_IRQHandler().

        /* Multimode not set or feature not available or ADC independent */
        if ((hadc->Instance->CFGR & ADC_CFGR_DMNGT) != 0UL)
        {
          overrun_error = 1UL;
        }

Can somebody help me what's going on?

The attached file is cubeMx setting & main file.

Thanks.

3 REPLIES 3
TDK
Guru

> hadc3.Init.ContinuousConvMode = ENABLE;

> sConfig.SamplingTime = ADC_SAMPLETIME_1CYCLE_5;

Once it triggers once, the ADC will continue to free-run. If you want one conversion per timer update, disable ContinuousConvMode .

At a sampling time of 1.5 cycles, maybe the DMA can't keep up and you get an overrun. Bump this up to max unless you have a reason not to.

If you feel a post has answered your question, please click "Accept as Solution".
clee.10
Associate III

Hi TDK,

I found a workaround in https://electronics.stackexchange.com/questions/408907/stm32-adcdma-occurring-only-once.

But I don't know the actual reason.

clee.10
Associate III

The root cause ​of this issue is DMA cannot access DTCM.