Skip to main content
ebrombaugh1
Associate III
October 25, 2019
Question

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

  • October 25, 2019
  • 0 replies
  • 630 views

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);

This topic has been closed for replies.