Solved
STM32H753ZI adc oversample CUBEmx error
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
