STM32H7 PVD not interrupting
Hi,
I want to get the PVD on a STM32H743 running in order to write some data to the flash, which did not work for whatever reason. So, as a first step, I tried to implement an interrupt which just pulls a GPIO-pin high and check it with an oscilloscope. I configured "PVD Level 6" (2.85V) and "External Interrupt Mode with Rising Edge Trigger Detection" in CubeMX, and implemented HAL_PWR_PVDCallback() with a GPIO_Write. However, when I disconnect the power supply, the pin is not being pulled high. The duration in which the power drops from 2.85V to 1.6V is approx. 10ms, which I guess should be plenty of time to process the interrupt. I can fire the interrupt with a software trigger (SWIER1) on EXTI line 16 successfully, which tells me that the EXTI interrupt is working in principle. I also checked that PVDE in PWR_CR1 is enabled, as well as the PLS bits for the threshold.
The following code was generated by CubeMX in stm32h7xx_hal_msp.c:
void HAL_MspInit(void)
{
/* USER CODE BEGIN MspInit 0 */
/* USER CODE END MspInit 0 */
PWR_PVDTypeDef sConfigPVD = {0};
__HAL_RCC_SYSCFG_CLK_ENABLE();
/* System interrupt init*/
/* PendSV_IRQn interrupt configuration */
HAL_NVIC_SetPriority(PendSV_IRQn, 15, 0);
/* Peripheral interrupt init */
/* PVD_AVD_IRQn interrupt configuration */
HAL_NVIC_SetPriority(PVD_AVD_IRQn, 0, 0);
HAL_NVIC_EnableIRQ(PVD_AVD_IRQn);
/** PVD Configuration
*/
sConfigPVD.PVDLevel = PWR_PVDLEVEL_7;
sConfigPVD.Mode = PWR_PVD_MODE_IT_RISING;
HAL_PWR_ConfigPVD(&sConfigPVD);
/** Enable the PVD Output
*/
HAL_PWR_EnablePVD();
/* USER CODE BEGIN MspInit 1 */
/* USER CODE END MspInit 1 */
}Unfortunately I can't change the supply voltage other than disconnecting it, which makes it hard to check the registers at the time PVD is supposed to detect the power drop.
Is there anything I missed or misunderstood?
