ADC Enable Required after Calibration, STM32C0
In RM0490 Rev 6, Reference Manual for the STM32C0, the ADC Software Calibration Process is specified as follows:
Software calibration procedure
1. Ensure that ADEN = 0, AUTOFF = 0, ADVREGEN = 1, and DMAEN = 0.
2. Set ADCAL = 1.
3. Wait until ADCAL = 0 (or until EOCAL = 1). This can be handled by interrupt if the
interrupt is enabled by setting the EOCALIE bit in the ADC_IER register.
4. The calibration factor minus one can then be read from bits 6:0 of the ADC_DR or
ADC_CALFACT registers. The resulting calibration factor must be incremented by one
and written back to the ADC_CALFACT register.
5. To reduce the noise effect of the calibration factor extraction, the software can make
the average of eight calibration factor values. This step is optional but recommended
for better accuracy.
The averaging procedure is as follows
a) Obtain eight incremented calibration factor values (perform eight times step 2 to
step 4).
b) Calculate the average of these eight values and round it up to the nearest integer.
c) Write the result to the ADC_CALFACT register.
Note: If the resulting calibration factor is higher than 0x7F, write 0x7F to the ADC_CALFACT
register to avoid overflow.
This seems to imply that after calibration is completed, we need to just modify the CALFACT register (which seems like an undocumented errata as it is not specified in ES0618) and write it back. However if I look at the HAL, it seems that we must additionally enable the ADC before updating CALFACT: https://github.com/STMicroelectronics/stm32c0xx-hal-driver/blob/a6c02b46564074788271b4a524452f5cf85a312d/Src/stm32c0xx_hal_adc_ex.c#L176
So the question is, is the Reference Manual correct and the HAL doing unnecessary work? Or is enabling the ADC required and the Reference manual incomplete?

