2017-08-21 2:48 AM
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?
2017-08-23 9:02 AM
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.
We’re moving the ST Community to a new platform to give you a better and more reliable community experience.