Skip to content
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

Fixed: arduino-esp32 2.0.5 calling abort() from espShow() #330

Merged
merged 2 commits into from
Sep 22, 2022

Conversation

rimim
Copy link

@rimim rimim commented Sep 21, 2022

  • Disabled calls to noInterrupt()/interrupt() in espShow() on ESP32. espShow() calls rmt_driver_install() which tries to acquire a mutex. Recursive mutexes are not allowed inside an interrupt context so lock_acquire_generic() calls abort().

  • Change only applies to ESP32 platforms and the calls to noInterrupt()/interrupt() are not needed as RMT will handle all the bit twiddling.

Disabled calls to noInterrupt()/interrupt() in espShow() on ESP32. espShow() calls rmt_driver_install() which tries to acquire a mutex. Recursive mutexes are not allowed inside an interrupt context so lock_acquire_generic() calls abort().
@rimim
Copy link
Author

rimim commented Sep 21, 2022

arduino-esp32 2.0.4 defines interrupts() and noInterrupts() as no-ops.

#define sei()
#define cli()
#define interrupts() sei()
#define noInterrupts() cli()

arduino-esp32 2.0.5 calls portENABLE_INTERRUPTS() and portDISABLE_INTERRUPTS().

// ESP32xx runs FreeRTOS... disabling interrupts can lead to issues, such as Watchdog Timeout
#define sei() portENABLE_INTERRUPTS()
#define cli() portDISABLE_INTERRUPTS()
#define interrupts() sei()
#define noInterrupts() cli()

This is why the NeoPixel library is crashing (calling abort) when compiled with 2.0.5. It's also why it should be valid to remove the calls to noInterrupt()/interrupt() as they never did anything on the ESP32 previously.

@brentru
Copy link
Member

brentru commented Sep 22, 2022

@rimim I also experienced this same issue with 2.0.5 and WipperSnapper, and traced it back to NeoPixel. Thanks for submitting a fix!

I've successfully tested this on a Feather ESP32 v2 running WipperSnapper (which shows the status of WiFi connectivity via the NeoPixel)

@ladyada ladyada merged commit 04225c2 into adafruit:master Sep 22, 2022
luc-github added a commit to luc-github/Marlin that referenced this pull request Dec 21, 2023
luc-github added a commit to luc-github/Marlin that referenced this pull request Jan 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants