AnsweredAssumed Answered

Enable Interrupt for Blue Button on NucleoF411

Question asked by n on Feb 21, 2015
Latest reply on Feb 25, 2015 by Clive One
Hello,

i have a Problem or misunderstanding enabling the Interrupts for the blue button on the nucleof411 board. In short:

The Interrupt is only raised when i enable
EXTI15_10_IRQn, EXTI9_5_IRQn and EXTI4_IRQn alltogether. If i enable only irq exti15_10 nothing happens (the isr is not called).

My test-code:


01.//
02.// blue button
03.//
04.  
05.rcc_enable_gpioc();
06.  
07.gpio_config(
08.    devices.gpioc,
09.    GPIO_PIN_13,
10.    GPIO_MODE_INPUT,
11.    GPIO_OUTPUTTYPE_PUSHPULL,
12.    GPIO_OUTPUTSPEED_LOW,
13.    GPIO_PULL_PULLDOWN,
14.    GPIO_ALTERNATEFUNCTION_0
15.    );
16.  
17.//
18.// enable external irq for the button on pin 13
19.//
20.  
21.rcc_enable_syscfg();
22.  
23.syscfg_config(SYSCFG_PIN13, SYSCFG_EXTERNALINTERRUPT_PORTC);
24.  
25.exti_config(
26.    EXTI_LINE13,
27.    EXTI_INTERRUPT_ENABLED,
28.    EXTI_EVENT_DISABLED,
29.    EXTI_RISINGTRIGGER_ENABLED,
30.    EXTI_FALLINGTRIGGER_DISABLED
31.    );
32.  
33.nvic_enable(EXTI15_10_IRQn);
34.nvic_enable(EXTI9_5_IRQn);
35.nvic_enable(EXTI4_IRQn);

 

In the ISR only IRQ 56 is raised.

01.// quick n dirty, just to test
02.// the Interrupt vector table uses only this function!
03.  
04.void
05.interrupts_interruptrequest()
06.{
07.    uint32_t r = devices.scb->device->ICSR.VECTACTIVE;
08.    // r is always 56 !!
09.  
10.    if( r==56 )
11.    {
12.        gpio_toggle(devices.gpioa, GPIO_PIN_5);
13.        devices.exti->device->pending.s.line13 = 1;
14.    }
15.}

Any ideas??

Thank you

Noah

Outcomes