Issue with TFT display and lv_esp driver

Painone
Posts: 2
Joined: Wed Jun 11, 2025 2:54 am

Issue with TFT display and lv_esp driver

Postby Painone » Wed Jun 11, 2025 3:07 am

Hi there!
I am using ttgo esp32 lora module and ILI9341 based 240×320 TFT screen with lvgl.
the component i am using is lvgl/lvgl_esp32_drivers: ^0.0.3. When I run the code the screen is blank with a watchdog trigger error.
Here is the code:

Code: Select all

#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "lvgl.h"
#include "lvgl_helpers.h"
#include "test.h"
static void lv_tick_task(void *arg) {
    while (1) {
        lv_tick_inc(1); // Increment LVGL tick by 1 ms
        vTaskDelay(pdMS_TO_TICKS(1));
    }
}
void app_main() {
    lv_init();
    lvgl_driver_init();

    // Start LVGL tick task
    xTaskCreate(lv_tick_task, "lv_tick_task", 2048, NULL, 5, NULL);

    lv_obj_t *img = lv_img_create(lv_scr_act(), NULL);
    lv_img_set_src(img, &tes_map); // Use the image variable from test.h
    lv_obj_align(img, NULL, LV_ALIGN_CENTER, 0, 0); // Center the image

    while (1) {
        lv_task_handler(); // Let LVGL process tasks
        vTaskDelay(pdMS_TO_TICKS(10)); // Call every 10ms (or 5-20ms)
    }
}
and the image array i got from https://lvgl.io/tools/imageconverter with lvgl version 8

Code: Select all

const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_TES uint8_t tes_map[] ={.....}
const lv_img_dsc_t tes = {
  .header.cf = LV_IMG_CF_TRUE_COLOR,
  .header.always_zero = 0,
  .header.reserved = 0,
  .header.w = 320,
  .header.h = 240,
  .data_size = 76800 * LV_COLOR_SIZE / 8,
  .data = tes_map,
};

Thanks in advace!!

Sprite
Espressif staff
Espressif staff
Posts: 10599
Joined: Thu Nov 26, 2015 4:08 am

Re: Issue with TFT display and lv_esp driver

Postby Sprite » Wed Jun 11, 2025 8:59 am

By default, FreeRTOS runs at 100Hz, which may mean that vTaskDelay(pdMS_TO_TICKS(1)); effectively converts to a no-op and that task is spinning all the time. I'd look at that first.

Painone
Posts: 2
Joined: Wed Jun 11, 2025 2:54 am

Re: Issue with TFT display and lv_esp driver

Postby Painone » Fri Jun 13, 2025 12:12 pm

I took a reference from examples in lvgl. There are no errors but the screen is just blank white. I tried printing hello but no difference.

Who is online

Users browsing this forum: Barkrowler, ChatGPT-User, Qwantbot, Semrush [Bot], YisouSpider and 2 guests