we are gonna make a same GUI demo in several platforms to see which one is suitable for us , and one of them is LVGL of course ;
and the issue is after i completed the LVGL version , u can see some frame drops half of the times and fps actually drops down to 24 sometimes and cpu usage goes up to 100% as well which is not ideal.
we designed this demo with exact same rotations and animations in TouchGFX and we have got around 40% cpu usage at most and fixed 33fps all the time ;
so what can i do to optimize it ? is there any solution at all ?
would be appreciated if anybody helps;
thanks in advance.
What MCU/Processor/Board and compiler are you using?
i used 16 bits RGB colors for my images instead of 24 bit ( i’m using True Color images with alpha ),
i tried Timer interrupt instead of HAL_Delay for lv-task_handler()
enabled IAR optimization , Level is High and mode is Speed , that helps a lot but still isn’t enough.
Code to reproduce
lemme know if needed
Screenshot and/or video
these images rotating at the same time : ( 2x of middle image + another 2 images ) , so 4 animations in total , black images rotate to cover the blue background while gauge is rotating.
and the demo is like this :
i can upload a gif a bit later maybe , to show u how it works.
im actually new to LVGL and i used this project as i mentioned above ,
and if u mean this define : LV_USE_GPU_STM32_DMA2D in lv_conf.h file , yes thats 1 and enabled , but i didn’t do anything about DMA2D myself.
and another thing is looks like DMA2D doesn’t work with 16 bit color depth( True color Alpha mode ) , and when i checked my stm32f746 datasheet , i realized that DMA2D does not support such format ( 16 bit RGB + 8 bit alpha ) , so the only format that i can use is 24 bit RGB + 8 bit alpha ( LV_COLOR_DEPTH = 32 in LVGL library )
anyway with 32 bit colors and DMA2D on it is still not ideal and we have frame drops
If you have a (dump) display which is directly connected to STM32Fxx LCD hardware,
you use a frame buffer which is of course located in SDRAM (because of the size needed).
LVGL’s working buffer (I think this is what embeddedt is talking about) is (has to be!?) located within the internal SRAM because the internal SRAM has the better performance.
The working buffer hasn’t to be the size of a full frame buffer size. Of course, because the internal RAM is normally not large enough.
In this case you only need a single buffer. That is what you setup with the call of lv_disp_buf_init (…).
According what is available you can set this buffer smaller or larger (e.g. lv_color_t working_buffer[LV_HOR_RES_MAX * 40];).
Hello again everyone,
I was busy working on another project but now the problem about FPS still exist,
For a little update; I ported LVGL to STM32H750B-DK board (I did use STM32F746G-DK project as a template) and this the target I’m currently using.
on this board, the FPS goes down to even 20 (with optimization none in the IAR project setting) when all of the rotating images are inside the screen, when some of those rotating images goes off the screen, the FPS will increase to 33 again.
Are there any ideas how to get higher FPS? the closer to 60fps the better.
And another thing is, I’m just hesitant that DMA2D working fine or not, because enabling and disabling it (Via lv_conf.h → LV_USE_GPU_STM32_DMA2D) don’t have any impact on the FPS, is that makes sense? Or something is wrong in between? Please let me know if you have an idea.