Hi
I’m a first timer with LVGL, and displays/graphics libraries altogether, and need some advice regarding choice of frame buffers.
I am looking to use LVGL with a 5”, 800x480, no-touch, IPS TFT display (with a standard RAM-less onboard display driver IC, like EK9716B or ST7262E43).
A STM32H7 with LTDC display peripheral will be used with 16bit RGB565 interfacing to the display.
If possible I will prefer using only internal RAM for the frame and draw buffers, avoiding the more complex PCB layout for an external SDRAM, and the need for a larger pin count uC.
At the moment the STM32H7 with largest RAM is STM32H7A3 with 1.4MB (the newer STM32U5 has up to 3MB of RAM, but is slower than the H7 and lacks some other features needed in my application)
I have been looking at the LVGL docs about buffers, but am in doubt what configuration to use when using the LTDC peripheral with a 800x480 resolution RAM-less display driver IC.
Maybe I’m not understanding it correctly, but some of the info regarding buffers seems to apply only when using a dedicated display controller IC with internal RAM (e.g. ILI9341), as used in some lower resolution displays.
My main concern is to avoid any tearing effects. Is it possible to use only a single full-size frame buffer (plus one or two smaller 1/10 size draw buffers) and still avoid tearing?
Or is it necessary to use two full-size frame buffers (double buffering) to avoid tearing?
A single full-size frame buffer uses (800x480x16bit)/(8x1024) = 750kB. And the two 1/10 size draw buffers use 2x750kB/10 = 150kB. A total of 900kB which will fit fine in the 1.4MB of RAM.
But if two full-size frame buffers are necessary to avoid tearing it will occupy 2x750kB = 1.46MB, making external SDRAM necessary.
I would like to understand this tearing effect better and how to avoid it. If using only a single full-size frame buffer, are there use cases where tearing will occur, and others where it won’t? I.e. does it depend on the specific UI design?
I found the below answer on the NXP forum (https://community.nxp.com/t5/i-MX-Processors/Display-is-Flickering-in-Single-Frame-Buffer-Configuration/td-p/1730002)
“Using a single frame buffer means that all rendering have to be done during the period of VSW (VSYNC Pulse Width). If the rendering can’t be done before the end of VBP (VSYNC Back Porch) tearing will likely be observed on the screen”
My question is, does LVGL automatically make sure rendering only happens in the time period mentioned above, or should this be implemented somehow in the user code?
In my case the UI will be very minimalistic, with only rectangle boxes and text (quite similar to the examples below). No animations is used, except if possible the text should have a smooth ‘scrolling/crossfading’ effect when changing from one parameter to another.
The only animation-like graphic is the thin red ‘saw/triangle’ waveform (top-left in the second picture), which should change it’s slope when adjusting the corresponding parameter.
Best regards,
Pete