-
Notifications
You must be signed in to change notification settings - Fork 7.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TW#15819] GPIO 36 & 39 input interrupt continually fires for high input when ADC1 is also in use (IDFGH-3954) #1096
Comments
Do you have any external pull-up resistor on the GPIOs? Since there are no internal pull-ups on input-only IOs. |
I have an external pull-down resistor... must it be a pull-up? In any case, this is occurring when the pin is being held high by a constant 3.3v source (not floating). |
Bug list has been updated:
|
All the comments (in code) as well as section 3.11 as part of https://www.espressif.com/sites/default/files/documentation/eco_and_workarounds_for_bugs_in_esp32_en.pdf only either state: So, if I'm not using ADC I'm fine with using GPIO36/39, hm? And as far as I can see there's no official info about GPIO36/39 /not to be used at all/ in conjunction with WiFi - no matter if ADC is in use or not. This issue hit me really, really hard - and given all the docs and reports I'm aware of now, it's not covered by a single warning / errata entry. I would still not know about it if I didn't walk straight into it. So either I'm overlooking sth. or I'd really appreciate a big fat warning stating sth. alike: "Do expect frequent (internal) state toggles and (bound) interrupts on GPIO36/39 when using WiFi!" |
And why on earth do GPIO36/39 only toggle states, when being pulled high? No interrupts triggered when left floating. |
Silicon bug or bad driver code? And it has nothing to do with the ADC, I do not use it. |
I ran into exactly the same issue. I've spent hours reading the documentation and trying to figure out why. |
Hi folks, sorry we forgot to update this issue when we closed #4117. The issue you are observing is a hardware bug, as mentioned in section 3.11 of https://espressif.com/sites/default/files/documentation/eco_and_workarounds_for_bugs_in_esp32_en.pdf. The workaround for this issue has been recently merged into master branch. A note has been added in the docs on how to enable this workaround in the application: d890a51. |
@igrr As mentioned by more than just me in this ticket, 3.11 doesn't cover the issue - at least not sufficiently. It's happening without using ADC and during operation, way after peripherals where powered up. Apart from that, it does not mention WiFi at all. It mentions SARADC1+2, which in fact is related to WiFi, as WiFi power saving uses the ADC, but one has to know that. EDIT:
Ok, that's at least addressed by d890a51, but still not part of the PDF listing the erratas. |
Agree - I'm also seeing this issue, no problem when floating, but GPIO36 triggers "fake" interrupts when pulled high and WIFI enabled (I'm not using the ADC or any power saving features) |
Is the problem only the fact that interrupts keeps firing? |
Why this ticket got closed and/or what's the relation to the issue mentioned here. Is it an acknowledged bug? |
Hi! |
I figured out a workaround that does the job for me. So on every interrupt i compare the pin level with the previous pin level and that's how i can figure out if a real interrupt happended. Pseudo code would be something like that (I don't know how to write proper pseudo code): int pinLevels[GPIO_PIN_COUNT];
void init(void)
{
configExti(); // configure all used pins as GPIO_INTR_ANYEDGE
readPinLevels(); // read pin levels of all exti pins to "int pinLevels[GPIO_PIN_COUNT]"
}
void onExti(gpio_num_t pin)
{
gpio_ex_extiEvent_t event;
if (!getEvent(&event, pin))
{
return;
}
// use pin and event here
}
bool getEvent(gpio_ex_extiEvent_t* event, gpio_num_t pin)
{
int level = gpio_get_level(pin);
int prevLevel = pinLevels[pin];
pinLevels[pin] = level;
if (prevLevel == 0 && level == 1)
{
*event = GPIO_EX_EXTI_RISING;
return true;
}
else if (prevLevel == 1 && level == 0)
{
*event = GPIO_EX_EXTI_FALLING;
return true;
}
return false;
} |
I'm seeing this issue with phantom interrupts too. It was working fine then I updated to ADF v2.5-82-gbcad553 and IDF v4.4.4-698-gcc71308e2f and the issue appeared. Before that I was on IDF #3C86C2213C from 20 March 23, so in that time someone broke something in the GPIO interrupts.... The GPIO I'm having issues with is 39. I am running wifi and adc but I set a flag to ignore interrupts during adc operations and when enabling WIFI. My workaround is to set the ints to any edge. Then I set a flag to ignore and further rising ints until I've seen a falling one. Weird how I can get multiple rising edges without seeing a falling edge, but that is what appears to happen. |
GPIO 36 and 39 trigger false ISR's in esp-idf v4.4.0. This caused the button task to run too much, starving other tasks. See espressif/esp-idf#1096.
GPIO 36 and 39 trigger false ISR's in esp-idf v4.2.0. This caused the button task to run too much, starving other tasks. See espressif/esp-idf#1096.
I'm finding that when I use GPIO 36 or 39 as an input that when the input signal is high and ADC1 is in use on other pins that the GPIO interrupt repeatedly fires. Disabling use of ADC1 or using other GPIO inputs (such as 37 or 38) does not cause this issue to occur. The values read from 36 and 39 still appear to be correct, but the continual firing of the interrupt is an obvious inefficiency.
See also:
https://www.esp32.com/viewtopic.php?t=1472
The text was updated successfully, but these errors were encountered: