ESP32 IDF ST7789 Garbled Display output

Hello,

I am trying to build the Demo for the ST7789 as a place to start on a project but i am getting garbled output on the display.

i have many more example images but in the interest of not spamming and brevity.
from what i can tell its likely i have just messed up a setting or something like that but i cant for the life of me figure it out.

sdkconfig is too big to upload and is available at: lv_port_esp32 sdkconfig · GitHub

Any help would be appreciated as i have not found anything on google that helps much and im using directly the code example from https://github.com/lvgl/lv_port_esp32.git as the starting point for the project and the demo that is trying to render on the display.

if you need any more info i would be happy to provide if i have forgotten anything.

Thanks
Setkeh

Hi, have you ever tried set the lv_disp_drv_t.full_refresh to 1, It will force LVGL to always redraw the whole screen.

Hi @jensenhua

Thanks for the reply, i am having an issue with your suggestion i google some examples of lv_disp_drv_t.full_refresh and implemented it as follows.

    lv_disp_drv_t disp_drv;
    lv_disp_drv_init(&disp_drv);
    disp_drv.flush_cb = disp_driver_flush;
    disp_drv.full_refresh = 1;


    /* When using a monochrome display we need to register the callbacks:
     * - rounder_cb
     * - set_px_cb */
#ifdef CONFIG_LV_TFT_DISPLAY_MONOCHROME
    disp_drv.rounder_cb = disp_driver_rounder;
    disp_drv.set_px_cb = disp_driver_set_px;
#endif

    disp_drv.buffer = &disp_buf;
    lv_disp_drv_register(&disp_drv);

but when i try to compile it i am getting

