Limit on GPIO Interrupt Handlers?

banjoluck
Posts: 25
Joined: Fri Jul 29, 2022 5:11 pm

Limit on GPIO Interrupt Handlers?

Postby banjoluck » Mon Jul 24, 2023 11:30 pm

Greetings,

Using an ESP32, I have GPIO inputs on pins 26, 27, 14, 34, 32, and 35. I am using this code snippet to enable interrupt handlers:

Code: Select all

    void enable_button_input_isr (gpio_num_t gpio_pin, void* pvUser) {
      {
        gpio_config_t config = {};
        config.intr_type = GPIO_INTR_ANYEDGE;
        config.pin_bit_mask = 1ull << gpio_pin;
        config.mode = GPIO_MODE_INPUT;
        ::gpio_config (&config);
      }

      ::printf ("# enable button interrupt on %d\n", int (gpio_pin));
      ::gpio_isr_handler_add (gpio_pin, button_isr, pvUser);
      ::gpio_intr_enable (gpio_pin); }
Except for input 34, all of them use the same ISR. The handler just reads all of the input current values and passes them along to the UI dispatch task. The trouble is that 32 and 35 do not trigger an interrupt. Is there a limit on the number of interrupt handlers we can enable? Or, is there some other limitation that isn't made clear in the documentation?

Cheers

meoychieu2004
Posts: 1
Joined: Tue Jul 25, 2023 7:18 am

Re: Limit on GPIO Interrupt Handlers?

Postby meoychieu2004 » Tue Jul 25, 2023 7:25 am

It should trigger interrupt, check the signal in the PCB.

User avatar
ESP_krzychb
Posts: 408
Joined: Sat Oct 01, 2016 9:05 am
Contact:

Re: Limit on GPIO Interrupt Handlers?

Postby ESP_krzychb » Sun Dec 01, 2024 12:44 am

Greetings!

The issue you’re encountering with GPIO 32 and 35 not triggering edge interrupts might be related to a known limitation described in the ESP32 errata documentation regarding GPIO interrupts within the same group of GPIO pins.

According to the documentation, edge interrupts cannot be used simultaneously and with other interrupt types for GPIO pins in the same GPIO group. In your cases GPIO 32, 34 and 35 belong to the same group.

Who is online

Users browsing this forum: Google [Bot] and 87 guests