2021-07-20 10:42 PM
I am using STM32G030K6 controller but it's unable to detect PVD. I would like to know whether it supports PVD or not.
void HAL_MspInit(void)
{
/* USER CODE BEGIN MspInit 0 */
/* USER CODE END MspInit 0 */
PWR_PVDTypeDef sConfigPVD = {0};
__HAL_RCC_SYSCFG_CLK_ENABLE();
__HAL_RCC_PWR_CLK_ENABLE();
/* System interrupt init*/
/* Peripheral interrupt init */
/* PVD_IRQn interrupt configuration */
HAL_NVIC_SetPriority(PVD_IRQn, 0, 0);
HAL_NVIC_EnableIRQ(PVD_IRQn);
/** PVD Configuration
*/
sConfigPVD.Mode = PWR_PVD_MODE_IT_FALLING;
HAL_PWR_ConfigPVD(&sConfigPVD);
/** Enable the PVD Output
*/
HAL_PWR_EnablePVD();
/* USER CODE BEGIN MspInit 1 */
/* USER CODE END MspInit 1 */
}
Solved! Go to Solution.
2021-07-22 12:28 AM
The STM32G030 is a cost-optimized version of the bigger brothers STM32G031, which is why there is no reference to the PVD function in the data sheet. If you need PVD, you should switch to e.g. STM32G031K6.
Regards
/Peter
2021-07-20 10:46 PM
void HAL_MspInit(void)
{
/* USER CODE BEGIN MspInit 0 */
/* USER CODE END MspInit 0 */
PWR_PVDTypeDef sConfigPVD = {0};
__HAL_RCC_SYSCFG_CLK_ENABLE();
__HAL_RCC_PWR_CLK_ENABLE();
/* System interrupt init*/
/* Peripheral interrupt init */
/* PVD_IRQn interrupt configuration */
HAL_NVIC_SetPriority(PVD_IRQn, 0, 0);
HAL_NVIC_EnableIRQ(PVD_IRQn);
/** PVD Configuration
*/
sConfigPVD.Mode = PWR_PVD_MODE_IT_FALLING;
HAL_PWR_ConfigPVD(&sConfigPVD);
/** Enable the PVD Output
*/
HAL_PWR_EnablePVD();
/* USER CODE BEGIN MspInit 1 */
/* USER CODE END MspInit 1 */
}
2021-07-22 12:28 AM
The STM32G030 is a cost-optimized version of the bigger brothers STM32G031, which is why there is no reference to the PVD function in the data sheet. If you need PVD, you should switch to e.g. STM32G031K6.
Regards
/Peter