Showing results for 
Search instead for 
Did you mean: 

Possible ADC VREF HAL calibration scaling issue in __LL_ADC_CALC_DATA_TO_VOLTAGE for H723


Note: Firmware package H7 V1.10.0


On the STM32H723 the internal vref and temp channels are connected to ADC3 which is a 12b ADC while ADC1 and 2 are 16b.

The internal calibration values for the temperature sensor and vref are also scaled in 12b it seems but the HAL

Macros __HAL_ADC_CALC_VREFANALOG_VOLTAGE (in stm32h7xx_hal_adc.h) or __LL_ADC_CALC_DATA_TO_VOLTAGE (in stm32h7xx_ll_adc.h) assume a scaling in 16b resulting in incorrect readings if the actual adc resolution of 12b is passed to these macros instead of 16b.

Passing a resolution of 16b and the actually 12b value from ADC3 to these functions results in a correct value.

The same also applies to the macro __LL_ADC_CALC_TEMPERATURE and possibly others.


The comment to __LL_ADC_CALC_DATA_TO_VOLTAGE  states:
"On this STM32 series, calibration data of internal voltage reference
* VrefInt corresponds to a resolution of 16 bits" which is incorrect for this chip in this case.

The vref calibration value on one specific chip here is 0x5F1 = 1521 which is as expected close to what the 12b adc reads on the vref channel when powered by 3.3v.

Ghofrane GSOURI
ST Employee

Hello @Ultrawipf 

First let me thank you for posting.

Could you please use the latest CubeMX version 6.9.2 and Firmware package H7 V1.11.1 and see if you still facing the same issue mentioned above .

I will be waiting for your feedback.