Skip to main content
SGupt.7
Associate II
June 29, 2021
Question

Issue in STANDBY Mode in stm32f746g discovery board.

  • June 29, 2021
  • 1 reply
  • 997 views

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

This topic has been closed for replies.

1 reply

Amel NASRI
Technical Moderator
June 30, 2021

Hi @SGupt.7​ ,

Sorry, but I don't understand what is wrong with this behavior:

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.

-Amel

To give better visibility on the answered topics, please click on "Best Answer" on the reply which solved your issue or answered your question.
SGupt.7
SGupt.7Author
Associate II
July 1, 2021

Hello,

Thanks a lot for your reply.

So just to make my problem more clear, whenever I press the user push button (PI11) for the 1st time, the MCU wakes up from the standby mode but in the next step it does not stay in standby mode and wakes up automatically even if I do not press the button again.

My requirement is that once I press the user push button PI11, the MCU should wake up from standby mode and then immediately go back in standby mode and stay in that low-power mode until I press the button again.

Perhaps this will make my doubt clearer to understand.

Thanks and Regard.