ESP32S3 RGB565 LCD Screen Flicker
Posted: Tue Jul 08, 2025 12:39 am
Hi,
We've been having this issue with the ESP32S3 driving a RGB56 IPS LCD where what i can only describe as the screen flicker. Such that the brightness seems to go up and down very quickly. What's odd about it is it only happens sometimes, and its severity (the amount of flicker) can be barely noticeable to extremely noticeable. Sometimes it can also transition from extremely noticeable to not noticeable sometimes in as few as 20 minutes. Also it may not be the whole screen that flickers, it could be a single element such as a button.
It's been very difficult trying to record it but in the attached video you an see as i would describe it as flickering in the top corners of the file "flicker" where "noflicker" it isn't flickering yet exact same code just rebooted. However in person the whole screen is doing that effect. The screen test in this was an all white screen (due to only driving one IO it appears as green). I've also attached a video "flicker_colurful" that shows it flicker when its not white, excuse the screen tearing thats something we're working on.
We're using a 480x854 IPS LCD with the ST7701S chip.
The ESP32S3-N16R8 WROOM 1 module on a custom PCB.
The backlight is using a constant current step up driver running at ~1.5MHz
We will also need to use LVGL partial mode due to the need for software rotation.
What we've tried with no noticeable effect
* slimming code down to bare essentials
* change backlight from PWM to constant on
* powering backlight externally
* changed task priority
* changed bounce buffer size
* single buffer/double buffer/triple buffer
* no bounce buffer (unable to keep up with PCLK > ~20MHz)
* lvgl direct mode/partial/full
* increased LVGL version from 9.2 to 9.3
* increased espidf from 5.4 to 6.0
* increase/decrease lvgl port timer period
* increase/decrease lvgl port max sleep
* removing touch
* changed RTOS to use a single core (FREERTOS_UNICORE=y)
* changing CPU frequency
Things that have effected it
* increasing PCLK
So it made it seem that PCLK would fix it, however this isn't always the case as it does occasionally occur, less often and less severe but still occurs. All these tests were performed without flash encryption. As this will be a production board we do require flash encryption to be enabled, which further limits the maximum PCLK to ~25MHz before tearing is observed.
We also tried a special mode in the ST7701S that allows it to work in a partial mode, essentially working as a smaller screen. The thinking was that if it was a framerate issue we could maintain the PCLK value but the screen size could be halved then it will be updated twice as often. It did get a frame rate of roughly 2x what it was before (slightly lower due to porch values) however it didn't effect the flicker at all.
We also tried using only one of the parallel colours at a time by setting them to GPIO_NUM_NC in esp_lcd_rgb_panel_config_t and driving them low, to determine if it was a particular colour issue. However red green and blue all had the same issue, not as sever in lower colours, maybe due to them being inertly less bright so harder to perceive the brightness change.
What's also odd is if we have it running on FREERTOS_UNICORE and after all the screens are setup and running, then a task which just contains a while loop is run then the same behavior occurs, such it flickers sometimes and other times not, leading us to believe its not a task issue.
Main SDKConfig changes
PSRAM 120MHz
FLASH 120MHz
CPU 240MHz
CONFIG_SPIRAM_MODE_OCT
SPIRAM_XIP_FROM_PSRAM
SPIRAM_RODATA
CONFIG_SPIRAM_FETCH_INSTRUCTIONS
We've been having this issue with the ESP32S3 driving a RGB56 IPS LCD where what i can only describe as the screen flicker. Such that the brightness seems to go up and down very quickly. What's odd about it is it only happens sometimes, and its severity (the amount of flicker) can be barely noticeable to extremely noticeable. Sometimes it can also transition from extremely noticeable to not noticeable sometimes in as few as 20 minutes. Also it may not be the whole screen that flickers, it could be a single element such as a button.
It's been very difficult trying to record it but in the attached video you an see as i would describe it as flickering in the top corners of the file "flicker" where "noflicker" it isn't flickering yet exact same code just rebooted. However in person the whole screen is doing that effect. The screen test in this was an all white screen (due to only driving one IO it appears as green). I've also attached a video "flicker_colurful" that shows it flicker when its not white, excuse the screen tearing thats something we're working on.
We're using a 480x854 IPS LCD with the ST7701S chip.
The ESP32S3-N16R8 WROOM 1 module on a custom PCB.
The backlight is using a constant current step up driver running at ~1.5MHz
We will also need to use LVGL partial mode due to the need for software rotation.
What we've tried with no noticeable effect
* slimming code down to bare essentials
* change backlight from PWM to constant on
* powering backlight externally
* changed task priority
* changed bounce buffer size
* single buffer/double buffer/triple buffer
* no bounce buffer (unable to keep up with PCLK > ~20MHz)
* lvgl direct mode/partial/full
* increased LVGL version from 9.2 to 9.3
* increased espidf from 5.4 to 6.0
* increase/decrease lvgl port timer period
* increase/decrease lvgl port max sleep
* removing touch
* changed RTOS to use a single core (FREERTOS_UNICORE=y)
* changing CPU frequency
Things that have effected it
* increasing PCLK
So it made it seem that PCLK would fix it, however this isn't always the case as it does occasionally occur, less often and less severe but still occurs. All these tests were performed without flash encryption. As this will be a production board we do require flash encryption to be enabled, which further limits the maximum PCLK to ~25MHz before tearing is observed.
We also tried a special mode in the ST7701S that allows it to work in a partial mode, essentially working as a smaller screen. The thinking was that if it was a framerate issue we could maintain the PCLK value but the screen size could be halved then it will be updated twice as often. It did get a frame rate of roughly 2x what it was before (slightly lower due to porch values) however it didn't effect the flicker at all.
We also tried using only one of the parallel colours at a time by setting them to GPIO_NUM_NC in esp_lcd_rgb_panel_config_t and driving them low, to determine if it was a particular colour issue. However red green and blue all had the same issue, not as sever in lower colours, maybe due to them being inertly less bright so harder to perceive the brightness change.
What's also odd is if we have it running on FREERTOS_UNICORE and after all the screens are setup and running, then a task which just contains a while loop is run then the same behavior occurs, such it flickers sometimes and other times not, leading us to believe its not a task issue.
Main SDKConfig changes
PSRAM 120MHz
FLASH 120MHz
CPU 240MHz
CONFIG_SPIRAM_MODE_OCT
SPIRAM_XIP_FROM_PSRAM
SPIRAM_RODATA
CONFIG_SPIRAM_FETCH_INSTRUCTIONS