cancel
Showing results for 
Search instead for 
Did you mean: 

Why does 'G0 ADC Calibration in Cube/HAL perform averaging in software?

The STM32G0 ADC calibration in Cube/HAL performs 8 iterations of the calibration process, each time reading out the calibration factor and accumulating it, then dividing by 8 (i.e. taking their average) and writing it back to the calibration factor holder register.

Nothing like this is present in HAL/Cube of other STM32 where ADC incorporates an explicit calibration, e.g. STM32F1 or STM32L4.

This of course raises questions.

Is this procedure necessary for achieving ADC parameters specified in the DS?

Or is it an optional method to achieve *better* parameters than those?

In any case, why is this not documented, neither in DS/RM, nor in any AN?

JW

1 ACCEPTED SOLUTION

Accepted Solutions
Amel NASRI
ST Employee

Hi Jan,

 

Coming back after check internally. What I provided is not the explanation for the implementation of the calibration procedure in the HAL driver.

The correct explanation is what we provide as step 5 of the Software calibration procedure in STM32C0 reference manual RM0490:

AmelNASRI_0-1713952097766.png

The same should be done in the STM32G0 reference manuals. An internal request is tracked for this purpose.

Internal ticket number: 179856 (This is an internal tracking number and is not accessible or usable by customers).

-Amel

 

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

4 REPLIES 4
Amel NASRI
ST Employee

Hi @waclawek.jan ,

Checking the ES (STM32G071x8/xB device errata), we have this note in the workaround suggested for the limitation "2.6.7 ADC offset may be out of specification":

AmelNASRI_0-1713789775412.png

I assume the implementation of the HAL driver is taking into consideration this note, but I need to double check.

-Amel

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.

That makes sense. Thanks, @Amel NASRI !

JW

Amel NASRI
ST Employee

Hi Jan,

 

Coming back after check internally. What I provided is not the explanation for the implementation of the calibration procedure in the HAL driver.

The correct explanation is what we provide as step 5 of the Software calibration procedure in STM32C0 reference manual RM0490:

AmelNASRI_0-1713952097766.png

The same should be done in the STM32G0 reference manuals. An internal request is tracked for this purpose.

Internal ticket number: 179856 (This is an internal tracking number and is not accessible or usable by customers).

-Amel

 

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.

Thanks, Amel.

Jan

@Amel NASRI