Skip to main content
David.Cheng
Associate III
June 20, 2019
Question

Interrupt gets executed but the CPU stays in WFI

  • June 20, 2019
  • 0 replies
  • 530 views

stm32f407

i code in RTEMS, system sleep function will call __wfi , i can not wake up from sleep by pressing key

rtems_isr EINT95_handler(rtems_vector_number vector)
{
 
 if(EXIT_PR & 0x200)
 {
 printk("exit 9 hap\n");
	 int pin = STM32F4_GPIO_PIN(0,9); // pa9
		bool val;
		val = stm32f4_gpio_get_input(pin);
		
		
 volatile int j = 20000;
 for(; j > 0; j--) j = j;
 //rtems_counter_delay_nanoseconds(5000000);
		if(val == stm32f4_gpio_get_input(pin))
 { 
			f_key_pressed = 1;
 printk("key1\n");
 } 
		EXIT_PR = (1<<9);	
	}
 
}

KEY init code is here https://gist.github.com/goog/e81f68b3392fe7fc6730239c48305cbc

SLEEPONEXIT bit is 0

This topic has been closed for replies.