This repository can be used to generate SquareLine Studio boards for ESP32 devices (connected to supported display drivers defined in lvgl_esp32_drivers).
Project structure in _ui_project_name_ follows a similar structure to lv_port_esp32.
- ESP-IDF
- v5.2 master
lvgl_esp32_drivers
- LVGL
Board Name | Driver | Image | Example |
---|---|---|---|
esp32_ssd1306_128x64 | SSD1306 | Source Files |
Refer to https://docs.squareline.io/docs/obp.
- Clone this repo
- Create a new directory under boards/
- Example:
your_board_name/
- Example:
- Add the
your_board_name.png
file- A photo of the board to be displayed in SquareLine Studio.
- Add the
your_board_name.slb
- SquareLine board definition file (see https://docs.squareline.io/docs/obp#your_boardslb for more information)
- For monochrome displays such as the SSD1306 OLED panel, keep the
color_depth
at8
, SquareLine currently does not support depth < 8. You will need to fix this, see below. - Set the
lvgl_export_path
tofalse
as the submodule reference _ui_project_name_/components/lvgl is used - Set the
pattern_match_files
toCMakeLists.txt,main/main.c
as this will replace templated tags such as__UI_PROJECT_NAME__
- Set the
ui_export_path
to./components/ui
- Set the
supported_lvgl_version
to8.3.*
- For monochrome displays such as the SSD1306 OLED panel, keep the
- SquareLine board definition file (see https://docs.squareline.io/docs/obp#your_boardslb for more information)
- Copy
your_board_name/
directory to the SquareLine installation'sboards/Espressif
directory - Create a compressed ZIP file of the _ui_project_name_ directory
- This is common to all supported display drivers in lvgl_esp32_drivers
- Rename the ZIP file to
your_board_name.zip
- Copy the
your_board_name.zip
to SquareLine installation'sboards/Espressif/your_board_name
directory
- Once you have created a new board (or used one of the existing boards in this repo), open SquareLine Studio.
- The board you've created will appear in SquareLine Studio.
-
Example of the ESP32 SSD1306 128x64 OLED "board" is shown below.
-
- Set your project settings and create the project
- Once the new project is created and loaded, export the template project via Export -> Create Template Project
- Open the exported template project directory via your IDE. I am using CLion to open it.
- Once the project is opened via the IDE, CMake will throw the following error:
- Run
idf.py menuconfig
to configure the display drivers and LVGL - Build the ESP-IDF project
- Flash the ESP32 board
As previously mentioned, SquareLine Studio currently does not support color depth < 8. Assuming that you've set the
LVGL color depth to 1
via the project's menuconfig
, build attempts will result in the following error:
-
- This error is the result of an automatically added assertion/config check, in the generated UI files. It checks if
the set
LV_COLOR_DEPTH
(i.e set viamenuconfig
) matches thecolor_depth
set in the board's.slb
file. - To fix this error, simply replace the expected color depth (i.e.
8
) to1
- Building the project after fixing this error will succeed
- This error is the result of an automatically added assertion/config check, in the generated UI files. It checks if
the set
Assuming that you've only enabled the "Monochrome theme" for your monochrome display (as you should via the project configuration
i.e.menuconfig
)
- Example
This happens because SquareLine Studio currently does not include an option to select the monochrome theme.
To fix this issue, simply change the theme initialization code as follows:
- NOTE: You will need to modify this every time you export the UI files.