4" TFT display using a ST7796s driver produces a white stripe which offsets actual screen

Description

4" TFT display using a ST7796s driver produces a white stripe which offsets actual screen content. I should note that I am a noob when it comes to C. I can do some stuff on my own but nothing complex.

LVGL actually runs, but I’ve hidden most widgets so only the background color is displayed. When aligning widgets to a specific corner of the screen, they actually rotate when I change the screen orientation, which is to be expected. However I can’t explain the white “uninitialized” (?) part. I don’t even know how to search correctly for this issue. Its place on the screen is also dependent on which orientation I choose, but is always visible.

I seem to have a similar issue to this thread, but I have a different setup. What else could I change to make this work? It seems to be anThis text will be hidden issue with the driver, but I can’t tell for sure.

What MCU/Processor/Board and compiler are you using?

ESP32-S3 DevKit-C, IDF 5.1.1

What do you want to achieve?

The x = 0, y = 0 screen origin is not in the correct spot

What have you tried so far?

Messing around in the driver (screen was mirrored in the x axis, but is now fixed)
Selecting ILI9488 as the driver (I’ve read that it was similar to mine, did not work)
Swapping horizontal and vertical resolution
Changing orientation

Screenshot and/or video

Link to the video:

I’ve also found out that somehow the frame buffer gets written correctly, but seems to get corrupted as time goes on and the display origin is offset.

Right after reset

A few moments later

So I have done more sanity checks. The HelloWorld .ino project from ArduinoGFX library running on Pro Micro seems to properly initialize the display, so that is not broken.

Is it possible to somehow “hijack” the Arduino driver and use it for LVGL on my ESP?
Any help is appreciated

Alright, seems as if the Blanking Porch Control was set up incorrectly. I took the commands from the ArduinoGFX’s driver, the commented line in st7796s.c was there previously.

lcd_init_cmd_t init_cmds[] = {
		...
		{0xB6, {0x80, 0x22, 0x3B}, 3},
		// {0xB6, {0x0A, 0x82, 0x27, 0x00}, 4},
		...
	};

The display is now drawn correctly, but there seems to be some shimmering on text and other elements.