cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H753ZI adc oversample CUBEmx error

linuxfan
Associate II

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
1 ACCEPTED SOLUTION

Accepted Solutions
SofLit
ST Employee

Hello,

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

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.

View solution in original post

1 REPLY 1
SofLit
ST Employee

Hello,

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

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.