Input device. Callback is never called

I’ve been dealing with LVGL recently. I faced a problem that I could not overcome. I really hope for your help.


I am trying to implement the processing of keyboard button presses. I get the codes of the pressed buttons. I tried to register my driver in LVGL, but the callback is never called.

What MCU/Processor/Board and compiler are you using?

STM32F429ZIT6 / FreeRTOS / STMCubeMX

What LVGL version are you using?


What do you want to achieve?

Operability of the input device

What have you tried so far?

Implemented the KEYPAD input device driver according to the LVGL documentation, but the breakpoints in the callback never fire.

Code to reproduce

Variable declaration, initialization, and input callback:

        lv_obj_t *          label_1;
        lv_obj_t *          ta1;
        lv_obj_t *          table1;
        lv_obj_t *          calendar;
        lv_obj_t *          list1;
        lv_obj_t *          dropdown;

static  lv_disp_drv_t       disp_drv;
static  lv_indev_drv_t      indev_drv;
static  lv_indev_t *        indev_keypad;
        lv_group_t *        group;

void Lvgl_Init              ()
    lv_init                 ();

    static lv_disp_buf_t    disp_buf;
    static lv_color_t       buf_1[LV_HOR_RES_MAX * LV_VER_RES_MAX / DIVIDER_SCR_SIZE];
    static lv_color_t       buf_2[LV_HOR_RES_MAX * LV_VER_RES_MAX / DIVIDER_SCR_SIZE];
    lv_disp_buf_init        (&disp_buf, buf_1, buf_2, LV_HOR_RES_MAX * LV_VER_RES_MAX / DIVIDER_SCR_SIZE);
    lv_disp_drv_init        (&disp_drv);
    disp_drv.flush_cb =     Lvgl_DisplayFlush;
    disp_drv.buffer   =     &disp_buf;
    lv_disp_drv_register    (&disp_drv);

    KeyReader_Init          ();
    lv_indev_drv_init       (&indev_drv);
    indev_drv.type          = LV_INDEV_TYPE_KEYPAD;
    indev_drv.read_cb       = Lvgl_Keyboard_CB;
    indev_keypad            = lv_indev_drv_register (&indev_drv);

    group                   = lv_group_create ()
    lv_group_add_obj        (group, label_1);
    lv_group_add_obj        (group, ta1);
    lv_group_add_obj        (group, table1);
    lv_group_add_obj        (group, calendar);
    lv_group_add_obj        (group, list1);
    lv_group_add_obj        (group, dropdown);
    lv_indev_set_group      (indev_keypad, group);

static bool Lvgl_Keyboard_CB(lv_indev_drv_t * indev_drv, lv_indev_data_t * data)
    uint16_t last_key   = 0;
    uint16_t act_key    = KeyReader_Get();

    if(act_key != KEY_NONE)
        data->state = LV_INDEV_STATE_PR;
        data->key   = act_key;

            case KEY_RIGHT:
                act_key = LV_KEY_NEXT;

            case KEY_LEFT:
                act_key = LV_KEY_PREV;

            case KEY_DOWN:
                act_key = LV_KEY_DOWN;

            case KEY_UP:
                act_key = LV_KEY_UP;
            case KEY_ENTER:
                act_key = LV_KEY_ENTER;



        last_key = act_key;
        data->state = LV_INDEV_STATE_REL;

    data->key = last_key;

    return false;

As recommended i call lv_tick_inc in Application Hook of freertos which gets called once every ms:

void vApplicationTickHook( void )

There was no answer to a similar question asked earlier:

Can this be a consequence of the work of FreeRTOS STM32, which is not tied to SysTick ?

I found the problem and fixed it.
For vApplicationTickHook to work correctly, the parameter: USE_TICK_HOOK must be active in the FreeRTOS settings (STM32CubeMX->Categories->Middleware->FREERTOS-> Configuration Parameters->USE_TICK_HOOK->>>Enabled<<<)