➜ idf.py build
Executing action: all (aliases: build)
Running ninja in directory /home/setkeh/git/lv_port_esp32/build
Executing "ninja all"...
[5/194] Performing build step for 'bootloader'
[1/1] cd /home/setkeh/git/lv_port_esp32/build/bootloader/esp-idf/esptool_py && /opt/esp-idf/tools/python_env/idf4.4_py3.8_env/bin/python /opt/esp-idf/components/partition_table/check_sizes.py --offset 0x8000 bootloader 0x1000 /home/setkeh/git/lv_port_esp32/build/bootloader
/bootloader.bin
Bootloader binary size 0x5fe0 bytes. 0x1020 bytes (17%) free.
[7/192] Building C object esp-idf/main/CMakeFiles/__idf_main.dir/main.c.obj
FAILED: esp-idf/main/CMakeFiles/__idf_main.dir/main.c.obj
/opt/esp-idf/tools/tools/xtensa-esp32-elf/esp-2021r1-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc -DHAVE_CONFIG_H -DLV_CONF_INCLUDE_SIMPLE -DLV_LVGL_H_INCLUDE_SIMPLE -DMBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\" -DUNITY_INCLUDE_CONFIG_H -DWITH_POSIX -Iconfig -I/opt/esp
-idf/components/newlib/platform_include -I/opt/esp-idf/components/freertos/include -I/opt/esp-idf/components/freertos/port/xtensa/include -I/opt/esp-idf/components/esp_hw_support/include -I/opt/esp-idf/components/esp_hw_support/include/soc -I/opt/esp-idf/components/esp_hw_
support/include/soc/esp32 -I/opt/esp-idf/components/esp_hw_support/port/esp32/. -I/opt/esp-idf/components/heap/include -I/opt/esp-idf/components/log/include -I/opt/esp-idf/components/lwip/include/apps -I/opt/esp-idf/components/lwip/include/apps/sntp -I/opt/esp-idf/componen
ts/lwip/lwip/src/include -I/opt/esp-idf/components/lwip/port/esp32/include -I/opt/esp-idf/components/lwip/port/esp32/include/arch -I/opt/esp-idf/components/soc/include -I/opt/esp-idf/components/soc/esp32/. -I/opt/esp-idf/components/soc/esp32/include -I/opt/esp-idf/componen
ts/hal/esp32/include -I/opt/esp-idf/components/hal/include -I/opt/esp-idf/components/hal/platform_port/include -I/opt/esp-idf/components/esp_rom/include -I/opt/esp-idf/components/esp_rom/include/esp32 -I/opt/esp-idf/components/esp_rom/esp32 -I/opt/esp-idf/components/esp_co
mmon/include -I/opt/esp-idf/components/esp_system/include -I/opt/esp-idf/components/esp_system/port/soc -I/opt/esp-idf/components/esp_system/port/public_compat -I/opt/esp-idf/components/esp32/include -I/opt/esp-idf/components/xtensa/include -I/opt/esp-idf/components/xtensa
/esp32/include -I/opt/esp-idf/components/driver/include -I/opt/esp-idf/components/driver/esp32/include -I/opt/esp-idf/components/esp_pm/include -I/opt/esp-idf/components/esp_ringbuf/include -I/opt/esp-idf/components/efuse/include -I/opt/esp-idf/components/efuse/esp32/inclu
de -I/opt/esp-idf/components/vfs/include -I/opt/esp-idf/components/esp_wifi/include -I/opt/esp-idf/components/esp_event/include -I/opt/esp-idf/components/esp_netif/include -I/opt/esp-idf/components/esp_eth/include -I/opt/esp-idf/components/tcpip_adapter/include -I/opt/esp-
idf/components/esp_phy/include -I/opt/esp-idf/components/esp_phy/esp32/include -I/opt/esp-idf/components/esp_ipc/include -I/opt/esp-idf/components/app_trace/include -I/opt/esp-idf/components/esp_timer/include -I/opt/esp-idf/components/mbedtls/port/include -I/opt/esp-idf/co
mponents/mbedtls/mbedtls/include -I/opt/esp-idf/components/mbedtls/esp_crt_bundle/include -I/opt/esp-idf/components/app_update/include -I/opt/esp-idf/components/spi_flash/include -I/opt/esp-idf/components/bootloader_support/include -I/opt/esp-idf/components/nvs_flash/inclu
de -I/opt/esp-idf/components/pthread/include -I/opt/esp-idf/components/esp_gdbstub/include -I/opt/esp-idf/components/esp_gdbstub/xtensa -I/opt/esp-idf/components/esp_gdbstub/esp32 -I/opt/esp-idf/components/espcoredump/include -I/opt/esp-idf/components/espcoredump/include/p
ort/xtensa -I/opt/esp-idf/components/wpa_supplicant/include -I/opt/esp-idf/components/wpa_supplicant/port/include -I/opt/esp-idf/components/wpa_supplicant/esp_supplicant/include -I/opt/esp-idf/components/ieee802154/include -I/opt/esp-idf/components/asio/asio/asio/include -
I/opt/esp-idf/components/asio/port/include -I/opt/esp-idf/components/cbor/port/include -I/opt/esp-idf/components/unity/include -I/opt/esp-idf/components/unity/unity/src -I/opt/esp-idf/components/cmock/CMock/src -I/opt/esp-idf/components/coap/port/include -I/opt/esp-idf/com
ponents/coap/port/include/coap -I/opt/esp-idf/components/coap/libcoap/include -I/opt/esp-idf/components/coap/libcoap/include/coap2 -I/opt/esp-idf/components/console -I/opt/esp-idf/components/nghttp/port/include -I/opt/esp-idf/components/nghttp/nghttp2/lib/includes -I/opt/e
sp-idf/components/esp-tls -I/opt/esp-idf/components/esp-tls/esp-tls-crypto -I/opt/esp-idf/components/esp_adc_cal/include -I/opt/esp-idf/components/esp_hid/include -I/opt/esp-idf/components/tcp_transport/include -I/opt/esp-idf/components/esp_http_client/include -I/opt/esp-i
df/components/esp_http_server/include -I/opt/esp-idf/components/esp_https_ota/include -I/opt/esp-idf/components/esp_lcd/include -I/opt/esp-idf/components/esp_lcd/interface -I/opt/esp-idf/components/protobuf-c/protobuf-c -I/opt/esp-idf/components/protocomm/include/common -I
/opt/esp-idf/components/protocomm/include/security -I/opt/esp-idf/components/protocomm/include/transports -I/opt/esp-idf/components/mdns/include -I/opt/esp-idf/components/esp_local_ctrl/include -I/opt/esp-idf/components/sdmmc/include -I/opt/esp-idf/components/esp_serial_sl
ave_link/include -I/opt/esp-idf/components/esp_websocket_client/include -I/opt/esp-idf/components/expat/expat/expat/lib -I/opt/esp-idf/components/expat/port/include -I/opt/esp-idf/components/wear_levelling/include -I/opt/esp-idf/components/fatfs/diskio -I/opt/esp-idf/compo
nents/fatfs/vfs -I/opt/esp-idf/components/fatfs/src -I/opt/esp-idf/components/freemodbus/common/include -I/opt/esp-idf/components/idf_test/include -I/opt/esp-idf/components/idf_test/include/esp32 -I/opt/esp-idf/components/jsmn/include -I/opt/esp-idf/components/json/cJSON -
I/opt/esp-idf/components/libsodium/libsodium/src/libsodium/include -I/opt/esp-idf/components/libsodium/port_include -I/opt/esp-idf/components/mqtt/esp-mqtt/include -I/opt/esp-idf/components/openssl/include -I/opt/esp-idf/components/perfmon/include -I/opt/esp-idf/components
/spiffs/include -I/opt/esp-idf/components/ulp/include -I/opt/esp-idf/components/wifi_provisioning/include -I../components/lvgl -I../components/lvgl/src -I../components/lv_examples -I../components/lvgl_esp32_drivers -I../components/lvgl_esp32_drivers/lvgl_tft -mlongcalls -W
no-frame-address -ffunction-sections -fdata-sections -Wall -Werror=all -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wextra -Wno-unused-parameter -Wno-sign-compare -ggdb -Og -fmacro-prefix-map=/home/setkeh/git/lv_port_esp32=. -fm
acro-prefix-map=/opt/esp-idf=IDF -fstrict-volatile-bitfields -Wno-error=unused-but-set-variable -fno-jump-tables -fno-tree-switch-conversion -std=gnu99 -Wno-old-style-declaration -D_GNU_SOURCE -DIDF_VER=\"v4.4-dev-2533-g83956ebbae\" -DESP_PLATFORM -MD -MT esp-idf/main/CMak
eFiles/__idf_main.dir/main.c.obj -MF esp-idf/main/CMakeFiles/__idf_main.dir/main.c.obj.d -o esp-idf/main/CMakeFiles/__idf_main.dir/main.c.obj -c ../main/main.c
../main/main.c: In function 'guiTask':
../main/main.c:116:13: error: 'lv_disp_drv_t' {aka 'struct _disp_drv_t'} has no member named 'full_refresh'
     disp_drv.full_refresh = 1;
             ^
[24/192] Building C object esp-idf/lvgl/CMakeFiles/__idf_lvgl.dir/src/lv_themes/lv_theme_material.c.obj
ninja: build stopped: subcommand failed.
ninja failed with exit code 1

and i have not yet been able to find the reason why this is the case after some googling. I will of course keep looking but perhaps you know what i have missed in the mean time.

Many thanks
Setkeh

Sorry, seems like you are using v7, this feature only in v8.

I have never used this project before, but the problem may be in the configuration file or pin and screen configuration. I think the fast way to solve this is look some completed examples on a video or blog site and see how they do it. Never mind. :smiley:

That’s my Suspicion too ill see if i can upgrade to V8 and see if that helps with the changes made i believe in the example i used its pulled in via a git sub module i suppose its possible using the latest version could fix the issue as well ill give it a shot after work today and see how it goes :slight_smile:

Disregard i was in the wrong Directory