Why is DMA called many times in disp_flush on STM32F746 example?

Using DMA is always saving processing time.

Of course, using larger buffers would ‘save’ some processing time, as initiating a new DMA transfer needs some time.

On the other hand, micro controllers are restricted in RAM size.

But take a look into the code. What is set for buffer size?
It’s LV_HOR_RES_MAX * 68. (LV_HOR_RES_MAX = 480)
So 480 * 68 = 32 640.
As the color size is 16 bit (I assume), buffer size is 32 640 * 2 = 65 280 (0xff00)
This is slightly less than the full unsigned 16-bit value of (0xffff)

As you may have learned from this thread :wink: (Stm32f429 + ili9341 spi),
DMA transfer size is limited to 16 bit.

But there is one interesting question:
As I see, the example is setting up (and using?) two buffers.
I always thought two buffers are setup when using double buffering. But that would need full frame buffer size.
‘Processing’ time could be saved if lvgl is using two buffers (as in this example), drawing into one buffer,
while the other buffer is used for transferring the content via DMA to real framebuffer.
Is this the case?

1 Like