cancel
Showing results for 
Search instead for 
Did you mean: 

Is this a bug that STM32H743 HAL_ADC_Stop_DMA clears ADC_CFGR_DMNGT?

Aaron Chang
Associate II
Posted on August 21, 2017 at 11:48

Hello,

    In the line 1760 of 'stm32h7xx_hal_adc.c' in pack 'STM32H7xx_DFP 1.0.1':

'''

   /* Disable ADC DMA (ADC DMA configuration ADC_CFGR_DMNGT is kept) */

   MODIFY_REG(hadc->Instance->CFGR, ADC_CFGR_DMNGT_0 |ADC_CFGR_DMNGT_1, 0);

'''

    The comment says 'keep the DMNGT' while the code actually clears it.  Besides 

it doesn't make much sense to me that calling a 'HAL_ADC_Stop_DMA' could change the initial configuration of ADC.

    Is this a bug?  Or 'HAL_ADC_Stop_DMA' is not something I should call under normal condition?

This discussion is locked. Please start a new topic to ask your question.
1 REPLY 1
Amel NASRI
ST Employee
Posted on August 23, 2017 at 18:02

Hi

aaron_chang

‌,

It seems the comment 'Disable ADC DMA (ADC DMA configuration ADC_CFGR_DMNGT is kept)' creates confusion for you.

In fact here,ADC_CFGR_DMNGT have to be cleared because the call ofADC_ConversionStop doesn't clear them: they are kept as they are.

So this is not a bug.

HAL_ADC_Stop_DMA may be useful in an application where ADC configuration needs to be modified for example to start with a new mode.

-Amel

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Announcement

We’re moving the ST Community to a new platform to give you a better and more reliable community experience.