2 bugs with VREFBUF and STM32Cube on at least STM32G491
Hi ST,
There are 2 bugs in Initialization of VREFBUF.in STM32CubeIDE V1.11.0.
I use FreeRTOS, but it shouldn't have any inffluence on these bugs.
1.) At function main, the firsr call is to Hal Init and when VREFBuF ist activated, in function HAL_MspInit, Enabling the SYSCFG Clock sets the HiZ bit of CSR. the call to HAL_SYSCFG_EnableVREFBUF sets the ENVR bit in CSR and waits for VRR set which indicates the Reached the desired voltage. This will never happen. Only when I clear the HiZ bit manually, the VREFBUF wil reach the voltage (measured on VREF+ Pin), the VRR wil be set and it can continue.
2.) in function HAL_SYSCFG_EnableVREFBUF, it waits for Tick Count to reach VREFBUF_TIMEOUT_VALUE (wait max 10ms) but no count of HAL Tick will happen. The Tick is initialised before, but it seems that something ist not configured correct or too late. There is no Tick increment at all.
The combination of above bugs ends in Dead System. Nothing else will habben after the call of HAL_SYSCFG_EnableVREFBUF. Because at that time also the watchdog is not enabled, the system hangs forever. This shall not happen in an Embedded system.
Best regards,
Osto
