esp32s3 lcd display drift
Posted: Thu May 01, 2025 11:39 pm
I am driving a 480 * 480 RGB565 lcd display. I am getting display drift and want to understand the cause. My setup:
- simple FreeRTOS app with a few tasks
- using lvgl to render an animation
- 15 MHz PCLK, requiring (15 * 2 bytes) 30 MB/s DMA throughput
- 80 MHz Octal PSRAM = 80 MB/s
- double frame buffers in PSRAM (no room in IRAM even for a single buffer)
Using double buffers should avoid tearing etc., any rendering bottlenecks would cause uneven animation, but the screen should remain stable.
Display drift must be caused by slow DMA - copying pixels to the peripheral is not keeping up with PCLK?
But PSRAM bandwidth is more than double the DMA requirements, so it should be OK even when sharing the SPI bus with the cpu cores?
I tried using bounce buffers - two small buffers in IRAM with CPU intensive copy from frame buffer to bounce buffer. No real difference. I don't understand this because now the DMA is from IRAM to peripheral which has a much higher bandwidth and no contention issues. But because the bounce buffers are not full frame size, they must be updated fast enough by CPU copy from PSRAM frame buffer. Perhaps this is the bottleneck?
I'm looking for suggestions for a solid display without drift and with headroom for more task processing.
- simple FreeRTOS app with a few tasks
- using lvgl to render an animation
- 15 MHz PCLK, requiring (15 * 2 bytes) 30 MB/s DMA throughput
- 80 MHz Octal PSRAM = 80 MB/s
- double frame buffers in PSRAM (no room in IRAM even for a single buffer)
Using double buffers should avoid tearing etc., any rendering bottlenecks would cause uneven animation, but the screen should remain stable.
Display drift must be caused by slow DMA - copying pixels to the peripheral is not keeping up with PCLK?
But PSRAM bandwidth is more than double the DMA requirements, so it should be OK even when sharing the SPI bus with the cpu cores?
I tried using bounce buffers - two small buffers in IRAM with CPU intensive copy from frame buffer to bounce buffer. No real difference. I don't understand this because now the DMA is from IRAM to peripheral which has a much higher bandwidth and no contention issues. But because the bounce buffers are not full frame size, they must be updated fast enough by CPU copy from PSRAM frame buffer. Perhaps this is the bottleneck?
I'm looking for suggestions for a solid display without drift and with headroom for more task processing.