Bad voltage on VREF+ pin (VDD instead of VREFBUF)
I'm using an STM32H743VIT6 (rev V in LQFP100 package), powered at 3.3V and programmed with STM32CubeIDE.
I'm using the ADC2 and ADC3, and also want to use the VREFBUF voltage (available on VREF+ pin) programmed for 2.5V.
The *.ioc file is generated with:
VREFBUF Mode -> internal voltage reference
Internal Voltage reference scale -> SCALE 0: around 2.5V
Unfortunately I measure 3.3V on pin 20 (VREF+) instead of 2.5V!
In the generated file stm32h7xx_hal_msp.c, in the HAL_MspInit(void) function I see:
/** Enable the VREF clock */
__HAL_RCC_VREF_CLK_ENABLE();
/** Configure the internal voltage reference buffer voltage scale */
HAL_SYSCFG_VREFBUF_VoltageScalingConfig(SYSCFG_VREFBUF_VOLTAGE_SCALE0);
/** Enable the Internal Voltage Reference buffer*/
HAL_SYSCFG_EnableVREFBUF();
/** Configure the internal voltage reference buffer high impedance mode*/
HAL_SYSCFG_VREFBUF_HighImpedanceConfig(SYSCFG_VREFBUF_HIGH_IMPEDANCE_DISABLE);
In my main() function I've added the reading of the VREFBUF_CSR register to check what's going on:
uint32_t status = VREFBUF->CSR;
I get status = 9:
Bit 0 ENVR = 1 -> Internal voltage reference mode (reference buffer enable or hold mode) enable.
Bit 1 HIZ = 0 -> VREF+ pin is internally connected to the voltage reference buffer output.
Bit 2 NA
Bit 3 VRR = 1 -> the voltage reference buffer output reached the requested level.
Bit 6:4 VRS[2:0] = 000 -> Voltage reference set to 2.5 V
Everything seems OK!
If I change VREFBUF Mode to -> Disable, the voltage at pin 20 becomes 0V.
What is wrong?
