GitHub - lvgl/lv_port_linux_frame_buffer: LVGL configured to work with a standard Linux framebuffer.
If you follow the readme it should compile.
To add an evdev pointer to main, (make sure LV_USE_EVDEV 1
in lv_conf.h
This works on Raspberry Pi with official 7" DSI display.
int main(void)
lv_init();
/*Linux frame buffer device init*/
lv_display_t * disp = lv_linux_fbdev_create();
lv_linux_fbdev_set_file(disp, "/dev/fb0");
/*Linux evdev init*/
lv_indev_t * indev = lv_evdev_create(LV_INDEV_TYPE_POINTER, "/dev/input/event0");
lv_evdev_set_calibration( indev, 799, 479, 0, 0 );
#if 0
/*Create a Demo*/
lv_demo_widgets();
lv_demo_widgets_start_slideshow();
#else
//lv_demos_show_help();
char * name =
"widgets";
//"music";
//"multilang";
//"stress";
//"keypad_encoder";
//"flex_layout";
//"transform";
//"scroll";
//"vector_graphic";
//"benchmark";
//"flex_layout";
lv_demos_create(&name, 1);
#endif
/*Handle LVGL tasks*/
while(1) {
uint32_t ms = lv_timer_handler();
usleep(ms*1000);
return 0;
I still faced undefined reference to `lv_linux_fbdev_create’ error…
How can I use lv_linux_fbdev_create() function?
Following the instructions above on a Raspberry Pi 4 running Raspberry Pi OS Lite (64 bit) - Bookworm it compiles and runs without the undefined reference
problem you mention. The only additional requirement is that cmake
be installed.
Your response has no information that anyone can use to help you. If you want help, then try to provide some detail of significance that could help diagnose your problem.
For example, what MCU/Processor/Board and compiler are you using ? How does your platform differ from what I have described above ? What other distinguishing information of significance can you provide ?