Display glitching while connecting to WiFi: ESP32S3+8048S043

Hey guys.
Couple of small updates:

The demo from the video (All Makerfabs MaTouch Support LVGL - ESP32 Touch Display | SquareLine Demo - YouTube) still glitches on my Sunton display. Had to add a couple of lines to activate the backlight as that’s fixed on the Makerfabs display, but that shouldn’t be related. It doesn’t happen in the demo video because [I think] the loop speed is slow due to all the other stuff happening thats bogging down the mcu.
Once the sensor checking is removed and everything speeds up, the glitch happens.
Interestingly, it only happens on a new wifi connection. If connecting to the same network, it doesn’t seem to glitch anymore. Not sure why!

I also purchased the actual Makerfabs display from the demo. Exactly the same result.

Slightly off topic: the Makerfabs version doesn’t have backlight control, it’s fixed on hardware, so I prefer the Sunton as it can be dimmed by software after a period of inactivity for example …

Hi @ASMD ,

Thanks for the update, I am still waiting for my board to arrive, still saying 18th of July for delivery…

Kind Regards,

Pete

Hi @ASMD ,

I have received my board now and I have reproduced your problem, initially I updated the Arduino GFX to the latest (1.3.6) which has not helped…

I am now looking to use Arduino 2 as it claims to have a debugger which will make life easier to see what is happening I hope. I will continue to look into this with the new IDE and if I can see where the issue is I will back port a fix to the old version if you are unable to upgrade to Arduino 2 yourself for any reason.

Just before I steam into this, can you confirm you still have the issue?

Kind Regards,

Pete

Hi @pete-pjb,
That’s great news: and good to have a confirmation that yours is behaving the same way.
Sounds great, hopefully the debug works and will point to somewhere.
I didn’t have a lot of luck with Arduino IDE2 initially due to esp32 compilation taking absolutely forever (even on strong hardware) or just compiling for days without actually anything happening, so I stuck with 1.x. Maybe it’s fixed now :crossed_fingers:.
But yes I still have the issue.
PS is there a way I can donate for your time? I appreciate the help

Hi @ASMD ,

I am finding version 1.x very slow also I have a 8th generation Core i7 laptop with 32 GB of RAM! That is not good :rofl: I did find disabling Windows Defender made things much faster but it is still extremely slow compared to my regular development environment.

Anyway I am just installing version 2 as we speak, I’ll let you know how it goes!

Kind Regards,

Pete

1 Like

I think it might be time to look into more serious tools I’ve been avoiding for years now :rofl:.
Interestingly it doesn’t struggle as much with STM32 even the large fast chips. Maybe it’s an espressif thing

If you guys need I can set you up with a VM and I can allocate 24 cores (actual CPU cores not virtual ones) and upwards of 64GB of memory if you need. I have a Threadripper Pro running @ 4.0GHz. I am able to compile LVGL in 8 seconds. You can use a program called VirtualHere which is USB over IP and it works without any issue when flashing MCUs. The VM will think the MCU is plugged directly into my machine.

Let me know if that is of interest.

1 Like

You realy say about in Arduino 1.x compile?

Hello, I am new here. Looking for the 8048S043 module to use with LVGL and Visual Studio Code and the Espressif toolchain.
I experienced same behaviour using the display with arduino_gfx.
In my opinion its is a timing issue. The serial bus is accessed too fast for some reason. I don’t know the display controlling chip, nor any datasheet is available. I managed to make the display stay stable by lowering the clock frequency (called prefer_speed) form 16MHz down to 12MHz. I also changed the hsync_pulse_width an vsync_pulse_width from 4 to 8. Whatever that means.

In Arduino code this means this:
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 /, 7 / B2 /, 9 / B3 /, 1 / B4 /,
0 /
hsync_polarity /, 8 / hsync_front_porch /, 8 / was 4 hsync_pulse_width /, 8 / hsync_back_porch /,
0 /
vsync_polarity /, 8 / vsync_front_porch /, 8 / was 4 vsync_pulse_width /, 8 / vsync_back_porch /,
1 /
pclk_active_neg /, 12000000 / prefer_speed /, false / big endian */);
Arduino_RGB_Display gfx = new Arduino_RGB_Display(
DISPLAY_WIDHT /
width /, DISPLAY_HEIGHT / height */, rgbpanel);

Another typical Arduino thing. It works with version “GFX Library for Arduino 1.3.5” and not with later versions.

Hi @ASMD ,

I have been looking into this and it is an entertaining challenge to get debugging of Arduino code working! I have currently managed to get the debugger to work with ESP-IDF but have failed dismally to get the debugger to work with Arduino 1.8 or 2.1 or VSCode for Arduino plugin…

That aside I have also tried @Ernst 's configuration above and this also glitches with your code snippet so unfortunately I don’t believe it is a clock speed issue.

I speculate we are either looking at some kind of underlying driver problem with( display or WiFi - could be either) or there is some kind of hardware issue with the display.

To date I have not been able to find anything which confirms what the display driver chip is for this board when it is configured with the 800x480 display… Have you managed to find this out? This would certainly take some of the mystery out of the situation. :smiley:

I am not sure where you want to go with your project

going forward, personally I am not particularly keen to waist more time trying to debug in Arduino as it is not working easily and seems fraught with issues. I am however willing to attempt to create a port of your project for ESP-IDF running in Eclipse as I am very familiar with the Eclipse development environment and have written, debugged and released many projects from this environment over the past 2 decades… :smiling_face:

If you would like me to go ahead and attempt to create an ESP-IDF eclipse project and would take it and use it I would be happy to have ago, but it might take me a few weeks to fit around my day job! We could also then donate the base project back to the LVGL community.

Let me know what you think?

Kind Regards,

