2026-01-21 12:40 AM - last edited on 2026-01-21 1:29 AM by mƎALLEm
2026-01-21 12:56 AM - edited 2026-01-21 1:31 AM
Hello,
According to the datasheet STM32G491RET6 features an internal voltage reference buffer (VREFBUF)
It seems VREFBUF option is missing in CubeMx. I will escalate internally for analysis and eventual fix in the tool (internal ticket number 225569 for follow-up).
Try to add this code in the User code section (inspired from H7 generated code): scale set to 0 (2.5V)
/** 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);