Open dannybackx opened 2 months ago
Hi @dannybackx,
I have looked to your code fast and it seems, there is problem in function lvgl_port_add_disp
. You are using RGB LCD display and you should use function lvgl_port_add_disp_rgb
like here: https://github.com/espressif/esp-bsp/blob/5d33575499110ccf0f9ff1eb58e4b17cf9b4da2b/bsp/esp32_s3_lcd_ev_board/src/esp32_s3_lcd_ev_board.c#L383C12-L383C34
Thanks for pointing to that. It doesn't change the result I'm currently getting : the backlight is the only visible thing, the display doesn't work. Touch does work.
I suspect the SPI code to configure the display isn't working.
The BSP does things like this :
void qmsd_rgb_spi_init() {
spi_bus_config_t buscfg = {
.sclk_io_num = LCD_SPI_CLK,
.mosi_io_num = LCD_SPI_DATA0,
.miso_io_num = -1,
.quadwp_io_num = -1,
.quadhd_io_num = -1,
.max_transfer_sz = 10 * 1024,
};
ESP_ERROR_CHECK(spi_bus_initialize(SPI2_HOST, &buscfg, SPI_DMA_CH_AUTO));
spi_device_interface_config_t devcfg = {
.clock_speed_hz = SPI_MASTER_FREQ_10M, //Clock out at 10 MHz
.mode = 0, //SPI mode 0
.spics_io_num = LCD_SPI_CS, //CS pin
.queue_size = 7, //We want to be able to queue 7 transactions at a time
};
ESP_ERROR_CHECK(spi_bus_add_device(SPI2_HOST, &devcfg, &g_screen_spi));
rgb_driver_init();
while my code starts like this :
/*
* See https://docs.espressif.com/projects/esp-iot-solution/en/latest/display/lcd/rgb_lcd.html
* This says use 3-wire via io_additions .
* On the https://components.espressif.com/components/espressif/esp_lcd_panel_io_additions page
* there's an init example. But a more complete one is on
* https://components.espressif.com/components/espressif/esp_lcd_gc9503/versions/3.0.1
*
* Additional sample https://github.com/espressif/esp-bsp/blob/master/components/lcd/esp_lcd_gc9503/README.md
*/
ESP_LOGI(tag, "Install 3-wire SPI panel IO");
spi_line_config_t line_config = {
.cs_io_type = IO_TYPE_GPIO, // Set to `IO_TYPE_EXPANDER` if using IO expander
.cs_gpio_num = LCD_SPI_CS,
.scl_io_type = IO_TYPE_GPIO,
.scl_gpio_num = LCD_SPI_CLK,
.sda_io_type = IO_TYPE_GPIO,
.sda_gpio_num = LCD_SPI_DATA0,
.io_expander = NULL, // Set to device handle if using IO expander
};
ideas ?
This is getting really frustrating.
The BSP from the board vendor is based on old esp-idf versions and they claim you guys move too fast. But it used esp-idf's components/esp_driver_spi/src/gpspi/spi_master.c .
The esp-bsp stuff for gc9503 doesn't seem to work, and it uses own SPI functions in managed_components/espressif__esp_lcd_panel_io_additions/esp_lcd_panel_io_3wire_spi.c .
I'm not sure what to do here. Except maybe give up on esp-idf's managed components.
Hi @dannybackx , Unfortunately I could not find schematic of your board, without this information it is very difficult to check that everything is setup correctly. The GC9503 uses RGB interface for color data. This interface is usually a lot more difficult to configure compared to SPI. From my experience with similar displays, most of the issues come from incorrect RGB interface configuration and timing. Each display requires different timings, you can find this information in the display's datasheet and the configure the driver accordingly here https://github.com/espressif/esp-idf/blob/master/components/esp_lcd/rgb/include/esp_lcd_panel_rgb.h#L128
If this doesn't help, you can check your schematic whether you need to do HW reset of the display and whether SPI is sending the data as you intend
Hi @dannybackx, Since the link is inaccessible, I can't view your code. However, after reviewing the product manual, I found that LCD_SCLK and LCD_MOSI share the same GPIOs as RGB_D0 and RGB_D1 on the LCD.
Therefore, please ensure that when using gc9503_vendor_config_t
, you set .flags.auto_del_panel_io = 1 && .flags.mirror_by_cmd = 0
.
gc9503_vendor_config_t vendor_config = {
.rgb_config = &rgb_config,
// .init_cmds = lcd_init_cmds, // Uncomment these line if use custom initialization commands
// .init_cmds_size = sizeof(lcd_init_cmds) / sizeof(gc9503_lcd_init_cmd_t),
.flags = {
.mirror_by_cmd = 0, // Only work when `auto_del_panel_io` is set to 0
.auto_del_panel_io = 1, /**
* Set to 1 if panel IO is no longer needed after LCD initialization.
* If the panel IO pins are sharing other pins of the RGB interface to save GPIOs,
* Please set it to 1 to release the pins.
*/
},
};
Responding to the "inaccessible" remark, do you refer to the subversion url in my message ? If yes, I don't understand. I just checked if I could use https://sourceforge.net/p/esp32-s3-86-box-project-base/code/HEAD/tree/trunk/touchscreen/main/gc9503.c with an anonymous browser session, and with curl. Both worked.
Answers checklist.
General issue report
I am using all the example / advice on https://components.espressif.com/components/espressif/esp_lcd_gc9503/versions/3.0.1?language=en but my display stays blank.
The hardware (ZX3D95CD01S board available from multiple sources on AliExpress) works just fine if you compile stuff with the board support package. However, that is based on old esp-idf versions and this bothers me for other (dependency) reasons.
Board reference https://www.aliexpress.com/item/1005005886057393.html?spm=a2g0o.order_list.order_list_main.23.3afe1802V0TN7o
So I'm trying to get the board to display something with the generic components, and have tried a lot of different scenarios already. The latest and cleanest is a merge between the included sample in the esp_lvgl_port component and the sample code on the esp_lcd_gc9503 page , so replacing the st7789 dependency with gc9503 code.
See https://sourceforge.net/p/esp32-s3-86-box-project-base/code/HEAD/tree/trunk/touchscreen
This should cleanly build with a variety of recent esp-idf distributions, currently using yesterday's 5.3-rc1.
Dependency list is just stuff from the components repo.
The screen lights up a little bit (the backlight is active, I mean) but other than that remains dark. How can I debug further ?