-
Notifications
You must be signed in to change notification settings - Fork 7.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
esp-lcd driver for st7789 - static on cold boot, or last displayed screen on reboot (IDFGH-6896) #8516
Comments
Hi @tvanfossen I think you can flush any pattern before **Turn on the backlight", e.g. here |
This makes the assumption that I have IO for backlight control, which I do not on this LCD board. Backlight in this case turns on as soon as power is received. Yes in a perfect world, I'd flush the screen before turning on the backlight, but this is a bandaid over the actual issue. Speaking to benefit instead of problem, the st7789 initialization is the earliest possible time at which something can be written to the screen, an ideal spot for a bitmap to be shown during bootup to get something up in < 250ms |
Hi @tvanfossen If that's the case, you can even skip calling // allocate bus handle
ESP_ERROR_CHECK(spi_bus_initialize(LCD_HOST, &buscfg, SPI_DMA_CH_AUTO));
// create LCD IO handle (SPI)
ESP_ERROR_CHECK(esp_lcd_new_panel_io_spi((esp_lcd_spi_bus_handle_t)LCD_HOST, &io_config, &io_handle));
// st7789 panel handle
ESP_ERROR_CHECK(esp_lcd_new_panel_st7789(io_handle, &panel_config, &panel_handle));
ESP_ERROR_CHECK(esp_lcd_panel_reset(panel_handle));
// don't call `esp_lcd_panel_init()`, instead, we send LCD commands in another order
esp_lcd_panel_io_tx_param(io_handle, LCD_CMD_SLPOUT, NULL, 0);
vTaskDelay(pdMS_TO_TICKS(100));
// flush color before turn on the display
for (int i = 0; i < 320; i++)
{
esp_lcd_panel_io_tx_color(io_handle, LCD_CMD_RAMWRC, init_buf, INIT_DISP_BUF_SIZE);
}
// turn on display
esp_lcd_panel_io_tx_param(io_handle, LCD_CMD_DISPON, NULL, 0); |
Environment
Development Kit: esp32s3 w/ quad spi and 2mb psram (comparable to esp-box)
Kit version (for WroverKit/PicoKit/DevKitC): [v1|v2|v3|v4]
Module or chip used: ESP32S3-WROOM1
IDF version v4.4-330-g871a585c79
Build System: idf.py
Compiler version xtensa-esp32-elf-gcc (crosstool-NG crosstool-ng-1.22.0-80-g6c4433a) 5.2.0
Operating System: Linux
Using an IDE?: VSCode
Power Supply: USB
Running with LVGL, using lv_port code from esp-box for initialization
Problem Description
esp-lcd panel for st7789 creates static on screen during cold boot. On a reboot (such as ctrl+t+r in idf.py monitor), the st7789 buffer will display the last screen before reboot.
I'd like to make this optional, and enable a user to overwrite this buffer before the DISPON command has been sent to the st7789
I've added the following kconfig option for the esp_lcd component
When LCD_INIT_TO_COLOR is set to 1, the st7789 initialization runs an additional call in order to populate the display buffer before it turns on like below:
This is not a perfect solution by any means, a better implementation might allow for the user to select a specific color to set, variation by screen size, maybe even write a bitmap into the buffer, all before DISPON command is sent. This fix does stop the static on the screen I am seeing
The text was updated successfully, but these errors were encountered: