2009-05-30 12:26 AM
Info: Use of the EXTI requires the AFIO clock!
2011-05-17 04:12 AM
I had an issue with interrupts on a GPIO pin over the last few days. Since I notice that others have had issues with this feature here I thought I'd post my findings.
To get interrupts working on a GPIO pin you need to 1) Configure the GPIO pin & enable the clock for the port. 2) Configure the EXTI. 3) Configure the NVIC. What the reference manual etc don't say is that you MUST enable the AFIO clock for the EXTI to operate. It is NOT enough just enable the clock for the port you're using. This should be done between steps 1) & 2) above. I hope this saves someone a few days of frustration.2011-05-17 04:12 AM
Hi,
I've just been working through the fimware lib example 'NVIC\Priority' and found that the example uses 'RCC_APB2Periph_AFIO' in the RCC_APB2PeriphClockCmd call. When I removed this the EXTI interrupt still worked. To me it seems it makes no difference. RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOB | RCC_APB2Periph_AFIO, ENABLE); RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOB, ENABLE); Both versions of the above code allow the EXTI to work when I tried it. I don't know what to think! Regards, Nick.2011-05-17 04:12 AM
Hi,
Refer to my post at this Thread : We will enhance the RM0008 manual to make the usage more visible and easy for your designs. Cheers, STOne-32.2011-05-17 04:12 AM
I was told by an ST FAE that the AFIO clock was required when using the EXTI after I spent a day trying to get my code to work. As soon as I enabled it (it wasn't already) everything worked. The FAE agreed that the reference manual was vague about this ''feature''.
2011-05-17 04:12 AM
Hello,
Can somebody kindly figure out what is comparable to AFIO registers for STM32L devices :o Thank you.2011-05-17 04:12 AM
Can somebody kindly figure out what is comparable to AFIO registers for STM32L devices :o
They are in the SYSCFG unit according to the Reference Manual. SYSCFG_EXTICRx
2011-05-17 04:12 AM
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOB | RCC_APB2Periph_AFIO, ENABLE);
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOB, ENABLE);
Both versions of the above code allow the EXTI to work when I tried it. I don't know what to think! Presumably, the AFIO clock is also being enabled somewhere else in the code?
2011-05-17 04:12 AM
Refer to my post at this Thread :
http://www.st.com/mcu/forums-cat-8453-23.html
That link doesn't work! It just takes me to the list of forums!
(still waiting for a decent thread-linking capability on the ST forums)