Skip to main content
Super User
April 9, 2024
Solved

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

  • April 9, 2024
  • 4 replies
  • 1741 views

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

    This topic has been closed for replies.
    Best answer by Amel NASRI

    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

     

    4 replies

    Technical Moderator
    April 22, 2024

    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

    Super User
    April 22, 2024

    That makes sense. Thanks, @Amel NASRI !

    JW

    Technical Moderator
    April 24, 2024

    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

     

    Super User
    April 24, 2024

    Thanks, Amel.

    Jan

    @Amel NASRI