Distort images on display

Hi,

I have problems when drawing basic shapes using the LVGL library. I’m using the latest version(as I know the 9.0). The MCU I’m using is the stm32L4. My display is 480x800 pixels using the format RGB332(8 bits per pixel). I’m trying to draw a basic shapes such as rectangles. However the image appears distorted. I tried to draw a single line and it appears as it should, only have problems with bit more complex shapes. I’m refreshing my screen in the callback function by writing the colors directly to the Videomemory.

Below you can see a screenshot of the problem. See how both of the sides of the rectangle appear differently(which is not correct). Colors and coordinates are set properly, this is not a problem.

Screenshot

Any ideas? Why only the vertical lines appears like this, and the rest of the rectangle is drawn correctly?

Thanks in advance.

I’m assuming this issue does not appear in the simulator with your code and only appears in hardware.

The issue could be with your display driver in the flush callback function where you write to the video memory. LVGL calls the flush callback multiple times to render in chunks and the spacing and the pattern of the distortion could potentially be indicative of something going wrong there.
https://docs.lvgl.io/latest/en/html/porting/display.html

Other people might have other ideas but just figured I would throw this out there as a potential place to look.