Question
Enable Interrupt for Blue Button on NucleoF411
Posted on February 21, 2015 at 18:14
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 enableEXTI15_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:
//
// blue button
//
rcc_enable_gpioc();
gpio_config(
devices.gpioc,
GPIO_PIN_13,
GPIO_MODE_INPUT,
GPIO_OUTPUTTYPE_PUSHPULL,
GPIO_OUTPUTSPEED_LOW,
GPIO_PULL_PULLDOWN,
GPIO_ALTERNATEFUNCTION_0
);
//
// enable external irq for the button on pin 13
//
rcc_enable_syscfg();
syscfg_config(SYSCFG_PIN13, SYSCFG_EXTERNALINTERRUPT_PORTC);
exti_config(
EXTI_LINE13,
EXTI_INTERRUPT_ENABLED,
EXTI_EVENT_DISABLED,
EXTI_RISINGTRIGGER_ENABLED,
EXTI_FALLINGTRIGGER_DISABLED
);
nvic_enable(EXTI15_10_IRQn);
nvic_enable(EXTI9_5_IRQn);
nvic_enable(EXTI4_IRQn);
In the ISR onlyIRQ 56 is raised.
// quick n dirty, just to test
// the Interrupt vector table uses only this function!
void
interrupts_interruptrequest()
{
uint32_t r = devices.scb->device->ICSR.VECTACTIVE;
// r is always 56 !!
if( r==56 )
{
gpio_toggle(devices.gpioa, GPIO_PIN_5);
devices.exti->device->pending.s.line13 = 1;
}
}
Any ideas??
Thank you Noah #nucleof411-nvic-interrupts