Skip to main content
Visitor II
Oct 1, 2026 9:12 AM UTC
Question

Mismatch between HAL_ADC_Stop_DMA and warning in RM0431 8.3.18

Hello,

RM0431, section 8.3.18, contains the following warning:

"To switch off a peripheral connected to a DMA stream request, it is mandatory to, first, switch off the DMA stream to which the peripheral is connected, then to wait for EN bit = 0. Only then can the peripheral be safely disabled."

 

However, HAL_ADC_Stop_DMA() in the STM32F7xx HAL driver v1.3.3 (stm32f7xx_hal_adc.c) uses the opposite order:

1. Line 1526: __HAL_ADC_DISABLE(hadc);
2. Line 1532: hadc->Instance->CR2 &= ~ADC_CR2_DMA;
3. Line 1538: tmp_hal_status = HAL_DMA_Abort(hadc->DMA_Handle);

Could you clarify which sequence should be used?
 

2 replies

ST Technical Moderator
Oct 1, 2026 9:56 AM UTC

Hello ​@sangwoohan 

Thank you for bringing this issue to our attention.

I reported this internally.

Internal ticket number: CDM0066174 (This is an internal tracking number and is not accessible or usable by customers).

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Saket_Om
ST Technical Moderator
Nov 6, 2026 8:24 AM UTC

Hello ​@sangwoohan 

In `HAL_ADC_Stop_DMA()`, the ADC peripheral is disabled before the DMA to prevent data transfer overruns during peripheral-to-DMA transfers.

 

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Saket_Om