cancel
Showing results for 
Search instead for 
Did you mean: 

BUG: STM32Cube_FW_H7_V1.5.0 - HAL_ADC_Init() doesn't initialize ADC OVSS bits

ebrombaugh1
Associate II

The HAL_ADC_Init() function takes a handle to an Init structure which includes information fields to configure the oversampling feature. The Init.Oversampling.Ratio field is properly applied, but the Init.Oversampling.RightBitShift field is ignored and does not affect the ADC configuration.

It is subsequently necessary to manually change the OVSS bits with the following code after calling the HAL_ADC_Init() function:

ADC1->CFGR2 = (ADC1->CFGR2 & ~ADC_CFGR2_OVSS) | (hadc1.Init.Oversampling.RightBitShift << ADC_CFGR2_OVSS_Pos);

0 REPLIES 0