cancel
Showing results for 
Search instead for 
Did you mean: 

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

HBavi.1
Associate III

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

1 ACCEPTED SOLUTION

Accepted Solutions
Peter BENSCH
ST Employee

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.

View solution in original post

2 REPLIES 2
HBavi.1
Associate III
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
ST Employee

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.