Pete

Hi @ASMD ,

I believe the issue is related to this I am currently experimenting with the content mentioned.

The problem actually occurs when esp_wifi_set_config() is called, which I believe is attempting to update the flash causing the glitch. (Unfortunately the source code for the ESP wifi library hasn’t been published so it can’t be hacked…

Kind Regards,

Pete

Hi @ASMD ,

I have managed to make a version of your project which works without glitching using ESP-IDF on Windows 10

My conclusion is the WiFi Setup is accessing the on-chip flash memory causing the DMA to stall when updating the LCD… See this ESP32 forum post which goes through it all and ends up with the creation of the ‘bounce buffer’ in the LCD RGB panel API. Unfortunately as far as I can see this has not been implemented for Arduino so I think you will need to move away from that platform if you want to fix the problem.

If you would like me to share the project with you please contact me on petebone00@gmail.com as I would prefer not to post your code publicly on the Forum.

Kind Regards,

Pete

Hi @pete-pjb thank you for your work.
Apologies for the lack of responses, the day job has been more demanding than usual lately!
I’ll ping you an email regarding the code. It would be great if it could help the community.
Excuse me for my ignorance (maybe slightly off topic), is ESP-IDF using Eclipse equivalent to using the Arduino plugin for Eclipse, or is the whole point to avoid existing arduino libraries and re-write the functionality at a lower level without using the Arduino plugin?
After spending a long time trying to create functional projects in the ST ecosystem (cube-ide, TouchGFX) I went back to Arduino because I was burning 90% of my time battling with C++ and not actually making anything functional. So I’d like to avoid the same thing with Lvgl&esp32 with Eclipse. It’s like trading one time-drain for another if I now need to re-do a lot of the common stuff made for the Arduino tool chain :rofl:.

Hi @ASMD ,

No worries… :slight_smile:

The ESP-IDF plugin for Eclipse enables the use of C or C++ personally being quite old I am not a fan of C++ so all my stuff is C code. Certainly the Arduino libraries even the Espressif provided code appear to be different and probably running a long way behind the API provided by ESP-IDF. My recommendation would be to bite the bullet and work with C or C++ it gives you much more flexibility, visibility and control over your own destiny, the compile times are considerably better also… :laughing:
It took me about 60 minutes to integrate your Arduino Sketch into ESP-IDF and ‘convert’ it to C code. It shouldn’t be to much of a problem I expect. :slight_smile: for you to convert your sketches… I also feel your pain if you have worked with ST’s Cube-IDE, I once started a project with it and ended up starting again using the STM32 Workbench FreeRTOS +TCP with EmWin and avoiding as much ST generated code as possible!

Do you want me to post your converted WiFi project on here?

If not I will look out for your email.

Kind Regards,

Pete

Hello Pete,

Thank you for the response.

I had a short holiday. Also writing software at home is kind of a low priority hobby.
The biggest problem for me to find the display-issue is the lack of datasheets and display chip information. without that is will always be trial and error. I have plenty of tooling available like a multichannel scopes or emi sniffing probes and spectrum analyzers. But what would be the right thing to do without any specs? At work we professionally develop pcb-boads with also displays but without data, no support from colleagues is to be expected. The unit is cheap, yes, but the quality is too low to put much effort in it.

Hardware development I like, but I am not strong in software. I envy your ability to setup IDE, toolchain and a debugging. I am lucky my son studied embedded software and hardware interfacing. He could setup for me VSCode en de Espressif toolchain. LVGL works with a small LCD display and ESP32-S3.

My aim is to use LVGL on the 800x480 color display but I have no clue how to match LVGL with this 16 bit parallel interface. Were can I find the lowest level interface a ‘how to approach’ lesson?

If I get it to work I could, and would like to, focus on the glitching. Sure the issue can be found.

Regards, Ernst

Hi @Ernst ,

Thanks for your comments, like you I too was unable to find any data about the display… but the values being used by the manufacturers example are likely to be correct one would hope!
The issue I believe is already found, it’s described here along with Espressif’s ‘workaround’ in the link from my previous post above:

I also personally believe the ESP32S3 is somewhat at it’s limits driving an 800x480 display if one wants to use scrolling and animation etc. It may be okay for static displays of buttons and boxes etc. but personally I wouldn’t attempt to use it for complex animated/scrolling GUI’s. :slight_smile:

I will try and post a VSCode and a ESP-IDE (Eclipse) example soon… I just need a bit of time to fit it around my day job. :smiling_face:

Kind Regards,

Pete

1 Like

Hi @pete-pjb ,

Got the module to work with some found github samples with Arduino IDE.

I read in the link the max pixelrate is about 14MHz. It would make sense to lower the prefer speed frequency from 16MHz to, what I found to be working ok, the 12MHz.

With my display samples (I have 3pcs) the code here: A button demo needed two changes: The backlight pin and the frequency adjustment.

Still not perfect, the first appearance has misformed CPU usage information label. (Not clear to me why those are present. Looks like some default LVGL setting.). Also the touch screen works about every other reset cycle. Never experienced that before with my own GUI objects. Some initialization issue still to discover.

Now I will try this code in VSCode.

1 Like

Hi @Ernst ,

I have posted a project for eclipse here.

I will look into vscode tomorrow.

Kind Regards,

Pete

Thank you,… a lot @!

1 Like

Hi @Ernst ,

As promised a VSCode project is attached.

I would suggest creating a project using ESP-IDF: Show Example Projects and using the rgb_panel example in peripherals->lcd then overwrite the project directory with the contents of the attached zip file and then build and flash the project. Hopefully it should work with 8048S043 board.

rgb_panel.zip (45.1 KB)

I hope it works for you.

Kind Regards,

Pete

2 Likes