-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Fix PWM crashes on ESP8266 #4035
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
Conversation
Vendor in the ESP8266 Arduino core PWM library, with a fix for a nasty NMI crash bug. Sometimes the NMI return instruction seems to fail, resulting in an infinite loop as the PC gets stuck. Work around this by backing up and restoring the PC if needed.
|
@tablatronix @softhack007 @gaaat98 can you test this PR please? |
|
Hi! Sorry for the late reply but I was travelling. I did not do any stress test, but I can say that with the fix, the ESP8266 PWM light did not crash when UDP synced with an ESP32, even with the clock speed set to fastest. Before, it crashed in a few seconds, but now I was able to have it working for more than 10 minutes with sound reactive effects going! Thanks a lot for your great work and research effort!! |
|
@softhack007 any second thoughts before merging? |
Add additional clarification as to the original source URL and the specific local patches.
softhack007
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 looks good for me, thanks
|
I have not, my rgb lights are now in my pool, but I just got some small ones for bench testing. Will try to try to wire a tester up |
|
FYI: This apparently also fixed my Athom 15W bulbs crashing every few seconds when controlled by LedFx. Installed WLED_0.15.0-b5_ESP02_160.bin.gz on these, and crashing problems are gone. Thanks! |
Vendor in the ESP8266 Arduino core PWM library, with a fix for a nasty NMI crash bug. Sometimes the NMI return instruction seems to fail, resulting in an infinite loop as the PC gets stuck "returning" to the NMI handler itself. Work around this by backing up and restoring the PC (and PS) from the last known good target values if needed.
I've opted to place the code in the platformio "libs" folder, which makes it easy to conditionally include for ESP8266 builds via platformio.ini.
Fixes PWM crash issues issues described in #3962.