LVGL v8 on ESP32 - esp-idf v4.4 - CPU usage in 100% always, please help

Hi, I have the following problem when I try to play a gif or display an image, the percentage of CPU usage goes to 100% and does not go below that value.
What I already tried to do to improve performance is the following:

  • Speed of the esp32 to 240Mhz.
  • QIO mode and 80Mhz in the flash and psram.
  • freertos with period of 1000hz
  • changes in refresh rate 30ms and 1000ms
    without any positive results.
    I clarify that the image is converted with the online converter from lvgl to RGB565 swiped binary, it is loaded from a partition as a .bin file.
    The display that I am using is 3.2" and it uses the ST7789v controller, I have it connected by SPI in mode 2 and at 80Mhz.
    Any suggestion to solve this problem?

Simple and easy-to-use ESP32 lvgl display drive(esp-idf) - My projects - LVGL Forum

That is a bit strange since you’re using a ST7789 Display which does a lot of the work.

Perhaps you could try using the image as C-Array instead of bin. But thats just a try.

Or try using the SquareLine software to generate the code as a mother option.

Simply you show zero code , then nobody can help, but my tip you repeat loading bin data and this overload your mcu. Try once load and decode into SPIRAM and on gui objects address this area instead files.
Or your animated image size is too big for example 300x200 overload mcu too.

Hi, thanks for your comments.
Changing the .bin image read from a spiffs partition to C-array worked very well, since after the image is loaded the percentage of CPU usage remains at 0%, I tried the same with a gif and now it moves a lot better, and although the CPU does not reach 100% it varies between 67% and 87%. Given this, it is possible that the error is in the way I read the file from the partition. The next thing I am going to try is to change from SPIFFS to fatfs or LittleFS, since I need to have the separate firmware images to be able to change them without having to change the whole firmware.
If switching to another filesystem doesn’t work, I’m going to try the suggestion in another comment of loading everything into PSRAM.
As soon as I have news, I’ll let you know how it went.

1 Like