Can't get DMA working with ESP32-S3 and ST7735 #3473
Replies: 5 comments 9 replies
-
Are you calling Lastly, try my example code in #3432 (first reply) with the following config: (try both HSPI and VSPI)
let me know how it goes! |
Beta Was this translation helpful? Give feedback.
-
I tried your pins, and added to my table above, it's the same results: first frame only. I'm still curious what you did to make VSPI work, as I always get a crash if I dont use HSPI. Seems that was the verdict in the other discussion too. I did try again with the manual startWrite and endWrite. But my understanding is if you do "initDMA(true)" it will do it automatically on the ESP32. Regardless, I've tried both ways, and doesn't make a difference. Using the sprite framebuffer there's a callocsprite() which I've swapped out to explicitly do the same malloc as yours for DMA, and it makes no difference in the results. I think my code is doing the same calls as yours now. I did previously try the TFT DMA example, and only got the first frame, just as reported by others in that other discussion. |
Beta Was this translation helpful? Give feedback.
-
I'm really curious about the only configuration where I get the same results with DMA and nonDMA is with the TFT_DC set to 17, but the updated frames are only correct sometimes, other times they are byte swapped, and they are always skewed. That configuration seems close, but wondering what the problems are with it. |
Beta Was this translation helpful? Give feedback.
-
crash : this happens at tft.init() -> writecommand() -> begin_tft_write() Within the begin_tft_write() it's the SET_BUS_WRITE_MODE macro failing. I expanded it at compile time and the code is:
|
Beta Was this translation helpful? Give feedback.
-
The only possible insight on updates not happening on the LCD is this description from stg that sounds like it might cause that.
|
Beta Was this translation helpful? Give feedback.
-
I've previously been using ESP32E-Devkit, and my code worked fine on there, with DMA working. Now, I'm porting application to ESP32-S3-devkit and have issues. TFT_eSPI 2.5.43. Arduino 2.0.17.
If I use the non-DMA calls, everything works fine. If I try a DMA update, the single first update works and then the display seems to be frozen, although all the code still seems to run. The general process is to do updates to the sprite framebuffer, and then the non-DMA vs DMA functions to push the changes are:
sprite.pushSprite(0,0);
tft.pushImageDMA( 0, 0, width, height, (uint16_t *)sprite.frameBuffer(1) );
I realize there's a couple of other discussions describing similar problems, and I've read through them and tried everything I could from those, but I haven't been able to get it to work. Namely these:
#2233
#3432
I've read the Espressif docs about the IOMUX vs MATRIX pins, and these should be the faster IOMUX ones:
CS0 1 | 10
SCLK | 12
MISO | 13
MOSI | 11
QUADWP | 14
QUADHD | 9
Here is a table of some of my test runs. Whether DMA updates occur beyond the first frame seem very dependent on the TFT_DC pin setting. If I use some of the UART pins there like 17, 18, I get some weird updates as described below. Can anyone make sense of the results, or any insights, or what else I should try?
I've tried various SPI_FREQUENCY values but doesn't change the results.
HSPI : means "#define USE_HSPI_PORT" is active
VSPI : means "//#define USE_HSPI_PORT" is commented out
NonDMA / DMA : means the calls used as above
works : updates are running fine
first frame : first update to the display works, then it's frozen (even non-DMA updates don't work after)
no response : display did absolutely nothing
mixed : display is updating, some frames are correct but skewed horizontally and vertically, some frames seem look byte swapped and also skewed
crash : this happens at tft.init() -> writecommand() -> begin_tft_write()
Beta Was this translation helpful? Give feedback.
All reactions