Advance display flickers/corrupted on refresh

Hello, I've been using your esp32-s3 7" display for a while without problem.
I've just upgraded to to new advance version but am hitting problems.
Specifically the screen is messed up every time it refreshes (but then settles to the correct display view).
If I re-flash your factory test binaries, they work without problem, but building your factory test code (once I've fixed the compilation errors due to missing forward function declarations) doesn't work, and has the same refresh problem.
After a lot of trial and error I've managed to find a working configuration, largely by reverting a lot of the code to match what the older (non advance) screen does.

1) Revert the buffers used to be DRAM, not PSRAM as below

    // THIS DOES NOT WORK
    // size_t buffer_size = sizeof(lv_color_t) * LCD_H_RES * LCD_V_RES;
    // buf = (lv_color_t *)heap_caps_malloc(buffer_size, MALLOC_CAP_SPIRAM);
    // buf1 = (lv_color_t *)heap_caps_malloc(buffer_size, MALLOC_CAP_SPIRAM);
    // lv_disp_draw_buf_init(&draw_buf, buf, buf1, LCD_H_RES * LCD_V_RES);

    //THIS DOES
    static lv_color_t disp_draw_buf[800 * 480 / 10];
    lv_disp_draw_buf_init(&draw_buf, disp_draw_buf, NULL, LCD_H_RES * LCD_V_RES / 10);

2) Reduce the write frequency

cfg.freq_write = 15500000; //21000000 doen't work

I use platformIO (3.3.4)

I've used the board/build settings (updating to the correct memory sizes) as below.

board = ESP32-S3-WROOM-1-N16R8 
board_build.arduino.memory_type = qio_opi
board_build.flash_mode = qio
board_build.psram_type = opi
board_upload.flash_size = 16MB
board_upload.maximum_size = 16777216
board_build.partitions = default_16MB.csv
build_flags = 
    -DBOARD_HAS_PSRAM    
    -mfix-esp32-psram-cache-issue
    -DCONFIG_SPIRAM_SUPPORT=1
    -DCONFIG_SPIRAM_TYPE=1
    -DPSRAM_SIZE=8
    -DPSRAM_CLK=120000000    

I've tried various combinations of the above, with and without optimization, no luck.

Please can you provide a definitive config in terms of the board/build config that actually works.
In addition, please review the buffer code in 1) above and confirm this is correct for PSRAM (sizes are very different due to the /10 between the versions).

Obviously your binaries work, so something is missing regarding how to regenerate them.

thanks!

