Closed sascha432 closed 1 year ago
Finally I got a stack trace .. it crashed in ESP32RMTController::interruptHandler(void *arg) of FastLED. Seems I called FastLED.show() before using NeoPixel. Removing the show() call fixed the issue.
I added a method to deinitialize FastLED, that I can switch back and forth.
void ESP32RMTController::deinit()
{
if (!gInitialized) return;
if (gTX_sem) {
xSemaphoreTake(gTX_sem, portMAX_DELAY);
}
if ( ! FASTLED_RMT_BUILTIN_DRIVER) {
// -- Deallocate the interrupt if we have one
if (gRMT_intr_handle != NULL)
esp_intr_free(gRMT_intr_handle);
gRMT_intr_handle = NULL;
}
if (gTX_sem != NULL) {
xSemaphoreGive(gTX_sem);
vSemaphoreDelete(gTX_sem);
gTX_sem = NULL;
}
for (int i = 0; i < gMaxChannel; i += gMemBlocks) {
gOnChannel[i] = NULL;
if (FASTLED_RMT_BUILTIN_DRIVER) {
rmt_driver_uninstall(rmt_channel_t(i));
} else {
// -- Disable the RMT transfer
rmt_set_tx_thr_intr_en(rmt_channel_t(i), false, PULSES_PER_FILL);
}
}
// the next show() call will initialize the RMT controller again
gInitialized = false;
gNumStarted = 0;
}
Hi,
I recently compiled my ESP8266 code for ESP32 and had trouble with FastLED and multiple PINs. So I gave NeoPixel a shot, but I ran into issues with a single PIN.
The versions I tried were master, 1.11.0, 1.10.7 and 1.6.1. 1.6.1 seem to behave differently, but since it is old I did not play around with it a lot.
After starting, it seems to update the LEDs (16) one time, but the colors seem wrong. After one second (or less) they turn off and I get a WDT timeout and reset. There is not much information, no trace or anything...
All code runs in the loop() functions, no timers for animations or updating (show, setBrightness). So it should be running on core 1 only.
It is a custom board with a SN74AHCT125DR level shifter, so the timings are very accurate. The ESP8266 works with a single mosfet level shifter, timings are pretty bad compared to the SN74, but the same code works with FastLED, NeoPixel and my own implementation.
FastLED works fine with a single channel, accurate colors, no timeouts etc... I also tried WLED to rule out any hardware issues and there it works with all 4 channels and many LEDs (I tried 4x512). I did not write my own RMT driver for ESP32 yet.
Here is the info about the framework and hardware
The serial output