Interface GFX driver to LVGL in PIC32MZ DA

Hi to all,
i’m trying to setup my project with PIC32MZ2064DAR169 with internal 32M of SRAM
in particular interfacing driver GFX of microchip with LVGL,
but is a hell…
There is anyone that can help me that can share an example?

Thanks

Do you have any reference on this?
@kisvegabor

Hi,

Actually, I have a running a project with PIC32MZ + internal DDR RAM. The hardware and driver were created by someone else and I’m just adding some graphics. (Unfortunately, it’s a proprietary project so I can’t share it. :frowning: )

However, we have some performance issues. The DDR RAM is very slow. We still don’t know if it’s really that slow or something is misconfigured.

Anyway, where have you stuck? Could you make the DDR work with any GUI libs?

cc @carpenter_t

Hi, yes the problem is correct configuration and use of GFX driver. Example of Aria Microchip work good and fast but with lvgl there is noise on redraw of screen when graphics moves.
I have seen that other partners like embedded wizard and emwin make their drivers work well and fast with this micro.

It can be a cache invalidation issue. I suggest trying to invalidate the data cache at the beginning of disp_flush.

1 Like

I think you would want to clean the cache as well (i.e. flush newly written data to memory). Invalidation, as far as I know, will only remove cached data that was read from memory.

1 Like

do you have an example on how to invalidate cache? i’m not expert !

Hi to all!.

I leave a video of the issue.

https://youtu.be/j80pxIgYbDY

I have never used PIC32 so I don’t know how you would do it. Perhaps try doing a Google search - this forum post came up and looks relevant.

2 Likes

GoodMorning.
I improved the display refresh by inserting a wait for synchronism before the flush but I’m not sure if I have correctly registered the lvgl driver and the flush routine.

See my code:
static lv_disp_buf_t buf;

lv_disp_buf_init(&buf, frameBuffer, frameBuffer, LV_HOR_RES_MAX * LV_VER_RES_MAX);   /*Initialize the display buffer*/
static void disp_flush(lv_disp_drv_t * disp_drv, const lv_area_t * area, lv_color_t * color_p)
{
       /* IMPORTANT!!!
     * Inform the graphics library that you are ready with the flushing*/
    lv_disp_flush_ready(disp_drv);
}

Note: frameBuffer is pointer of memory that directly write on TFT.

It’s right my code?

Thanks

You can’t use the same buffer twice in lv_disp_buf_init. It should look like this:

lv_disp_buf_init(&buf, frameBuffer_1, frameBuffer_2, LV_HOR_RES_MAX * LV_VER_RES_MAX);   
/*Initialize the display buffer*/
static void disp_flush(lv_disp_drv_t * disp_drv, const lv_area_t * area, lv_color_t * color_p)
{
   GLCD_set_frambuffer_address(color_p); //I don't know what is the actual name of this function.
       /* IMPORTANT!!!
     * Inform the graphics library that you are ready with the flushing*/
    lv_disp_flush_ready(disp_drv);
}

Hi @kisvegabor @embeddedt ,
i have solved issue, I was getting the flush routine wrong.

the micro is not fast but because the GPU is not used and there is a little effect of tearing when
rectangle moves vertical.

This is a custom board with PIC32MZ2064DAR169 with internal SDRAM, TFT is 4.3’ 800x480 px
touch resistive.

i Attach link of video benchmark later.

Thank you for your support :slight_smile:

link:

sorry for rotated video :expressionless:

2 Likes

Amazing, congratulations!

Where do you call lv_tick_inc()?
It should be called in an interrupt (or some higher priority place than lv_task_handler()).
I think a problem with lv_tick_inc() is the reason why you get incorrect FPS and slower animations on complex scenes.

In essence you need to make sure that lv_tick_inc can be run even if the system is currently inside lv_task_handler.

Hi, thanks for reply,

i call lv_tick_inc() in main task and not in interrupt. I will try to setup TMR1 for 2ms and
get result. Thank you.

Ok i will try to call from interrupt. Thank you.

Hello! I have a project that is almost identical to this one, and by the looks on the display, it seems we are even using the same one!! I’m working with a PIC32MZ2064DAG176 (which is essentially the same as yours) and my resolution is the exact same.

Anyway, is this a proprietary project or is it something you could share? I need to make LVGL work on my board and it seems like you have had success with this.