Question
Bug in HAL_ADC_Init when using oversampling on ADC3, CPU is H723

Set ADC3 with 16 oversampling

But what I got is doubled. ADC3[1] is 5V and ADC3[4] is 3.3V
-------------------------------------
In "void MX_ADC3_Init(void)",
hadc3.Init.Oversampling.Ratio = 16;
hadc3.Init.Oversampling.RightBitShift = ADC_RIGHTBITSHIFT_4;Went through the HAL_ADC_Init(), found
#if defined(ADC_VER_V5_V90)
if (hadc->Instance == ADC3)
{
/* Configuration of Oversampler: */
/* - Oversampling Ratio */
/* - Right bit shift */
/* - Triggered mode */
/* - Oversampling mode (continued/resumed) */
MODIFY_REG(hadc->Instance->CFGR2,
ADC_CFGR2_OVSR |
ADC_CFGR2_OVSS |
ADC_CFGR2_TROVS |
ADC_CFGR2_ROVSM,
ADC_CFGR2_ROVSE |
hadc->Init.Oversampling.Ratio |
hadc->Init.Oversampling.RightBitShift |
hadc->Init.Oversampling.TriggeredMode |
hadc->Init.Oversampling.OversamplingStopReset
);
}
else
{
When "Ratio" is 16, it's directly written into "CFGR2" with other settings. This is not right. It's actually making a 32x oversampling.
Change the setting as "0x0C", I got what I want.
