Question
STM32H735 wake from standby
My simple program to test wake from standby with PC13/Wakeup_pin4 is working. I use the pushbutton on this pin as an EXTI and had to add the GPIO_DeInit before setting the pin as an input without EXTI.
The same code does not work in my larger program and I can't work out why??
printf("0 - sleep until button pressed\r\n");
HAL_GPIO_DeInit(GPIOC, GPIO_PIN_13);
GPIO_InitTypeDef GPIO_InitStruct = {0};
GPIO_InitStruct.Pin = GPIO_PIN_13;
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
HAL_PWR_DisableWakeUpPin(PWR_WAKEUP_PIN4);
PWR->WKUPCR = 0x3F; // Clear all wakeup flags (write 1 to clear)
PWREx_WakeupPinTypeDef sPinParams = {
.WakeUpPin = PWR_WAKEUP_PIN4,
.PinPolarity = PWR_PIN_POLARITY_HIGH,
.PinPull = PWR_PIN_NO_PULL
};
HAL_PWREx_EnableWakeUpPin(&sPinParams);
HAL_Delay(10);
HAL_TIM_Base_Stop_IT(&htim6);
HAL_SuspendTick();
BlinkOff();
HAL_PWR_EnterSTANDBYMode();
