How to Run LVGL on Raspberry Pi with SDL

I have gotten LVGL to run successfully on my Raspberry Pi Model 3 B using the Direct Frame Buffer access method. I would now like to modify the the code to run with SDL instead of the Direct Frame Buffer. I am using the ready to use project named lv_port_linux_frame_buffer that can be downloaded from your blog post named Embedded GUI Using Linux Frame Buffer Device with LVGL. I may end up using LVGL with the Direct Frame Buffer method on Linux but would like to see LVGL run with SDL so I can make my decision. Can someone tell me how to modify the lv_conf.h, lv_drv_conf.h and main.c files so that LVGL will use SDL instead of the Frame Buffer. I am very new to LVGL but we really like what we have prototyped on Windows so far. Thank You.

The simplest solution is probably to install Raspbian and use it with that.

Thanks for getting back to me. I already have Raspbian installed and the code I have working uses the Frame Buffer directly on top of Raspian which corrupts the screen. My question is how to modify the files lv_conf.h, lv_drv_conf.h and main.c so that my code will use SDL instead of the Frame Buffer running on Raspian.

You can take a look at (or use) the PC simulator project for an example.

Thank You. I will try to get the PC simulator project to run on my Raspberry Pi.

I have successfully created a CMake cross-compilation project in Visual Studio 2019 using your PC simulator project for Eclipse. I can compile and run the simulator on both Windows and my Raspberry Pi but I am having 1 problem. When I run the Raspberry Pi program with Visual Studio and the Debugger from Windows it appears that LVGL and/or SDL2 is using the Frame Buffer directly under the Raspian Desktop. When I run the Raspberry Pi program by launching it from File Manager on the Raspberry Pi itself (rather than from Visual Studio on Windows) it displays correctly on the Desktop. I have attached a picture that I took with my phone that illustrates the problem. I need to know how to change the LVGL code to force SDL2 to not use the Frame Buffer directly and instead run on the Raspian Desktop. I think something is getting confused when I run the program from Windows with the debugger. Thank You.

This is a second picture showing the program displaying correctly when I launch it with File Manager on the Raspberry Pi itself.

I don’t debug with Windows so unfortunately I can’t really help with that, though it sounds like some X11 configuration problem.