Init code generated by CubeMx for vrefbuf not working (STM32G4)
The sequence used to enable vrefbuf in HAL_MspInit() is not working.
It calls HAL_SYSCFG_EnableVREFBUF() before switching from input to output (HAL_SYSCFG_VREFBUF_HighImpedanceConfig(SYSCFG_VREFBUF_HIGH_IMPEDANCE_DISABLE)), so HAL_SYSCFG_EnableVREFBUF() always returns a timeout error incase systick is running or blocks forever in case systick is not running.
PS:
In my opinion HAL_MspInit() should also return a HAL_STATUS instead of void.