Closed zyan003 closed 3 months ago
E (30) lcd_panel.io.i2c: panel_io_i2c_rx_buffer(135): i2c transaction failed E (30) GT911: touch_gt911_read_cfg(362): GT911 read error! E (31) GT911: esp_lcd_touch_new_i2c_gt911(128): GT911 init failed E (37) GT911: Error (0xffffffff)! Touch controller GT911 initialization failed!
This is about the Touch Screen. It seems like the I2C pins are not being set correctly.
define ESP_PANEL_USE_BACKLIGHT (0) // 0/1
Is it correct? The display may fail 9 of 10 times, after first boot, because there is no Back Light on in order to see the display....
@SuGlider, thanks for the quick response. I will check #define ESP_PANEL_USE_BACKLIGHT
to see if that is the issue.
When I received the board, I used esptool to backup the factory firmware with the LVGL demo. With that "factory" firmware, I can upload the customized LVGL project via Arduino and the LCD display works flawlessly with customized LVGL content. Then if I unplug the USB and reconnect the board to either PC or external power source, the display shows nothing and those error messages pop up. I think I see some backlight from the display.
If I understand it correctly, the original firmware that came installed in the display works fine.
But when you upload the Arduino Sketch presented in this issue, it doesn't work, with a back display and error messages.
If this is correct, the problem is in the Arduino Sketch code.
No. If I restore the original firmware to the board and then upload my Arduino sketch, the display works fine. However, if I unplug the USB and reconnect it, the board stops working.
I understand this issue might seem unusual, and I apologize if it's difficult to explain.
There is a documentatio and instructions in https://www.waveshare.com/wiki/ESP32-S3-Touch-LCD-7
It says that Flash is QIO 120MHz to align with the PSRAM. Your setup says QIO 80MHz.
Check the Notes with the IDF configuration. Maybe Arduino can't be used as written there: CONFIG_IDF_EXPERIMENTAL_FEATURES=y and CONFIG_SPIRAM_SPEED_120M=y [should align with PSRAM]
CONFIG_FREERTOS_HZ=1000
CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y
CONFIG_ESPTOOLPY_FLASHMODE_QIO=y
CONFIG_ESPTOOLPY_FLASHFREQ_120M=y [should align with PSRAM]
CONFIG_SPIRAM_MODE_OCT=y
CONFIG_IDF_EXPERIMENTAL_FEATURES=y and CONFIG_SPIRAM_SPEED_120M=y [should align with PSRAM]
CONFIG_SPIRAM_FETCH_INSTRUCTIONS=y
CONFIG_SPIRAM_RODATA=y
CONFIG_ESP32S3_DATA_CACHE_LINE_64B=y
CONFIG_COMPILER_OPTIMIZATION_PERF=y
#The following LVGL configuration can improve the frame rate (LVGL v8.3):
#define LV_MEM_CUSTOM 1 or CONFIG_LV_MEM_CUSTOM=y
#define LV_MEMCPY_MEMSET_STD 1 or CONFIG_LV_MEMCPY_MEMSET_STD=y
#define LV_ATTRIBUTE_FAST_MEM IRAM_ATTR or CONFIG_LV_ATTRIBUTE_FAST_MEM=y
@zyan003 - I think that, in order to use Arduino, you will have to build using Arduino as IDF Component, instead of using the Arduino IDE with specific/fixed IDF setup.
Doubt the settings are the reason for the issue. This settings "just" enhances the display speed. Without the display will work too. There will be probably screen flicker appear. Overall the recommended settings make no sense at all. QIO running @120 Mhz is not needed since the config
CONFIG_SPIRAM_FETCH_INSTRUCTIONS=y
CONFIG_SPIRAM_RODATA=y
will move flash content into the fast OPI PSRAM and the "slow" QIO Flash will not accessed anymore! Edit: use the "speed" OPI settings in our Arduino fork and managed to avoid screen flicker with some Displays and Tasmota.
Now, with all parameters remain unchanged, if I hold the "RESET" button when powering up, then open serial monitor, then press "RESET" again, LCD starts showing content and the touch works fine as well. The program works now, but it is not yet a flawless solution.
The Device has an UART port too. Changing the setup to use this port will probably solve the strange behaviour.
What Arduino Core version is being used?
If you are using Arduino Core 3.0.x, please enable the Core Debug Level
to Verbose
and post here the serial monitor output.
You can also try building it with the Arduino Core 2.0.17, just in case.
I found out that the issue is caused by GT911 power up timing and delay. Now, after adding
ESP_IOExpander *expander = new ESP_IOExpander_CH422G((i2c_port_t)I2C_MASTER_NUM, ESP_IO_EXPANDER_I2C_CH422G_ADDRESS_000, I2C_MASTER_SCL_IO, I2C_MASTER_SDA_IO);
expander->init();
expander->begin();
expander->multiPinMode(TP_RST | LCD_BL | LCD_RST | SD_CS | USB_SEL, OUTPUT);
expander->multiDigitalWrite(TP_RST | LCD_BL | LCD_RST, HIGH);
delay(100);
expander->multiDigitalWrite(TP_RST | LCD_RST, LOW);
delay(100);
digitalWrite(GPIO_INPUT_IO_4, LOW);
delay(100);
expander->multiDigitalWrite(TP_RST | LCD_RST, HIGH);
delay(200);
in void main()
, the display works flawlessly.
Board
Wareshare ESP32-S3-Touch-LCD-7
Device Description
Wareshare ESP32-S3-Touch-LCD-7 with ESP32-S3-WROOM-1-N8R8 on board.
Hardware Configuration
Version
v3.0.0
IDE Name
Arduino IDE
Operating System
Windows 10
Flash frequency
80MHz
PSRAM enabled
yes
Upload speed
921600
Description
I bought a Wareshare ESP32-S3-Touch-LCD-7 board from Aliexpress for some LVGL projects and I believe this board is using ESP32-S3-WROOM-1-N8R8. The LCD works fine out of the box. I can run LVGL widget demo on the LCD. Then I uploaded an "LVGL porting" code from the "ESP32 Display Panel" library and changed the demo to music player which works fine as well.
However, I unplugged the USB cord and plugged the board again. The program did not run properly. The LCD display showed nothing. Here is my board configuration:
Sometimes, the program can start normally without error messages. But 9 out of 10 times will fail. I used to use TFT_eSPI and it is the first I got involved in ESP32_Display_Panel. Any advice on how I can resolve the issues? Many Thanks!
Sketch
Debug Message
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide