Skip to main content
HBavi.1
Associate II
July 21, 2021
Solved

Does PVD(Programmable voltage detector) supported in STM32G030K6 controller?

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 */
}

This topic has been closed for replies.
Peter BENSCH
Peter BENSCHBest answer
ST Technical Moderator
July 22, 2021

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

In order 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.

2 replies

HBavi.1
HBavi.1Author
Associate II
July 21, 2021
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 */
}

Peter BENSCH
Peter BENSCHBest answer
ST Technical Moderator
July 22, 2021

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

In order 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.