How to integrate lvgl in a MPLABX existing project?

Hi,

I am trying to integrate lvgl on mplabx with a existing project.

Is there any tutorial on how to do this ?

OBS: I am using xc32 compiler.

Thank’s.

Works:

Put the lvgl-master(renamed lvgl) inside project directory.

In mplabx, go to file->Project Properties->xc32-gcc->“preprocessing and message” tab->include directories, and browse the lvgl folder. ok, apply and ok.

In project tree:

In folder “Header Files”, create a “new logical folder” with name lvgl for example.

Inside “new logical folder” created, lvgl, “add existing item” and put the files lvgl.h and lv_conf.h inside the lvgl logical folder.

That’s it.

1 Like

You answered yourself :slight_smile:

Yes.
To help others who have the same doubts.
:slight_smile:

what type of micro do you use?
I used in my project PIC32MX470F512H and PIC32MZDA serie in custom boards.
Ver of lvgl 6 for PIC32MX and 7 for PIC32MZDA

This is the correct attitude. Great !!!

Hi,

Unfortunately my solution only works (the code compiles without errors) when i do not call any function from lvgl lib.

When i call some function in lvgl lib( lv_init() for example ), the follow linker error(i think is a linker error) appear "undefined reference to `lv_init’ ".

Some suggestion ?

NOTE: To compile this step is not mandatory, in “my solution”.
“In mplabx, go to file->Project Properties->xc32-gcc->“preprocessing and message” tab->include directories, and browse the lvgl folder. ok, apply and ok.”

I am using pic32mk1024mcf064, but i will switch to pic32mk1024mcm064 as soon as possible, because pic32mk1024mcf064 have a lot of silicon bugs.

PIC32MZDA is great for hmi i think.

I have never used the mplab IDE, but my educated guess based on your solution is that you need to configure something related to the source files as well. It seems that right now you have only configured the header/preprocessor to find LVGL, which means that compilation will succeed but linking will fail.

where you call lv_init you entered #include “lvgl.h” ? (lvgl.h is inside folder lvgl)

and again, add the lvgl folder in the “Source File” tree of the MPLAB project -> Add Existing Items from Folders for * .c and in “Header File” for * .h

Hi @andre,

I did it like this, but yet " undefined reference to `lv_init’ ".

Where is defined this ?

LV_LVGL_H_INCLUDE_SIMPLE

After much attempt:

In MPLABX project tree:

In folder “Header Files”, right mouse click->“Add existing itens from folders…”->“add folder…”->select all lvgl-master folder(i renamed to only lvgl)->select file type: header files(.H.SUNWCCh.h.hpp.hxx.tcc.inc.INC)->ADD.

In folder “Source Files”, right mouse click->“Add existing itens from folders…”->“add folder…”->select all lvgl-master folder(i renamed to only lvgl)->select file type: C Source Files(.c.i.m)->ADD.

“Header Files” and “Source Files” no need to be root directory(in my case it is not).

In MPLABX, go to file->Project Properties->xc32-gcc->“preprocessing and message” tab->include directories, and browse the lvgl folder. ok, apply and ok.

Note: “for loop c99 error”.
In mplabx, go to file->Project Properties->xc32-gcc->additional options:->put “-std=gnu99 -fgnu89-inline”->apply and ok.

In mplabx, go to file->Project Properties->xc32-gcc->Preprocessor macros-> put “LV_LVGL_H_INCLUDE_SIMPLE”-> apply and ok.

I think that’s it.

1 Like

you solved it?

Yes, its solved.

there are still warnings of unused variables, but project compile.

I am using freeRTOS too.

And the lvgl examples are running on display already.

1 Like

How to public a video here ?

You can post it to YouTube, etc. and put a link here. You have made enough posts that it shouldn’t be considered spam by the software.

In this video the pic32mk(120Mhz) are running with freertos and lvgl in spi mode with 30 Mhz and i am using dma.
The display dont have tearing output signal.

I think that the broken big gear in screen are because sync issues(without tearing signal), but maybe spi is slow or processor power. I am not sure.

This video the pic32mk(120Mhz) are running in bare metal programming with pure c language.
Spi 30Mhz with dma too.
The adapter board(smd to through hole) that i designed and this pcb board assembled in a universal board.
The gfx and driver libs that i wrote.