2021-03-01 01:23 AM
I try to VREFPIN in internal mode (so VREFPIN is an output).
Based on IDE STM32CUBEIDE 1.3.0 and using a STM32G071 MCU.
The generated code is :
void HAL_MspInit(void)
{
__HAL_RCC_SYSCFG_CLK_ENABLE();
__HAL_RCC_PWR_CLK_ENABLE();
/* System interrupt init*/
/* SVC_IRQn interrupt configuration */
HAL_NVIC_SetPriority(SVC_IRQn, 3, 0);
/* PendSV_IRQn interrupt configuration */
HAL_NVIC_SetPriority(PendSV_IRQn, 2, 0);
/** 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);
/** Disable the internal Pull-Up in Dead Battery pins of UCPD peripheral
*/
LL_SYSCFG_DisableDBATT(LL_SYSCFG_UCPD1_STROBE | LL_SYSCFG_UCPD2_STROBE);
}
I guess there is an issue in HAL code generation because :
NB: it's hard to catch this issue because in debug mode using CUBEIDE, Vrefpin have x100 times to reach requested level.
2022-02-10 06:30 AM
facing the same issue on a STM32WB55; using the genuine HAL code, it sometimes hang in HAL_SYSCFG_EnableVREFBUF()
By adding a call to HAL_SYSCFG_VREFBUF_HighImpedanceConfig(SYSCFG_VREFBUF_HIGH_IMPEDANCE_DISABLE) before, it works
Can maybe ST confirm this is a bug in HAL ?