espressif / esp-bsp

Board support components for Espressif development boards
Other
201 stars 102 forks source link

ESP-BOX-3 GT911 Touch driver not getting initialized. (BSP-572) #421

Open cellux1002 opened 1 week ago

cellux1002 commented 1 week ago

Board

ESP32-S3-BOX-3

Hardware Description

There is nothing else attached to the module, only the esp32-s3-box-3 itself.

IDE Name

ESP-IDF

Operating System

Windows 10

Description

It appears that BSP cannot properly initialize the GT911 touch driver, that is in the esp-box-3. The BSP version 1.2.0~2 for the esp-box-3 is included via the esp component registery. Upon creating a simple project that displays an UI, the screen shows the UI and It works as expected, but the touch driver is not initialized and the touch does not provide any feedback. Image below shows the warning that the GT911 returns. image_2024-10-26_232919213

Sketch

"main.cpp"

#include <stdio.h>
#include "bsp/esp-bsp.h"
#include "bsp/touch.h"
#include "bsp/esp-box-3.h"
#include "ui/ui.h"
#include "lvgl.h"
#include "esp_log.h"

extern "C" void app_main(void){
    //i2c_master_init();
    esp_log_level_set("i2c", ESP_LOG_DEBUG);

    bsp_i2c_init(); 

    bsp_display_cfg_t cfg = {
        .lvgl_port_cfg = ESP_LVGL_PORT_INIT_CONFIG(),
        .buffer_size = BSP_LCD_H_RES * CONFIG_BSP_LCD_DRAW_BUF_HEIGHT,
        .double_buffer = 0,
        .flags = {
            .buff_dma = true,
        }
    };
    bsp_display_start_with_config(&cfg);

    bsp_display_backlight_on();

    bsp_display_lock(0);     
    lv_init();
    ui_init();
    lv_scr_load(ui_Screen1);

    while(true){
        lv_task_handler();
        vTaskDelay(10/portTICK_PERIOD_MS);
    }

}

Other Steps to Reproduce

To reproduce this issue, create a new project from the template, install the esp-box-3 BSP from the esp component registery, and use the code provided in the sketch. This should return the same error.

I have checked existing issues, README.md and ESP32 Forum

espzav commented 1 week ago

This is only warning of the driver. The driver can set and initialize I2C address of touch controller automatically, but only when RST and INT pins are set. It seems that touch is working properly (in the next lines of the console).

cellux1002 commented 1 week ago

Perhaps that is true. But upon setting the RST ant INT pins, the driver returns an error and then not even the screen is initialized. There is also no response from touching the screen, which is odd.

cellux1002 commented 1 week ago

image The INT pin is set to GPIO 3 while the RST pin is set to NC since it shares the pin with the LCD (GPIO 48).

If I recall, the initialization of the GT911 driver checks If the RST pin is not equal to GPIO NC before it proceeds with the initialization process.

brunohorta82 commented 13 hours ago

any news ?

cellux1002 commented 10 hours ago

Nothing so far sadly. The only way that I have been able to properly initialize the touch driver is using the LovyanGFX library, but that requires the arduino component. Hoping this issue will be resolved soon.