Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By papadeltasierra
#41453 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
User avatar
By kostbill
#43472 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?