Skip to content

About

No description, website, or topics provided.

Resources

Stars

569 stars

Watchers

10 watching

Forks

Latest commit

 

History

251 Commits

Folders and files

Repository files navigation

LVGL Simulator for VSCode

A minimal, ready-to-debug PC simulator for LVGL and the LVGL Editor. It runs LVGL in an SDL window so you can build and debug embedded GUIs without any hardware.

  • lvgl/ – LVGL as a git submodule
  • lv_conf.h – LVGL configuration
  • ui/ – export your UI from the LVGL Editor here
  • src/ – main.c and the SDL display/input setup
  • .vscode/ – build, run and debug configuration

Get the project

git clone --recursive https://github.com/lvgl/lv_port_pc_vscode

If you cloned without --recursive, run git submodule update --init.

Dependencies

You need CMake (≥ 3.16), a C compiler, a debugger and SDL2.

# Debian / Ubuntu
sudo apt install build-essential cmake gdb libsdl2-dev
# Arch
sudo pacman -S base-devel cmake gdb sdl2
# Fedora
sudo dnf install @development-tools cmake gdb SDL2-devel
# macOS
brew install cmake sdl2

On Windows use MSYS2:

pacman -S mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake mingw-w64-x86_64-SDL2

Build and run

In VSCode

  1. Open the project folder and install the recommended extensions (CodeLLDB, clangd).
  2. Press F5 to build and start debugging.

Ctrl+Shift+B only builds; the Run task builds and runs without the debugger.

From the command line

cmake -B build
cmake --build build -j
cmake --build build --target run

The run target starts the simulator from the project root, so the A:ui asset path resolves to the ui/ folder.

Configuration

LVGL is configured in lv_conf.h. It is generated from configs/base.defconfig, plus the optional fragments in configs/fragments/ (logging, monitors, asserts). The LVGL Editor regenerates it when you configure the project. Without the Editor, edit lv_conf.h directly.

The window size is set by hal_init(800, 480) in src/main.c.

Using your LVGL Editor UI

Export C code from the LVGL Editor into the ui/ folder. It is detected automatically and main.c calls ui_init("A:ui"). To show one of your screens, uncomment the lv_screen_load(...) example in src/main.c and put your screen's create function in it. See using exported C code.

Until a UI is exported, the LVGL widgets demo runs.

Support

About

No description, website, or topics provided.

Resources

Stars

569 stars

Watchers

10 watching

Forks

Releases

Packages

Contributors

Languages