Disorder for pixels in LCD

Description

Hello.
I have designed a screen using squareline studio. in simulation mode it does not have any problems but when I program it on MCU, there will be pixel disorder.

I am using esp32-s3 module and arduino platform.

I am using lvgl version 8.3.11.

the output on the screen has to be like the screen designed and ran in the simulator.

in below there are two images. one from LCD and another one is from simulator.
you can see the pixel disorder on the top of the LCD.

image

This looks like a mismatch in either pixel format, endian, or R<->B. You can try drawing a few different things to debug. There are settings in LVGL and maybe in your display driver that may need set. Here are some of the settings that may be related:

  • CONFIG_LV_COLOR_DEPTH (LVGL)
  • CONFIG_LV_COLOR_16_SWAP (LVGL)
  • Display Driver RGB vs BGR setting(if display has this)
  • Display Driver pixel endian setting(if display has this)

Try these, one at a time, and if they don’t work, review the settings above for any issues. I’ve noted the setting that usually fixes it for me:

  1. Draw a solid green screen(0x00FF00) - does it come out green? If not, try toggling CONFIG_LV_COLOR_16_SWAP
  2. Draw a solid red screen(0xFF0000) - does it come out red? If not, try toggling RGB vs BGR

Sorry for late replying.
I tried everything and there was not any problem. BGR, RGB settings were right and pixel format was Ok.
in the middle of some testing I realized if I update widgets in the header they go out of order. I commented the part of code that was updating widgets in the header, and everything was fine and no disorder happened. I uncommented code for updating battery, then only battery widget had pixel disorder.

for the record I am using Nokia 1.8 inch LCD and SPFD54124B driver.
library URL

as you see in the image below the battery widget is corrupted but other widgets are fine as they are not updating

this is the function I use for updating battery bar:
lv_bar_set_value(ui_BattBar, batteryAnimationState, LV_ANIM_OFF);

what do you think can be the problem ?

Check flush display cb for edge display size values…

Hello @kisvegabor.
Do you have any solution for this problem ?
Thanks.

Hi,

Probably it’s just an off by one issue in the flush_cb. Try calling the flish_cb directly (without LVGL) with special parameters. E.g.

  • draw 1 pixel at 0;0
  • draw 1 pixel at 0;1
  • draw 1 pixel at 1;0
  • draw 1 pixel at 1;1
  • same for 2x2 pixel
  • draw a full line
  • draw a full column