lvgl / lv_port_esp32

LVGL ported to ESP32 including various display and touchpad drivers
MIT License
1.03k stars 436 forks source link

White screen ST7789V #311

Open EtienneMdv opened 2 years ago

EtienneMdv commented 2 years ago

Hi all,

I am trying to configure LVGL for my ESP32 custom board with a ST7789V TFT LCD driver. Unfortunately, I haven't been very successful so far... The backlight seems to work as the only thing I get is a white screen. I checked the GPIOs for the SPI numerous times and they are correct.

I don't know where to start to troubleshoot my issue. Do you have any idea?

I appreciate your help.

EtienneMdv commented 2 years ago

By the way, I was successful using ESP32_TFT_library prior to trying using LVGL.

tvanfossen commented 2 years ago

If your backlight is turning on, then I'd recommend checking that the LVGL initialization is completing properly

EtienneMdv commented 2 years ago

Thank you @tvanfossen.

Is there an efficient way to check that? I have turned the logs to trace but I don't see anything alarming.

tvanfossen commented 2 years ago

menuconfig -> LVGL config -> feature config -> logging -> enable log module Set default log verbosity to Log Important Events Log with printf

Is your code entering the main app_main loop? Can you see logs in a main loop? Are you running lv_task_handler consistently? How much memory are you providing for lvgls memory buffer?

EtienneMdv commented 2 years ago

I set the log according to your guidance. My code is not entering the main app_main loop... (I am attempting to run the demo app). My code is actually stuck calling _lvgl_driverinit(). I am providing the default size for LVGLs memory buffer, 12800 bytes. The last log I get on my terminal is related to changing the display orientation to LANDSCAPE.

EtienneMdv commented 2 years ago

Oops, my bad. I do enter the app_main loop. All the objects are created and lv_task_handler is running consistently. However, I still do not have anything displayed.

tvanfossen commented 2 years ago

Highly recommend using the bug format provided when you create issues, very difficult to determine where your code is failing from the information you've provided so far. Screenshots, verification with the LVGL simulator, etc anything more informative to your actual issue.

Running the unmodified demo code and still encountering an issue implies that either the IO setup is incorrect or your hardware is not configured properly, at least from the information provided so far.

EtienneMdv commented 2 years ago

Sorry about that... I am using ESP-IDF v5 and a custom board with a ESP-WROOM-32D. I am also thinking about an error in my IO setup since I am running the unmodified code. I changed the SPI mode from 2 to 0 and now I have something displayed. It is not really working but it is a start. I attached a pic (note that the orientation is wrong). Bug1

tvanfossen commented 2 years ago

IDF v5 may not be supported with LVGL yet, I'd recommend rolling back to ~4.2 as recommended by the lv_port_esp32 readme

That said, probably not the issue here. It looks to me as if your color depth is set incorrectly for your display driver

stale[bot] commented 1 year ago

This issue or pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.