cancel
Showing results for 
Search instead for 
Did you mean: 

Init code generated by CubeMx for vrefbuf not working (STM32G4)

MAdle.1
Associate

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.

1 REPLY 1
Simon V.
ST Employee

Hello,

Thank you for your feedback.

I confirm your observation.

I will reproduce on my side and inform CubeMx Team.

Regards,

Simon

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.