cancel
Showing results for 
Search instead for 
Did you mean: 

Are EXTI flag bits sticky?

Pavel A.
Evangelist III

I have an EXTI interrupt with a shared handler, EXTI15_10_IRQHandler

Normally there should be only pin 15 interrupt.

So I did this:

void EXTI15_10_IRQHandler(void)
{
    if ((EXTI_D1->PR1 & (1<<15)) != 0)
    {
       my_handler();
      EXTI_D1->PR1 = (1 << 15);
      __DSB();
      return;
    }
 
   __BKPT(1); //unexpected interrupt
}

And sometimes I hit the breakpoint.

Looks like the EXTI_D1->PR1 corresponds to EXTI_CPUPR1 in the RM.

In debugger, bit 15 of EXTI_CPUPR1 is indeed clear.

So the question is, do EXTI_CPUPR1 bits stay on until cleared by software or they can auto-clear when the GPIO pin changes state?

-- pa

10 REPLIES 10
Pavel A.
Evangelist III

Moving EXTI_CLEAR_IT() up and __ISB() seems to help.

Thanks.

-- pa