Skip to main content
Explorer
May 22, 2024
Solved

STM32H753ZI adc oversample CUBEmx error

  • May 22, 2024
  • 1 reply
  • 824 views

Hello all,

I bought two NUCLEO-H753ZI to experiment the ADC.

Used the CUBEMX inside the STM32CubeIDE to configure the ADC to do 4x oversample (ADC1 Oversampling Ratio = "Oversampling ratio 4x").

Then generated the code, but it does not compile:

 ...
hadc1.
Init.LeftBitShift = ADC_LEFTBITSHIFT_NONE;
hadc1.Init.OversamplingMode = ENABLE;
hadc1.Init.Oversampling.Ratio = ADC3_OVERSAMPLING_RATIO_4;
hadc1.Init.Oversampling.RightBitShift = ADC_RIGHTBITSHIFT_NONE;
...

 

The error is "... main.c:204:35: error: 'ADC3_OVERSAMPLING_RATIO_4' undeclared ..."
Investigating a little, I found that ADC3_OVERSAMPLING_RATIO_4 is declared in stm32h7xx_hal_adc.h,
but only if ADC_VER_V5_V90 is defined (#if defined...) - which is not.
 
With oversampling disabled in CubeMX, the compilation goes OK.
 
I am new to stm32 and CubeMX. How can I solve my problem?
 
Regards,
linuxfan
    This topic has been closed for replies.
    Best answer by mƎALLEm

    Hello,

    This is a known issue raised in this thread. It will be fixed in the coming versions of CubeMx.

    1 reply

    mƎALLEmAnswer
    Technical Moderator
    May 22, 2024

    Hello,

    This is a known issue raised in this thread. It will be fixed in the coming versions of CubeMx.