Compact control UI for Home automation on M5Stack Tab5 (ESP32-P4) using LVGL and PlatformIO.
- LVGL 9.4 user interface generated by EEZ Studio
- DMA-accelerated flush via M5Unified display driver
- UI skeleton and screens included (
src/ui/)
- PlatformIO (CLI) latest stable
- Platform/board:
esp32p4_pioarduino(ESP32-P4) - M5Unified library (via PlatformIO libdeps)
- LVGL 9.4.x
Make sure PlatformIO is installed and the correct environment is selected in platformio.ini.
To compile successfully for the ESP32-P4 we apply one official, local modification to the LVGL sources installed in the PlatformIO library folder:
- Disable the ARM Helium assembly file
lv_blend_helium.Sby renaming it tolv_blend_helium.S.disabledin:.pio/libdeps/esp32p4_pioarduino/lvgl/src/draw/sw/blend/helium/
Reason: the Helium assembly is incompatible with the ESP32-P4 toolchain and causes build errors. The change should be kept local inside .pio/libdeps and not pushed upstream to the LVGL project.
Commands to ensure the file is disabled (run from project root):
PowerShell:
$f = ".pio\\libdeps\\esp32p4_pioarduino\\lvgl\\src\\draw\\sw\\blend\\helium\\lv_blend_helium.S"
if (Test-Path $f) { Rename-Item -Path $f -NewName "$($f).disabled" }POSIX (bash):
f=.pio/libdeps/esp32p4_pioarduino/lvgl/src/draw/sw/blend/helium/lv_blend_helium.S
[ -f "$f" ] && mv "$f" "$f.disabled"Note: in this workspace the file already exists with the
.disabledsuffix inside.pio/libdeps.
- Open a terminal in the project root.
- Build:
pio run- Upload (adjust COM port as needed):
pio run --target upload --upload-port COM9- The UI is created in
src/ui/and screens are loaded byui_init()/ui_tick()insrc/main.cpp. - LVGL tick configuration: ensure
lv_tick_get()orlv_tick_set_cb()is set appropriately for your port.
- Open issues or PRs for bugs and improvements. For fixes inside external libraries prefer upstream PRs.
This project is licensed under the MIT License. See the LICENSE file for details.