# ESP32 Display SUNTON flickering

**URL:** <http://forum.squareline.io/t/esp32-display-sunton-flickering/1177>\
**Category:** How to\
**Created:** [April 25, 2023, 6:23pm UTC](http://forum.squareline.io/t/esp32-display-sunton-flickering/1177 "2023-04-25T18:23:42Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![werde45](http://forum.squareline.io/user_avatar/forum.squareline.io/werde45/32/683_2.png) [@werde45](http://forum.squareline.io/u/werde45)\
**Post date:** [April 25, 2023, 6:23pm UTC](http://forum.squareline.io/t/esp32-display-sunton-flickering/1177/1 "2023-04-25T18:23:42Z")

</div>

### What do you want to achieve?

Compile any LVGL Demo without flickering.

### What have you tried so far?

Arduino IDE 2.x and latest Arduino\_GFX and LVGL and all demos are able to compile but screen flickers. The precompiled binary from vendor works fine. I have two of them and all the same problem. No idea what to fix.

### Screenshot or video

### Others

- **SquareLine Studio version:** 1.23
- **Operating system:** Windows 10
- **Target hardware:** ESP32-4827S043 board from SUNTON

---

<div class="post-metadata">

**Author:** ![kisvegabor](http://forum.squareline.io/user_avatar/forum.squareline.io/kisvegabor/32/537_2.png) [@kisvegabor](http://forum.squareline.io/u/kisvegabor)\
**Post date:** [April 27, 2023, 7:19am UTC](http://forum.squareline.io/t/esp32-display-sunton-flickering/1177/2 "2023-04-27T07:19:58Z")

</div>

Can you send a video about the flickering? It’d help a lot the figure out what can be the root of the problem.

---

<div class="post-metadata">

**Author:** ![werde45](http://forum.squareline.io/user_avatar/forum.squareline.io/werde45/32/683_2.png) [@werde45](http://forum.squareline.io/u/werde45)\
**Post date:** [April 27, 2023, 7:48am UTC](http://forum.squareline.io/t/esp32-display-sunton-flickering/1177/3 "2023-04-27T07:48:45Z")

</div>

Hi.

Not easy to see. One pixel is on, the next is off.

The display is okay.

Please see attached video.

Or not. I’m not allowed to upload video. I’m new.

---

<div class="post-metadata">

**Author:** ![werde45](http://forum.squareline.io/user_avatar/forum.squareline.io/werde45/32/683_2.png) [@werde45](http://forum.squareline.io/u/werde45)\
**Post date:** [April 27, 2023, 6:40pm UTC](http://forum.squareline.io/t/esp32-display-sunton-flickering/1177/4 "2023-04-27T18:40:35Z")

</div>

Can you allow to upload video?

---

<div class="post-metadata">

**Author:** ![kisvegabor](http://forum.squareline.io/user_avatar/forum.squareline.io/kisvegabor/32/537_2.png) [@kisvegabor](http://forum.squareline.io/u/kisvegabor)\
**Post date:** [April 27, 2023, 7:19pm UTC](http://forum.squareline.io/t/esp32-display-sunton-flickering/1177/5 "2023-04-27T19:19:55Z")

</div>

I’ve increased your trust level. Now you should be able to upload videos.

---

<div class="post-metadata">

**Author:** ![werde45](http://forum.squareline.io/user_avatar/forum.squareline.io/werde45/32/683_2.png) [@werde45](http://forum.squareline.io/u/werde45)\
**Post date:** [April 27, 2023, 10:04pm UTC](http://forum.squareline.io/t/esp32-display-sunton-flickering/1177/6 "2023-04-27T22:04:53Z")

</div>



---

<div class="post-metadata">

**Author:** ![kisvegabor](http://forum.squareline.io/user_avatar/forum.squareline.io/kisvegabor/32/537_2.png) [@kisvegabor](http://forum.squareline.io/u/kisvegabor)\
**Post date:** [April 28, 2023, 9:25am UTC](http://forum.squareline.io/t/esp32-display-sunton-flickering/1177/7 "2023-04-28T09:25:21Z")

</div>

It’s really hard to see 🙂 So every second pixel is incorrect? If so, I think it’s a mismatch between LVGL’s and the display driver’s color depth configuration. E.g. the display driver somehow works with 32 bit data, but LVGL is configured to 16 bit (`LV_COLOR_DEPTH`),

What is interesting here is that in these cases usually the colors are messed up as well.

---

<div class="post-metadata">

**Author:** ![werde45](http://forum.squareline.io/user_avatar/forum.squareline.io/werde45/32/683_2.png) [@werde45](http://forum.squareline.io/u/werde45)\
**Post date:** [April 28, 2023, 8:04pm UTC](http://forum.squareline.io/t/esp32-display-sunton-flickering/1177/8 "2023-04-28T20:04:27Z")

</div>

Hi. I compare the values. My project is coded by an external guy and the same code is running correct if he compile it and if I compile it flickers. Library’s have same version. And the demos also flickers when I compile it. The same as binary works fine.  
There must be an (simple?) problem. Color depth is possible. I can check tomorrow.

---

<div class="post-metadata">

**Author:** ![werde45](http://forum.squareline.io/user_avatar/forum.squareline.io/werde45/32/683_2.png) [@werde45](http://forum.squareline.io/u/werde45)\
**Post date:** [April 30, 2023, 9:09am UTC](http://forum.squareline.io/t/esp32-display-sunton-flickering/1177/9 "2023-04-30T09:09:47Z")

</div>

Another video with my two identical displays. One is self compiled and the other is demo binary from seller.

---

<div class="post-metadata">

**Author:** ![werde45](http://forum.squareline.io/user_avatar/forum.squareline.io/werde45/32/683_2.png) [@werde45](http://forum.squareline.io/u/werde45)\
**Post date:** [April 30, 2023, 10:31am UTC](http://forum.squareline.io/t/esp32-display-sunton-flickering/1177/10 "2023-04-30T10:31:31Z")

</div>

I am unsure what the problem is.  
I compared the display settings but it flickers.  
What is the driver model? LVGL relies on GFX and then also TFT\_eSPI?

---

<div class="post-metadata">

**Author:** ![kisvegabor](http://forum.squareline.io/user_avatar/forum.squareline.io/kisvegabor/32/537_2.png) [@kisvegabor](http://forum.squareline.io/u/kisvegabor)\
**Post date:** [May 1, 2023, 8:04am UTC](http://forum.squareline.io/t/esp32-display-sunton-flickering/1177/11 "2023-05-01T08:04:47Z")

</div>

> [@werde45](#):
>
> What is the driver model? LVGL relies on GFX and then also TFT\_eSPI?

It’s up to the implementation. You can use any libraries you wish.

---

<div class="post-metadata">

**Author:** ![werde45](http://forum.squareline.io/user_avatar/forum.squareline.io/werde45/32/683_2.png) [@werde45](http://forum.squareline.io/u/werde45)\
**Post date:** [May 1, 2023, 12:33pm UTC](http://forum.squareline.io/t/esp32-display-sunton-flickering/1177/12 "2023-05-01T12:33:16Z")

</div>

Yes, of course. I just can not find the error and also the manufacturer writes only that it works with him. I am a bit at a loss. As a test I take LVGLWIDGETS and it flickers…Sorry. Is not your problem. But for 4 weeks I try and just can not find it. Have also tried another PC, other Arduino version and various libraries. It flickers.  
It should be a project to sell and so of course it is not functional…  
The problem must be fundamental that also the demos have the same problem as my own project.

---

<div class="post-metadata">

**Author:** ![kisvegabor](http://forum.squareline.io/user_avatar/forum.squareline.io/kisvegabor/32/537_2.png) [@kisvegabor](http://forum.squareline.io/u/kisvegabor)\
**Post date:** [May 2, 2023, 8:09am UTC](http://forum.squareline.io/t/esp32-display-sunton-flickering/1177/13 "2023-05-02T08:09:55Z")

</div>

I’m sorry to hear that, it’s really painful…

What I suggest is trying out the driver without LVGL. Just fill a rectangle in the middle of the display with red and see what happens.

---

<div class="post-metadata">

**Author:** ![werde45](http://forum.squareline.io/user_avatar/forum.squareline.io/werde45/32/683_2.png) [@werde45](http://forum.squareline.io/u/werde45)\
**Post date:** [May 2, 2023, 7:33pm UTC](http://forum.squareline.io/t/esp32-display-sunton-flickering/1177/14 "2023-05-02T19:33:20Z")

</div>

Yes…it flickers. try without LVGL. But i know it can run without flickering. Perhaps it is not flickering but an problem of redraw… If you see from buttom up…in an angle.

---

<div class="post-metadata">

**Author:** ![kisvegabor](http://forum.squareline.io/user_avatar/forum.squareline.io/kisvegabor/32/537_2.png) [@kisvegabor](http://forum.squareline.io/u/kisvegabor)\
**Post date:** [May 3, 2023, 8:37am UTC](http://forum.squareline.io/t/esp32-display-sunton-flickering/1177/15 "2023-05-03T08:37:04Z")

</div>

If you see the problem without LVGL too, unfortunately I can’t help much. ☹

I’d check the pixel clock config of the TFT, if it’s too slow or fast it can cause similar issues.

---

<div class="post-metadata">

**Author:** ![nobruinfo](http://forum.squareline.io/letter_avatar_proxy/v4/letter/n/7bcc69/32.png) [@nobruinfo](http://forum.squareline.io/u/nobruinfo)\
**Post date:** [August 1, 2023, 3:44pm UTC](http://forum.squareline.io/t/esp32-display-sunton-flickering/1177/16 "2023-08-01T15:44:35Z")

</div>

Sorry to come a bit late to this party. I recently got the same model from Sunton Store to become a bit of a smart home remote control. After unpacking the preinstalled widget demo showed fine. Then I ported the widget demo project from being an Arduino .ino file to [platform.io](http://platform.io) . According to @kisvegabor descriptions in LVGL I changed the somewhat older lines of gfx initialisation to:

```auto
// option 1:
// Uncomment for ILI6485 LCD 480x272
Arduino_ESP32RGBPanel *rgbpanel = new Arduino_ESP32RGBPanel(
    40 /* DE */, 41 /* VSYNC */, 39 /* HSYNC */, 42 /* PCLK */,
    45 /* R0 */, 48 /* R1 */, 47 /* R2 */, 21 /* R3 */, 14 /* R4 */,
    5 /* G0 */, 6 /* G1 */, 7 /* G2 */, 15 /* G3 */, 16 /* G4 */, 4 /* G5 */,
    8 /* B0 */, 3 /* B1 */, 46 /* B2 */, 9 /* B3 */, 1 /* B4 */,
    0 /* hsync_polarity */, 8 /* hsync_front_porch */, 4 /* hsync_pulse_width */, 43 /* hsync_back_porch */,
    0 /* vsync_polarity */, 8 /* vsync_front_porch */, 4 /* vsync_pulse_width */, 12 /* vsync_back_porch */,
    1 /* pclk_active_neg */, 9000000 /* prefer_speed */);

Arduino_RGB_Display *gfx = new Arduino_RGB_Display(
    480 /* width */, 272 /* height */, rgbpanel);

```

After that I had a working project with **flickering**. So I simply disabled the first row of inputs disabling DE by setting it to `0`. No idea what DE does.

```diff
- 40 /* DE */, 41 /* VSYNC */, 39 /* HSYNC */, 42 /* PCLK */,
+ 0 /* DE */, 41 /* VSYNC */, 39 /* HSYNC */, 42 /* PCLK */,

```

What shall I say, no more flickering.

---

<div class="post-metadata">

**Author:** ![nobruinfo](http://forum.squareline.io/letter_avatar_proxy/v4/letter/n/7bcc69/32.png) [@nobruinfo](http://forum.squareline.io/u/nobruinfo)\
**Post date:** [August 5, 2023, 7:46am UTC](http://forum.squareline.io/t/esp32-display-sunton-flickering/1177/17 "2023-08-05T07:46:43Z")

</div>

One more thing: Does someone in here know where to order a nice case für the 7" Sunton board? With my setup I’d prefer one for to put it on my table, so a tilted one would be nice. Currently I have the whole thing assembled into a Lego case which doesn’t perfectly fit. 🙂

---

<div class="post-metadata">

**Author:** ![werde45](http://forum.squareline.io/user_avatar/forum.squareline.io/werde45/32/683_2.png) [@werde45](http://forum.squareline.io/u/werde45)\
**Post date:** [August 22, 2023, 11:27am UTC](http://forum.squareline.io/t/esp32-display-sunton-flickering/1177/18 "2023-08-22T11:27:45Z")

</div>

FYI: [ESP32-4827S043 board from SUNTON - Flickers · moononournation/Arduino\_GFX · Discussion #291 · GitHub](https://github.com/moononournation/Arduino_GFX/discussions/291)
