Skip to main content
Visitor II
July 22, 2026
Solved

STM32CubeMX ADC missing 'DISABLE' option for EOC ?

  • July 22, 2026
  • 3 replies
  • 94 views

Hi,

 

I was making a demo project so needed a really straightforward way to use the ADC of my STM32F446RE.
I configured the ADC1 with only channel. Default parameter everywhere except I enabled ‘Continuous Conversion Mode’ as I understood it, all I had to do with it was to start the ADC (HAL_ADC_Start(&hadc1)) and pick the values every time my loop needed it. I was surprised to notice that ‘HAL_ADC_PollForConversion(&hadc1, 100)’ worked only the first call then always yield HAL_TIMEOUT as I was expecting the ‘Continuous Conversion’ mode to allow me to not call HAL_ADC_Start and stop every time.

After finding the linked post, I found the solution was to change the ADC setting 

from hadc1.Init.EOCSelection = ADC_EOC_SINGLE_CONV 
Into hadc1.Init.EOCSelection = DISABLE
 
The thing is this option is not available in STM32CubeMX (V6.17.0) so I have to pick either ADC_EOC_SINGLE_CONV or ADC_EOC_SEQ_CONV.
I have the behavior I wanted but I wonder if this can be improved in STM32CUBEMX or is there something I don’t understand ?
 

Still according to this link this configuration set should be officialy supported as it’s in the exemple file.

https://github.com/STMicroelectronics/STM32CubeF4/blob/master/Projects/STM324xG_EVAL/Examples/ADC/ADC_RegularConversion_Interrupt/Src/main.c

 

NOTE: So after writing all of this I noticed that ADC_EOC_SEQ_CONV is also defined as ‘0’ like just like ‘DISABLE’ so it would have work if I picked ‘EOC flag at the end of all conversion’ instead ‘EOC flag at the end of single channel conversion’ but I think it’s missleading 

Best answer by Ghofrane GSOURI

Hello ​@RougeGorge 

According to RM0090 Rev 22, section 13.13.3 ADC control register 2 (ADC_CR2), DISABLE is not listed explicitly as one of the available options. 

sys_attachment.do?sys_id=abb3d052831a4f502ea7dbb0ecda1e74

However ,in this context, DISABLE corresponds to 0, meaning that the EOC bit is set at the end of each regular conversion sequence.

So MX is working correctly and a ticket  #0064697 has been escalated to the appropriate team to align the example .

THX

Ghofrane

THX

Ghofrane 

3 replies

Ozone
Principal
July 24, 2026

The Cube/HAL code is often difficult to understand in general. Less the code, but more so the ideas behind it.

You could leave continuous mode enabled, and directly access the ADCx->DR register for the result.
If you are ok with the asynchronous accesses and non-equidistant sampling, which is obviously the case.

Ghofrane GSOURI
Ghofrane GSOURIBest answer
ST Technical Moderator
July 24, 2026

Hello ​@RougeGorge 

According to RM0090 Rev 22, section 13.13.3 ADC control register 2 (ADC_CR2), DISABLE is not listed explicitly as one of the available options. 

sys_attachment.do?sys_id=abb3d052831a4f502ea7dbb0ecda1e74

However ,in this context, DISABLE corresponds to 0, meaning that the EOC bit is set at the end of each regular conversion sequence.

So MX is working correctly and a ticket  #0064697 has been escalated to the appropriate team to align the example .

THX

Ghofrane

THX

Ghofrane 

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.
Visitor II
July 29, 2026

Thanks for your feedback !