cancel
Showing results for 
Search instead for 
Did you mean: 

Incorrect calculation of __LL_ADC_CALC_VREFANALOG_VOLTAGE on STM32H723

heveskar
Senior

__LL_ADC_CALC_VREFANALOG_VOLTAGE macro presumes that VREFINT calibration value is from a 16-bit ADC. However, for STM32H723, the value I see (1522) is from 12-bit ADC conversion. So this macro returns incorrect value. On STM32H747, it works as expected (the value is 24074 which corresponds to 16-bit ADC value). I have not found any information about conversion width in the reference manual nor in the datasheet.

#define __LL_ADC_CALC_VREFANALOG_VOLTAGE(__VREFINT_ADC_DATA__,\
                                         __ADC_RESOLUTION__)                   \
  (((uint32_t)(*VREFINT_CAL_ADDR) * VREFINT_CAL_VREF)                          \
    / __LL_ADC_CONVERT_DATA_RESOLUTION((__VREFINT_ADC_DATA__),                 \
                                       (__ADC_RESOLUTION__),                   \
                                       LL_ADC_RESOLUTION_16B)                  \
  )
1 ACCEPTED SOLUTION

Accepted Solutions
Issamos
Lead II

Hello @heveskar 

This is a known issue reported internally by an ST employee (post available here). It should be solved on the future.

Best Regards.

II

View solution in original post

2 REPLIES 2
Issamos
Lead II

Hello @heveskar 

This is a known issue reported internally by an ST employee (post available here). It should be solved on the future.

Best Regards.

II

heveskar
Senior

Thanks, missed this.