SPI DMA crashes when using WiFi
Posted: Tue Mar 19, 2024 9:59 pm
I'm using ESP32e and IDF v4.4.6. I'm using TFT_eSPI library to push images via DMA to ST7735 mini LCD. This works fine most of the time, until I try to do a simultaneous request to web server I have running in lower priority task.
Then this assert inside pushImageDMA fails:
By the way, is there an assert I can substitute that will give me the value of "ret" as well?
If I switch to the non DMA version of pushImage, there's no crash. Is there some contention between using ESP32 WiFi and SPI DMA? Interrupts don't work well together?
Also, if I make the WebServer task a higher priority, it just pre-empts/pauses LCD updates until the Web request finishes. The LCD updates just continue fine afterward.
Ideally, I'd like the LCD to keep updating regularly while lower priority web server requests are made. Any way I can accomplish this while using DMA updates?
Then this assert inside pushImageDMA fails:
Code: Untitled.c Select all
ret = spi_device_queue_trans(dmaHAL, &trans, portMAX_DELAY);
assert(ret == ESP_OK);
If I switch to the non DMA version of pushImage, there's no crash. Is there some contention between using ESP32 WiFi and SPI DMA? Interrupts don't work well together?
Also, if I make the WebServer task a higher priority, it just pre-empts/pauses LCD updates until the Web request finishes. The LCD updates just continue fine afterward.
Ideally, I'd like the LCD to keep updating regularly while lower priority web server requests are made. Any way I can accomplish this while using DMA updates?