Comments

  • Dear phil_seggl,
    I hope this message finds you well. Thank you for reaching out .

    Our technical support team is currently looking into the issue in your message. Please be patient, and we will get back to you as soon as possible.

    Thanks! Have a nice day!

  • Dear phil_seggl,
    I hope this message finds you well.

    1 Are you using the basic esp32-s3 7" display (https://www.elecrow.com/esp32-display-7-inch-hmi-display-rgb-tft-lcd-touch-screen-support-lvgl.html) or the advance esp32-s3 7" display (https://www.elecrow.com/crowpanel-advance-7-0-hmi-esp32-ai-display-800x480-artificial-intelligent-ips-touch-screen-support-meshtastic-and-arduino-lvgl-micropython.html)?

    2 What did you mean by ” upgrade“ in your sentence ("I've just upgraded to to new advance version but am hitting problems.")? Does it mean that you bought a new Advance ESP32-S3 7" display product?

    3 Did you modify the program that was previously suitable for Basic ESP32-S3 7" display and use it on the Advance ESP32-S3 7" display product?

    Best regards,

  • Hi, please see answers below.
    1) I am now using the advance display, previous versions of my project used the basic one.
    2) Yes, I'm changing the display from basic to advance
    3) Yes I did using your example code. However when that didn't work I tried your examples on github, which also don't work (except your binaries which do).

    Some more updates

    The PSRAM frequency should be 80MHz, 120MHz is experimental, and doesn't work for me.
    Also the cache fix flag doesn't apply to the S3, so I removed from the build config.
    Updated build flags are now:
    -DBOARD_HAS_PSRAM
    -DPSRAM_SIZE=8
    -DPSRAM_CLK=80000000

    This change enables me to use PSRAM (sort of). I have 3 advance screens, flashing all 3 with the same binaries gives slightly different results. One display seems pretty solid, almost no issues with flicker/updates. The second has a minor flicker when refreshing, but
    much better than before. The third is similar but has some white interference on the left of the screen all the time. Clearly the settings are still somewhat on the edge of tolerance so I get varying results.

    FWIW the buffer setup is now

        size_t buffer_size = sizeof(lv_color_t) * LCD_H_RES * LCD_V_RES;
        buf = (lv_color_t *)heap_caps_malloc(buffer_size, MALLOC_CAP_SPIRAM);
        buf1 = (lv_color_t *)heap_caps_malloc(buffer_size, MALLOC_CAP_SPIRAM);
        lv_disp_draw_buf_init(&draw_buf, buf, buf1, LCD_H_RES * LCD_V_RES);
    

    But I still have the LGFX write frequency set to a lower value, and it seems changing up or down from there just makes it worse
    cfg.freq_write = 15500000

    I will experiment a bit more when I have time, however it's worth noting that the only reliably solid config is the one from my original post, not using PSRAM with a lower write frequency.

  • Dear phil_seggl,
    I hope this message finds you well. Thank you for the update.

    Our technical support team is currently looking into the issue in your message. Please be patient, and we will get back to you as soon as possible.

    Thanks! Have a nice day!

  • Dear phil_seggl,
    Sorry for the late reply
    1. What hardware version do you use? Please take a picture of the back of the device and show it to us. The hardware version is Vx.x on the back of the device, such as V1.0. Then please use our corresponding code according to the hardware version number. Our code is as follows:
    https://drive.google.com/drive/folders/1Qw7hdW862upBigarI11btgl4cQkr0vpe?usp=sharing

    1. Generally, we do not recommend modifying the code of basic products to use with advance products. It is recommended that you directly use the code of the advance product we provide to modify and implement the functions you want to achieve.

    2. Please refer to our corresponding tutorial:
      https://www.elecrow.com/pub/wiki/ESP32_Display-7.0_inch(Advance_Series)wiki.html#platforms-supported

    Best regards

  • Hello Jennie,

    Sorry for the delay, I’ve been busy with other project recently and only now have some time to come back to this. Another reason for the delay was that I do not use, or want to use Squareline Studio, however in order to remove any doubt I did install and (tried to) follow your tutorial. All of this was done on v1.2 screens (I now have 5 of them).

    TLDR: I seem to have found the problem/a solution but I don't think this is covered in your tutorial, and honestly I'm not sure what it is that was fixed. The problem is the version of the platform and/or framework in the project. I was on version 2.x, and upgrading to 3.x fixes the problem (or at least a fork of it, see below).

    I do need to point out though that there are a lot of problems/omissions in your tutorial which you need to fix. Also I stumbled on the solution by looking at the zipped platformio project which was found where the example PNG files should have been.

    Please look at fixing your tutorial using the details below:

    1) In the tutorial under the text “Choose the correct resolution based on the different sizes you are using” there is a picture of the different screen resolutions and information on associated screen and touchscreen drivers. However no information is given on the required color depth. The images above this show 32-bit the image below 16-bit – which is correct? (I chose 16-bit as it was the last one shown).
    2) The link for files to download is https://drive.google.com/drive/folders/1Qw7hdW862upBigarI11btgl4cQkr0vpe?usp=sharing, this contains a folder for v1.2, and in there I find a zip file for the 7” screen (7.0_PlatfromIO.zip). The zip is for a platform IO project and does not contain the PNG images you refer to, so instead I chose a simple PNG file of my own.
    3) Then in section 6 of the tutorial you specify the libraries to include, with some version information, this went without problem but then you have “Place the lv_conf.h we provide to the path: .pio\libdeps\esp32-s3-devkitc-1-myboard in the project folder.” – where to you provide this? This is the first time it’s mentioned in the tutorial. On searching in the zip file 7.0_PlatfromIO.zip I find the file, and assume it’s correct, but this is very unclear.
    4) I then followed your information in section 6.3 to update the platformio.ini file and move to section 6.4. Copying the generated files from Squareline Studio export is fine, but then you have “Similarly, add the display driver and pin definition header files to the include folder” – again from where? On searching 7.0_PlatfromIO.zip again I find 2 of the 3 required files (pins_config.h and LovyanGFX_Driver.h), however touch.h is missing. I check the screen resolution in the 2 files I have and then move on to the next step.
    5) Now section 6.5 is a problem. You provide 2 partial screenshots of main.cpp which only details the difference between version 1.0 and 1.2, there is no link or full description of what main.cpp should contain at all. So again I look in 7.0_PlatformIO.zip and copy the main.cpp file from there.
    6) There are however problems with that main.cpp file, it does not compile due to some basic errors:
    a. It includes files from libraries you did not specify were needed (Adafruit_GFX.h and TCA9534.h)
    b. You instantiate an instance of TCA9534 as ioex which is not needed at all for a version 1.2 screen.
    c. Lines 157 through 168 then use the ioex instance (this is not needed as it’s in an else clause that will never be used).
    d. At the start of the setup function you call esp_psram_extram_set_clock_rate, this fails due to a missing library dependency, it is guarded by an #ifdef and your tutorial specifically includes that define (CONFIG_SPIRAM_SUPPORT).
    I comment out the ioex code and the unused includes. Also I comment out the call to esp_psram_extram_set_clock_rate, which I do not think is needed due to the defines in the platformio.ini file.
    7) Having done all the above I can build and flash the project to the screen. Once again the screen glitches horribly when I push a button, there is also some noise on the display even when I’m not interacting with it – i.e. this is precisely the problem I raised back at the very beginning of this process.
    8) Having done all of the above I then looked at the platformio.ini file in the 7.0_PlatfromIO.zip and noticed that you are using a fork of the espressif platform, specifically you have platform = https://github.com/Jason2866/platform-espressif32.git#Arduino/IDF53 and you do not define CONFIG_SPIRAM_SUPPORT, I applied those changes and then the project updated the platform/framework versions to be 2025.07.30 & 3.3.0+sha.bd9acbdf respectively. Now everything works!

    So in summary, your tutorial is missing important information, is inconsistent with the files you in the link you include and even the zip file project either needs more libraries, or modification to build.

    Please do 2 things:
    1) fix / update the tutorial and the associated files
    2) confirm whether the fork of the espressif32 platform is actually necessary (or if the current 3.x version from the main repository is OK), and if it is necessary, why.

    I appreciate there's a lot of information here, but it also has wasted a lot of my time, so hopefully by fixing it others won't have the same trouble.

    thanks and best regards

    Phil.

  • Dear phil_seggl,
    Sorry for the late reply.
    Thank you very much for your valuable suggestions . I will transfer them to related department to deal with .
    Also Thank you for your effort into this . We are so glad that the issue was solved .
    Best regards,

Sign In or Register to comment.