[SYS] Migrate M5 boards to M5Unified + M5GFX (modern platform) (#2355)

The per-board libs (M5Stack/M5StickC/M5StickC-Plus/M5Tough) don't build on
Arduino core 3.x, which kept the five M5 BLE envs pinned to espressif32@6.1.0.
Port board support to M5Unified + M5GFX so they run ${com.esp32_platform} like
the rest of the tree.

- environments.ini: 5 M5 envs -> modern platform + m5unified. m5stick-c uses the
  pico32 variant (m5stick_c variant absent upstream) and no_coredump partitions
  (M5Unified overflows min_spiffs).
- boardM5.cpp / config_M5.h: single <M5Unified.h>; M5.Lcd aliases M5.Display;
  unified brightness/sleep/wake.
- main.cpp / mqttDiscovery.cpp: battery telemetry via M5.Power; AXP192-only
  Vin/VBus/temp fields dropped (no portable equivalent).

All five M5 envs build; M5Stack Core hardware-verified.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
FlorianandClaude Opus 5 authored and GitHub committed 2026-08-15 16:45:35 -05:00
1 parent 7df23d4e3e
commit d8ffa3f1dd
6 files changed
+82 -91

No files matched your search

+24 -11
View File
@@ -649,7 +649,8 @@ custom_hardware = OLIMEX ESP32 Gateway
custom_img = img/boards/olimex-esp32-gateway.jpg
[env:esp32-m5stick-ble]
platform = espressif32@6.1.0
platform = ${com.esp32_platform}
platform_packages = ${com.esp32_platform_packages}
board = m5stack-core-esp32
board_build.partitions = partitions/no_coredump.csv
lib_deps =
@@ -673,12 +674,13 @@ custom_hardware = M5Stick Grey
custom_img = img/boards/m5stick.webp
[env:esp32-m5stack-ble]
platform = espressif32@6.1.0
platform = ${com.esp32_platform}
platform_packages = ${com.esp32_platform_packages}
board = m5stack-core-esp32
board_build.partitions = min_spiffs.csv
lib_deps =
${com-esp32.lib_deps}
${libraries.m5stack}
${libraries.m5unified}
${libraries.ble}
${libraries.decoder}
build_flags =
@@ -698,12 +700,13 @@ custom_hardware = M5Stack Core
custom_img = img/boards/m5stack-core.webp
[env:esp32-m5tough-ble]
platform = espressif32@6.1.0
platform = ${com.esp32_platform}
platform_packages = ${com.esp32_platform_packages}
board = m5stack-core-esp32
board_build.partitions = min_spiffs.csv
lib_deps =
${com-esp32.lib_deps}
${libraries.m5tough}
${libraries.m5unified}
${libraries.ble}
${libraries.decoder}
build_flags =
@@ -717,14 +720,23 @@ custom_hardware = M5Tough rugged
custom_img = img/boards/m5tough.webp
[env:esp32-m5stick-c-ble]
platform = espressif32@6.1.0
board = m5stick-c
board_build.partitions = min_spiffs.csv
platform = ${com.esp32_platform}
platform_packages = ${com.esp32_platform_packages}
; The modern framework dropped the "m5stick_c" board variant (no
; pins_arduino.h), so target the identical ESP32-PICO-D4 "pico32" variant
; instead — the same silicon the M5StickC-Plus env already uses. M5Unified
; detects the real StickC at runtime, and OMG defines every StickC GPIO
; explicitly below, so the variant's pin defaults are irrelevant.
board = pico32
; M5Unified is much larger than the old M5StickC lib and overflows min_spiffs'
; 0x1E0000 app slot (~1.9 MB) once IR is also enabled; use the 0x1F0000 layout
; the M5StickC-Plus env already uses.
board_build.partitions = partitions/no_coredump.csv
lib_deps =
${com-esp32.lib_deps}
${libraries.ble}
${libraries.decoder}
${libraries.m5stickc}
${libraries.m5unified}
${libraries.irremoteesp}
build_flags =
${com-esp32.build_flags}
@@ -748,14 +760,15 @@ custom_hardware = M5Stick C
custom_img = img/boards/m5stick-c.webp
[env:esp32-m5stick-cp-ble]
platform = espressif32@6.1.0
platform = ${com.esp32_platform}
platform_packages = ${com.esp32_platform_packages}
board = pico32
board_build.partitions = partitions/no_coredump.csv
lib_deps =
${com-esp32.lib_deps}
${libraries.ble}
${libraries.decoder}
${libraries.m5stickcp}
${libraries.m5unified}
${libraries.irremoteesp}
build_flags =
${com-esp32.build_flags}