Garbage pixels when using theme

What do you want to achieve?

Hi, i want to use SquareLine Studio’s theme manager, so i can change between my different themes with diff background and text color.
I am using the latest SquareLineStudio and LVGL8.4 but tried with previous SquareLine also. I have different screens, so when i changes them backward or forward, these garbage pixels or set of pixels are showing in different positions randomly on the entire screen. Also there are few labels that are constantly updating, and on that screen, these pixels are constantly appearing in random coordinates.

The controller behind this display is an ESP32-WROOM with 2MB PSRAM and 16MB flash if this matters.

The images are stored in a hex in a way like:

#include "../ui.h"

#ifndef LV_ATTRIBUTE_MEM_ALIGN
#define LV_ATTRIBUTE_MEM_ALIGN
#endif

const LV_ATTRIBUTE_MEM_ALIGN uint8_t ui_img_png_data[] = {
0x67,0x08,0xFF,0x67,0x08,0xFF
x19,0xFF,0x12,0x19,0xFF,
    };
const lv_img_dsc_t ui_img_png = {
   .header.always_zero = 0,
   .header.w = 480,
   .header.h = 320,
   .data_size = sizeof(ui_img_png_data),
   .header.cf = LV_IMG_CF_TRUE_COLOR_ALPHA,
   .data = ui_img_png_data};

What have you tried so far?

Tried to tweak lv_conf.h, no luck. When i roll back my code to not use themes, there is no garbage pixels.
The problem only appears on a new batch of WT32-SC01-Plus hardware, because i have an older one from 2023, and there is no such problem on that. So maybe they changed something on the hardware so the memory or timings are more strict? or I do not know…

Screenshot or video

Others

  • SquareLine Studio version: latest
  • Operating system: Win11
  • Target hardware: WT32-SC01-PLUS

Thanks for your help in advance!

Hi,

Unfortunately, it’s difficult to pinpoint the exact cause as several issues could be responsible. However, I would suggest trying these steps first, as they address the most common culprits for this type of graphical artifact on new hardware.

1. Optimize LVGL Memory Settings

Theme switching can stress memory management, leading to corruption that appears as garbage pixels. Increase LVGL’s memory pool and buffer count to provide more headroom.

In your lv_conf.h file, try these adjustments:

// Increase the general memory pool size
#define LV_MEM_SIZE          (64U * 1024U) 

// Use two screen buffers (double buffering)
#define LV_DISP_BUF_NUM      2

// Slightly increase the refresh period to reduce load
#define LV_DISP_REFR_PERIOD  30     // in milliseconds

2. Reduce SPI Display Frequency

New hardware revisions can sometimes be less tolerant of high SPI speeds, causing data corruption during transmission to the display. Lowering the clock speed can improve stability.

Try reducing the SPI clock for your display. For example, if you are currently using 80MHz, test with 40MHz or even 20MHz. This setting is typically found in your display driver’s initialization code (e.g., within the esp_lcd_panel_io_config_t or a similar SPI configuration struct).

These adjustments target the most likely causes of graphical artifacts on new hardware and should provide a more stable environment for LVGL, resolving the garbage pixel issue.