LVGL v9 Support

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LVGL v9 Support

Jump to solution
1,488 Views
frozen
Contributor III

Hello I use IMX RT1176 and have a GUI project. I use the latest SDK and MCU Xpresso IDE and in my project I have to use the latest LVGL version which is v9.0.0 . I know it is really brand new, just released on 22 of January but I have to ask when NXP SDK will support v9 LVGL ?

I am trying to support it on my own. I have added LVGL as submodule and changed LVGL version to v9.0.0 . I use SDK project which is lvgl demo widgets for now. After changing lvgl to version 9, I see compilations errors on board/lvgl_support.c file. Particularly there are two functions give major errors ;

void lv_port_disp_init(void)
{
    static lv_disp_draw_buf_t disp_buf;

    memset(s_frameBuffer, 0, sizeof(s_frameBuffer));

    lv_disp_draw_buf_init(&disp_buf, s_frameBuffer[0], s_frameBuffer[1], DEMO_BUFFER_WIDTH * DEMO_BUFFER_HEIGHT);

    status_t status;
    dc_fb_info_t fbInfo;

    /*-------------------------
     * Initialize your display
     * -----------------------*/
    BOARD_PrepareDisplayController();

    status = g_dc.ops->init(&g_dc);
    if (kStatus_Success != status)
    {
        assert(0);
    }

    g_dc.ops->getLayerDefaultConfig(&g_dc, 0, &fbInfo);
    fbInfo.pixelFormat = DEMO_BUFFER_PIXEL_FORMAT;
    fbInfo.width       = DEMO_BUFFER_WIDTH;
    fbInfo.height      = DEMO_BUFFER_HEIGHT;
    fbInfo.startX      = DEMO_BUFFER_START_X;
    fbInfo.startY      = DEMO_BUFFER_START_Y;
    fbInfo.strideBytes = DEMO_BUFFER_STRIDE_BYTE;
    g_dc.ops->setLayerConfig(&g_dc, 0, &fbInfo);

    g_dc.ops->setCallback(&g_dc, 0, DEMO_BufferSwitchOffCallback, NULL);

    s_transferDone = xSemaphoreCreateBinary();
    if (NULL == s_transferDone)
    {
        PRINTF("Frame semaphore create failed\r\n");
        assert(0);
    }

    /* lvgl starts render in frame buffer 0, so show frame buffer 1 first. */
    g_dc.ops->setFrameBuffer(&g_dc, 0, (void *)s_frameBuffer[1]);

    /* Wait for frame buffer sent to display controller video memory. */
    if ((g_dc.ops->getProperty(&g_dc) & kDC_FB_ReserveFrameBuffer) == 0)
    {
        DEMO_WaitBufferSwitchOff();
    }

    g_dc.ops->enableLayer(&g_dc, 0);

    /*-----------------------------------
     * Register the display in LittlevGL
     *----------------------------------*/

    static lv_disp_drv_t disp_drv; /*Descriptor of a display driver*/
    lv_disp_drv_init(&disp_drv);   /*Basic initialization*/

    /*Set up the functions to access to your display*/

    /*Set the resolution of the display*/
    disp_drv.hor_res = LVGL_BUFFER_WIDTH;
    disp_drv.ver_res = LVGL_BUFFER_HEIGHT;

    /*Used to copy the buffer's content to the display*/
    disp_drv.flush_cb = DEMO_FlushDisplay;

    /*Set a display buffer*/
    disp_drv.draw_buf = &disp_buf;

    /* Partial refresh */
    disp_drv.full_refresh = 1;

    /*Finally register the driver*/
    lv_disp_drv_register(&disp_drv);
}

void lv_port_indev_init(void)
{
    static lv_indev_drv_t indev_drv;

    /*------------------
     * Touchpad
     * -----------------*/

    /*Initialize your touchpad */
    DEMO_InitTouch();

    /*Register a touchpad input device*/
    lv_indev_drv_init(&indev_drv);
    indev_drv.type    = LV_INDEV_TYPE_POINTER;
    indev_drv.read_cb = DEMO_ReadTouch;
    lv_indev_drv_register(&indev_drv);
}

 

Problems are about changed structs. For example there is no a struct named lv_indev_drv_t . There is lv_draw_buf_t but it does not cover it fully. There are more jobs needs to do. Do you have prework about these SDK release? If not, could you show me a way?

0 Kudos
Reply
1 Solution
1,467 Views
EdwinHz
NXP TechSupport
NXP TechSupport

Hi @frozen,

Its tough to say when the full LVGL v9 compatibility with MCUXpresso and SDK will be released. The newest versions of the IDE and SDK have just been released this month, a couple of weeks ago. And LVGL has apparently been released 3 days ago on GitHub (its so new that even the official LVGL introduction page says that v9 is still in progress under "Version support"). The official support from our part will still require more time and much more testing, so its implementation on our official tools is still quite far from release.

The promptness with which this request is being asked is also why I wouldn't be able to provide you with much support on how to do the porting. We are still in very early stages of testing so it will not be an easy task. This is quite a big update for the LVGL libraries, so several things changed and will require meticulous testing to ensure an adequate porting between versions. The best I can do for now is recommend you to pay close attention to the migration guide included on the v9.0.0 changelog: https://docs.lvgl.io/master/CHANGELOG.html#migration-guide

For more information about this topic, please contact your FAE or NXP representative, as they might be able to provide you with more appropriate support about this.

BR,
Edwin.

View solution in original post

3 Replies
1,444 Views
frozen
Contributor III

I could see something in the screen after some modifications. I made modifications according to Migration Guide as @EdwinHz mentioned. Thanks a lot. I see there are a lot of differences from image to page loading. Migrating to v9 will take a time for sure.

1,468 Views
EdwinHz
NXP TechSupport
NXP TechSupport

Hi @frozen,

Its tough to say when the full LVGL v9 compatibility with MCUXpresso and SDK will be released. The newest versions of the IDE and SDK have just been released this month, a couple of weeks ago. And LVGL has apparently been released 3 days ago on GitHub (its so new that even the official LVGL introduction page says that v9 is still in progress under "Version support"). The official support from our part will still require more time and much more testing, so its implementation on our official tools is still quite far from release.

The promptness with which this request is being asked is also why I wouldn't be able to provide you with much support on how to do the porting. We are still in very early stages of testing so it will not be an easy task. This is quite a big update for the LVGL libraries, so several things changed and will require meticulous testing to ensure an adequate porting between versions. The best I can do for now is recommend you to pay close attention to the migration guide included on the v9.0.0 changelog: https://docs.lvgl.io/master/CHANGELOG.html#migration-guide

For more information about this topic, please contact your FAE or NXP representative, as they might be able to provide you with more appropriate support about this.

BR,
Edwin.

1,453 Views
frozen
Contributor III

Thanks @EdwinHz . I will try it on my own and if I succeed I will inform you.

0 Kudos
Reply