Skip to main content
MMARI.1
Senior II
May 18, 2023
Solved

using the stm32f7222ze - nucleo board and trying to activate standby mode and wake up by pin PA0 .

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 */
 
 if(__HAL_PWR_GET_FLAG(PWR_FLAG_SB)!=RESET)
 {
 	 __HAL_PWR_CLEAR_FLAG(PWR_FLAG_SB);
 
 	 HAL_PWR_DisableWakeUpPin(PWR_WAKEUP_PIN1);
 	 
 	 for(int i =0; i<10; i++)
 	 {
 		 HAL_GPIO_TogglePin(GPIOB, GPIO_PIN_0|GPIO_PIN_7|GPIO_PIN_14);
 		 HAL_Delay(50);
 		 HAL_GPIO_TogglePin(GPIOB, GPIO_PIN_0|GPIO_PIN_7|GPIO_PIN_14);
 		 HAL_Delay(50);
 	 }
 
 }
 __HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU);
 
 
 for(int i =0; i<4; i++)
 	 {
 		 HAL_GPIO_TogglePin(GPIOB, GPIO_PIN_0|GPIO_PIN_7|GPIO_PIN_14);
 		 HAL_Delay(750);
 		 HAL_GPIO_TogglePin(GPIOB, GPIO_PIN_0|GPIO_PIN_7|GPIO_PIN_14);
 		 HAL_Delay(750);
 	 }
 HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN1_HIGH);
 
 
 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 */
}

the above code of standby activation and wakup from pin PA0 is working with stm32f103 series and stm32f411 series but not working with stm32f7222ze Nucleo board .

This topic has been closed for replies.
MMARI.1
MMARI.1Best answer
Senior II
May 20, 2023

well . it's working if we uses __HAL_PWR_CLEAR_WAKEUP_FLAG(PWR_WAKEUP_PIN_FLAG4); instead of this __HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU); we need to specify the pin flag

3 replies

MMARI.1
MMARI.1Author
Senior II
May 18, 2023

stm32f7222ze first time going to standby mode and once you give the wake up then it's keep on going to initializing and and waking up automatically . any one please suggest me about stm32f7222ze nucleo board stand by activation and wakeup


_legacyfs_online_stmicro_images_0693W00000bkNrNQAU.png

Tesla DeLorean
Guru
May 18, 2023

STM32Cube_FW_F7_V1.17.0\Projects\STM32F722ZE-Nucleo\Examples\PWR\PWR_CurrentConsumption\Src\main.c

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
MMARI.1
MMARI.1AuthorBest answer
Senior II
May 20, 2023

well . it's working if we uses __HAL_PWR_CLEAR_WAKEUP_FLAG(PWR_WAKEUP_PIN_FLAG4); instead of this __HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU); we need to specify the pin flag