-->
Page 1 of 2

FreeRTOS, interrupts and GPIO2

PostPosted: Fri Feb 19, 2016 9:20 am
by papadeltasierra
I'm trying to trigger interrupts via GPIO2 and it's not working - can anyone tell me why? I'm using the FreeRTOS platform and the code that sets up the GPIO is as follows:

Code: Select allGPIO_ConfigTypeDef gpio_def;

gpio_def.GPIO_IntrType = GPIO_PIN_INTR_ANYEDGE;
gpio_def.GPIO_Mode = GPIO_Mode_Input;
gpio_def.GPIO_Pin = GPIO_Pin_2;
gpio_def.GPIO_Pullup = GPIO_PullUp_DIS;

gpio_intr_handler_register(gpio_interrupt_handler, NULL);
gpio_config(&gpio_def);


Something is not right because the interrupt routine is never triggered, even if I 'by hand' force GPIO2 high or low. So what's the key thing that I've missed?

Thanks,
Papadeltasierra

Re: FreeRTOS, interrupts and GPIO2

PostPosted: Thu Mar 17, 2016 7:32 pm
by kostbill
I am having the same problem, except I am trying to work with the GPIO_in_13.

I use exactly the same piece of code but it doesn't work.

Did you find the solution?

Re: FreeRTOS, interrupts and GPIO2

PostPosted: Fri Mar 18, 2016 2:54 am
by kostbill
I had a small progress. I added the line
_xt_isr_unmask(1<<ETS_GPIO_INUM);

and now, every time an interrupt is fired, the system reboots.
I didn't spot the reason, it was too late, but I will do it today.

Any ideas?

Re: FreeRTOS, interrupts and GPIO2

PostPosted: Tue May 31, 2016 6:02 am
by gustavo
Did you solved it?

I keep getting infinite callbacks.
Can't find the way to clean the interrupt register.