Environment
M5GFX 0.2.20 / 0.2.21
M5Unified 0.2.14
LVGL 9.5.0
m5stack:esp32 3.3.7
Board: M5Stack Tab5
Arduino IDE running on macOS Tahoe 26.5, Apple Silicon
Description
M5GFX 0.2.20+ fixed Tab5 flicker issues for my updated ST7123 Tab5 when using with M5GFX 0.2.19, but LVGL sketches fail when the official Arduino LVGL 9.5.0 library is installed (Arduino IDE either doesn't not include the actual LVGL.h or reporting conflicts).
Local fix
I confirmed a local workaround by:
- disabling M5GFX/src/lvgl.h so it does not shadow official LVGL,
- forcing M5GFX’s wrapper to include real <lvgl.h>,
- removing unsupported/duplicate LV_FONT_GLYPH_FORMAT_A*_ALIGNED cases in M5GFX/src/lgfx/v1/lgfx_fonts.cpp,
- preventing M5GFX’s copied LVGL .c files from compiling when real LVGL is used.
After that, the sketch compiles.
Sample Error Message
Running code:
#include <lvgl.h>
#include <M5Unified.h>
void setup() {
auto cfg = M5.config();
M5.begin(cfg);
lv_init();
lv_obj_t *label = lv_label_create(lv_scr_act());
lv_label_set_text(label, "Hello LVGL");
}
void loop() {
lv_timer_handler();
}
results in
In file included from /Users/username/Documents/Arduino/libraries/M5GFX/src/lgfx/v1/lv_font/draw_buf.h:12,
from /Users/username/Documents/Arduino/libraries/M5GFX/src/lgfx/v1/lv_font/font.h:12,
from /Users/username/Documents/Arduino/libraries/M5GFX/src/lgfx/v1/lvgl.h:60,
from /Users/username/Documents/Arduino/libraries/M5GFX/src/lgfx/v1/lgfx_fonts.hpp:8,
from /Users/username/Documents/Arduino/libraries/M5GFX/src/lgfx/v1/LGFXBase.hpp:32,
from /Users/username/Documents/Arduino/libraries/M5GFX/src/M5GFX.h:50,
from /Users/username/Documents/Arduino/libraries/M5Unified/src/M5Unified.hpp:19,
from /Users/username/Documents/Arduino/libraries/M5Unified/src/M5Unified.h:5,
from /private/var/folders/ct/y8q6jrvx1l75332mdfwwkn4m0000gn/T/.arduinoIDE-unsaved2026419-73603-kq2nnw.bh368/sketch_may19a/sketch_may19a.ino:2:
/Users/username/Documents/Arduino/libraries/M5GFX/src/lgfx/v1/lv_font/color.h:11:41: error: 'LV_COLOR_FORMAT_UNKNOWN' conflicts with a previous declaration
11 | LV_COLOR_FORMAT_UNKNOWN = 0,
| ^
In file included from /Users/username/Documents/Arduino/libraries/lvgl/src/../src/misc/../draw/lv_draw_buf.h:18,
from /Users/username/Documents/Arduino/libraries/lvgl/src/../src/misc/lv_utils.h:18,
from /Users/username/Documents/Arduino/libraries/lvgl/src/../lvgl.h:35,
from /Users/username/Documents/Arduino/libraries/lvgl/src/lvgl.h:16,
from /private/var/folders/ct/y8q6jrvx1l75332mdfwwkn4m0000gn/T/.arduinoIDE-unsaved2026419-73603-kq2nnw.bh368/sketch_may19a/sketch_may19a.ino:1:
/Users/username/Documents/Arduino/libraries/lvgl/src/../src/misc/../draw/../misc/lv_color.h:140:5: note: previous declaration 'lv_color_format_t LV_COLOR_FORMAT_UNKNOWN'
140 | LV_COLOR_FORMAT_UNKNOWN = 0,
| ^~~~~~~~~~~~~~~~~~~~~~~
/Users/username/Documents/Arduino/libraries/M5GFX/src/lgfx/v1/lv_font/color.h:13:41: error: 'LV_COLOR_FORMAT_RAW' conflicts with a previous declaration
13 | LV_COLOR_FORMAT_RAW = 0x01,
| ^~~~
/Users/username/Documents/Arduino/libraries/lvgl/src/../src/misc/../draw/../misc/lv_color.h:142:5: note: previous declaration 'lv_color_format_t LV_COLOR_FORMAT_RAW'
142 | LV_COLOR_FORMAT_RAW = 0x01,
| ^~~~~~~~~~~~~~~~~~~
/Users/username/Documents/Arduino/libraries/M5GFX/src/lgfx/v1/lv_font/color.h:14:41: error: 'LV_COLOR_FORMAT_RAW_ALPHA' conflicts with a previous declaration
14 | LV_COLOR_FORMAT_RAW_ALPHA = 0x02,
| ^~~~
/Users/username/Documents/Arduino/libraries/lvgl/src/../src/misc/../draw/../misc/lv_color.h:143:5: note: previous declaration 'lv_color_format_t LV_COLOR_FORMAT_RAW_ALPHA'
143 | LV_COLOR_FORMAT_RAW_ALPHA = 0x02,
| ^~~~~~~~~~~~~~~~~~~~~~~~~
/Users/username/Documents/Arduino/libraries/M5GFX/src/lgfx/v1/lv_font/color.h:17:41: error: 'LV_COLOR_FORMAT_L8' conflicts with a previous declaration
17 | LV_COLOR_FORMAT_L8 = 0x06,
| ^~~~
/Users/username/Documents/Arduino/libraries/lvgl/src/../src/misc/../draw/../misc/lv_color.h:146:5: note: previous declaration 'lv_color_format_t LV_COLOR_FORMAT_L8'
146 | LV_COLOR_FORMAT_L8 = 0x06,
| ^~~~~~~~~~~~~~~~~~
/Users/username/Documents/Arduino/libraries/M5GFX/src/lgfx/v1/lv_font/color.h:18:41: error: 'LV_COLOR_FORMAT_I1' conflicts with a previous declaration
18 | LV_COLOR_FORMAT_I1 = 0x07,
| ^~~~
/Users/username/Documents/Arduino/libraries/lvgl/src/../src/misc/../draw/../misc/lv_color.h:147:5: note: previous declaration 'lv_color_format_t LV_COLOR_FORMAT_I1'
147 | LV_COLOR_FORMAT_I1 = 0x07,
and more...
Environment
M5GFX 0.2.20 / 0.2.21
M5Unified 0.2.14
LVGL 9.5.0
m5stack:esp32 3.3.7
Board: M5Stack Tab5
Arduino IDE running on macOS Tahoe 26.5, Apple Silicon
Description
M5GFX 0.2.20+ fixed Tab5 flicker issues for my updated ST7123 Tab5 when using with M5GFX 0.2.19, but LVGL sketches fail when the official Arduino LVGL 9.5.0 library is installed (Arduino IDE either doesn't not include the actual LVGL.h or reporting conflicts).
Local fix
I confirmed a local workaround by:
After that, the sketch compiles.
Sample Error Message
Running code:
results in
and more...