cancel
Showing results for 
Search instead for 
Did you mean: 

Interrupt gets executed but the CPU stays in WFI

David.Cheng
Associate II

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

0 REPLIES 0