How to Include LVGL in STM32CubeIDE?

Hello all, I want to add LVGL in my STM32CubeIDE Project and for this I have followed all the instructions given in page :LVGL Quick Overview.

Problem observed: After copying LVGL folder and lv_conf in my project directory and than adding lvgl/lvgl.h in main.c file I get following errors:

Blockquote 23:09:30 **** Incremental Build of configuration Debug for project STM32_Graphics_Test ****
make -j12 all
arm-none-eabi-gcc -o “STM32_Graphics_Test.elf” @“objects.list” -mcpu=cortex-m4 -T"C:\Users\shrik\STM32CubeIDE\Shri_Workspsace\Stm32F407\STM32_Graphics_test\STM32_Graphics_Test\STM32F401VETX_FLASH.ld" --specs=nosys.specs -Wl,-Map=“STM32_Graphics_Test.map” -Wl,–gc-sections -static --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -Wl,–start-group -lc -lm -Wl,–end-group
c:\st\stm32cubeide_1.8.0\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.9-2020-q2-update.win32_2.0.0.202105311346\tools\arm-none-eabi\bin\ld.exe: ./Core/Src/main.o: in function main': C:/Users/shrik/STM32CubeIDE/Shri_Workspsace/Stm32F407/STM32_Graphics_test/STM32_Graphics_Test/Debug/../Core/Src/main.c:91: undefined reference to lv_init’
collect2.exe: error: ld returned 1 exit status
make: *** [makefile:67: STM32_Graphics_Test.elf] Error 1
“make -j12 all” terminated with exit code 2. Build might be incomplete.

23:09:31 Build Failed. 3 errors, 0 warnings. (took 832ms)
Picture for reference are attached:


Point to note that i am planning to use LVGL for KS0108 LCD using STM32F401VET(with GPIO no GPU).I have not yet added the driver. Also i have checked various combination like “lvgl/lvgl.h” than added LVGL location in the include paths too but none of these trick work.

Hi @Shri,

It looks at first glance as if you may not have included the lvgl library in your linker settings for the project.

I don’t use the STM32CubeIDE, but the eclipse project settings should be similar for your setup see below:

Hopefully this will give you a clue as to how to add the library to your linker settings for the project.

Hope that helps…

Kind Regards,

Pete

What is the default location of the LVGL library?and what’s its extension ?.. please guide…

Thankyou @pete-pjb My problem is now solved by merely pointing lv_conf.h in the “Include path” and in the “Paths and Symbols”…Thankyou again

Hi @Shri,

You’re welcome (Although I wasn’t much help really :slight_smile:).

I’m very glad you got it working. :wink:

Cheers,

Pete.