Self waking up from Standby Mode
Hallo
I use STM32F779 and want to enter this device in Standby mode and wake up via Wake up pin (PA0). The problem is that everything only works one time correctly or it complete its loop first time just correctly.
After the Reset, Microcontroller goes in Standby mode and stay till rise edge of wake up pin. Then it wakes up from Standby mode and again goes to standby mode. But this process just one time works but after first loop it is not working . because next time it dosn't stay in standby mode and wakes up itself and goes to standby mode again and again without any action in Wake up pin.
Here is my code:
int main(void)
{
/* USER CODE BEGIN 1 */
/* USER CODE END 1 */
/* MCU Configuration--------------------------------------------------------*/
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init();
/* USER CODE BEGIN Init */
/* USER CODE END Init */
/* Configure the system clock */
SystemClock_Config();
/* USER CODE BEGIN SysInit */
/* USER CODE END SysInit */
/* Initialize all configured peripherals */
MX_GPIO_Init();
/* USER CODE BEGIN 2 */
/* USER CODE END 2 */
/* Infinite loop */
/* USER CODE BEGIN WHILE */
if(__HAL_PWR_GET_FLAG(PWR_FLAG_SB) != RESET)
{
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_SB);
HAL_PWR_DisableWakeUpPin(PWR_WAKEUP_PIN1);
}
HAL_Delay(3000);
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU);
for (int var = 0; var < 8; ++var)
{
HAL_GPIO_TogglePin(LED_GPIO_Port, LED_Pin);
HAL_Delay(100);
}
HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN1);
HAL_PWR_EnterSTANDBYMode();
while (1)
{
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
}
/* USER CODE END 3 */
}