-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Crash when using FunctionalInterrupt.h
handler
#8887
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
Comments
Can you try with your handler specifically declared in IRAM: IRAM_ATTR void handler ()
{
counter++;
} The
|
@d-a-v Not pitching my PR - OK, just a little bit - but I remembered that I had done work on FunctionalInterrupt etc and I've verified that #6047 fixed the ambiguity error you found. |
I could not reproduce the issue with the native handler. However, in my application where the problem comes from, I tried getting rid of the |
@petersohn Not saying it's related to your crash, but you should call |
Yes, I missed the I could reproduce the issue without
|
@petersohn Every bit of code that may run inside the interrupt service routine must be in IRAM. |
If that's true, it makes the bug in |
It is a well documented fact. What about the question that your interrupt frequency is just to high to handle? |
Then why is
In the real application, the problem comes up regardless of interrupt frequency. It just takes more time to reproduce. I used the frequency I did because it can reproduce the problem relatively fast. |
FunctionalInterrupt.h
handler
Basic Infos
Platform
Settings in IDE
Problem Description
If I use an interrupt handler that triggers frequently, the program will crash after some time. When the ESP resets after the exception, Wifi connection can no longer be established.
To reproduce, I connected an oscillator to the port where the interrupt is attached. I use GPIO 2 in this example which is available on an ESP01, but I could reproduce it with different ports, for example GPIO 3 (AKA serial RXD), or on an ESP12 with GPIO 5. I run the oscillator at about 20 Hz. The problem also occurs at lower frequencies, but it might take more time.
MCVE Sketch
Stack Trace
Debug Messages
The program runs fine for about 10 minutes on my scenario (it's random, and occurs earlier if the oscillator runs at higher frequency). Then I get an exception (stack trace above).
Then the ESP reboots, but the Wifi connection cannot be established.
The text was updated successfully, but these errors were encountered: