TouchDriver issue LVGL

Hi everybody,

I am currently working on a new project using LVGL 9.2 on an STM32U5G9 development board.
I am using a framebuffer, 2DDMA and the LTDC driver. The display driver is fast enough for my use cases. I have now added the touch driver for the GT911 touch display. I have also connected it to the LVGL touch backend.

The touch driver runs with I2C in polling mode at 100 MHz. However, only a few bytes are sent and received when a request is made. So the Blocking mode shouldn’t be a issue. The touch display is also only handled if an interrupt from the GT911 is registered.

static void gt911_touchpad_read(lv_indev_t *drv, lv_indev_data_t *data)
{
    if (GT911Driver_handler(&GT911State) == true)
    {
        data->point.x = GT911State.TouchX;
        data->point.y = GT911State.TouchY;
        data->state = LV_INDEV_STATE_PR;
    }
    else
    {
        data->state = LV_INDEV_STATE_REL;
    }
    data->continue_reading = false;
}
  // Init Touchdriver
  GT911Driver_init(); 
  lv_indev_t *indev = lv_indev_create();
  lv_indev_set_type(indev, LV_INDEV_TYPE_POINTER);
  lv_indev_set_read_cb(indev, gt911_touchpad_read);

My Touchpads “Icons” are getting messed up whenever I press the them.
Befor Pressing:


After Pressing:

The GT911Driver_handler() runs in Blocking mode so this might be the issue. Do you have any experience with this?
Any help is greatly appreciated.

Correction. It doesn’t help if I move the TouchRead function outside of the Callback.