Issue in STANDBY Mode in stm32f746g discovery board.
Hi everyone,
I am trying to implement the STANDBY mode in stm32f746g board using the system wakeup pin PI11 (user push button).
The issue is that once I press the button, the controller automatically wakes up from the STANDBY mode.
I have attached my code below for reference.
Also, if I want to use PA0 pin as the syswkup pin with an external button press to detect the falling edge, should I pass PWR_WAKEUP_PIN1_LOW in the function argument?
Any leads to the above problem would really help.
Thanks and Regards.
int main(void)
{
/* MCU Configuration--------------------------------------------------------*/
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init();
/* Configure the system clock */
SystemClock_Config();
/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_USART1_UART_Init();
/* USER CODE BEGIN 2 */
if(__HAL_PWR_GET_FLAG(PWR_FLAG_SB) != RESET) {
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_SB);
char *tx_buf = "MCU wakes from STANDBY mode!\n\r";
HAL_UART_Transmit(&huart1, (uint8_t *)tx_buf, strlen(tx_buf), HAL_MAX_DELAY);
//HAL_PWR_DisableWakeUpPin(PWR_WAKEUP_PIN6);
}
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU);
HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN6);
char *str2 = "STANDBY mode ON!\n\r";
HAL_UART_Transmit(&huart1, (uint8_t *)str2, strlen(str2), HAL_MAX_DELAY);
HAL_PWR_EnterSTANDBYMode();
/* USER CODE END 2 */
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1)
{
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
}
/* USER CODE END 3 */
}