Ok first a little background… I’m coming from the Arduino IDE, and have this project that uses 3 microcontrollers: two M5Stack M5Dials (ESP32-S3 processor) and the third is a generic ESP32-S3 dev board.
I first brought the M5Dial project over (same project for both dial boards) and with some difficulty got it to compile and upload. Here’s the platform.ini for that project:
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[platformio]
default_envs = m5stack-stamps3
[env:m5stack-stamps3]
platform = espressif32
board = m5stack-stamps3
framework = arduino
;platform_packages = tool-esptoolpy@https://github.com/tasmota/esptool/releases/download/v4.7.4/esptool.zip ;Compiles but board stuck in boot loop
;platform_packages = tool-esptoolpy@https://github.com/tasmota/esptool/releases/download/v4.8.1/esptool.zip ;Compiles but board stuck in boot loop
platform_packages = framework-arduinoespressif32@https://github.com/espressif/arduino-esp32/archive/refs/tags/2.0.14.zip ;Worked before, now wont compile
;platform_packages = framework-arduinoespressif32@https://github.com/espressif/arduino-esp32/archive/refs/tags/3.0.7.zip ;Does not work
lib_deps =
m5stack/M5Dial
m5stack/M5Unified
m5stack/M5GFX
;m5stack/M5Dial@^1.0.2 ;Same as arduino IDE 1/2025
;m5stack/M5Unified@^0.1.11 ;Arduino IDE was at 0.2.2 1/2025
;m5stack/M5GFX@^0.1.11 ;Arduino IDE was at 0.2.3 1/2025
adafruit/Adafruit SHT31 Library
adafruit/Adafruit VEML7700 Library
adafruit/Adafruit BusIO
yiannisbourkelis/Uptime Library
upload_speed = 921600
monitor_speed = 115200
;board_build.flash_mode = qio
;board_upload.flash_size = 8MB
board_build.partitions = default_8MB.csv
;board_upload.maximum_size = 8388608
board_build.filesystem = spiffs
build_flags =
-D ARDUINO_USB_CDC_ON_BOOT=1
;-D SS=7 ;These came from https://community.platformio.org/t/unable-to-compile-m5stack-factory-arduino-examples/36936/10 but appear not to be needed
;-D MOSI=6
;-D MISO=5
;-D SCK=4
;upload_port = COM[68]
upload_port = COM8
Then I brought over the one for the generic ESP32-S3 dev board, and have been working on getting it to compile. But along the way I happened to try recompiling my M5Dial project and it suddenly would not compile!
First, the platformio.ini for the dev board project:
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[env:esp32-s3-devkitm-1]
platform = espressif32
board = esp32-s3-devkitm-1
framework = arduino
upload_speed = 921600
monitor_speed = 115200
lib_deps =
rtclib
Arduino_JSON
ESPAsyncWebServer
yiannisbourkelis/Uptime Library
uTimerLib
EMailSender
upload_port = COM11
This is what the output looks like when the M5Dial project successfully compiles (the 2nd time after successfully compiling once - for the first compile the output of course is much longer):
Processing m5stack-stamps3 (platform: espressif32; board: m5stack-stamps3; framework: arduino)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/m5stack-stamps3.html
PLATFORM: Espressif 32 (6.9.0) > M5Stack StampS3
HARDWARE: ESP32S3 240MHz, 320KB RAM, 8MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-builtin, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
- framework-arduinoespressif32 @ 2.0.14
- tool-esptoolpy @ 1.40501.0 (4.5.1)
- toolchain-riscv32-esp @ 8.4.0+2021r2-patch5
- toolchain-xtensa-esp32s3 @ 8.4.0+2021r2-patch5
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 45 compatible libraries
Scanning dependencies...
Dependency Graph
|-- M5Dial @ 1.0.2
|-- M5Unified @ 0.2.2
|-- M5GFX @ 0.2.3
|-- Adafruit SHT31 Library @ 2.2.2
|-- Adafruit VEML7700 Library @ 2.1.6
|-- Adafruit BusIO @ 1.17.0
|-- Uptime Library @ 1.0.0
|-- WiFi @ 2.0.0
|-- OpenFontRender @ 1.2.0
|-- TFT_eSPI @ 2.5.43
|-- LittleFS @ 2.0.0
|-- uTimerLib @ 1.7.2
|-- Preferences @ 2.0.0
|-- SPI @ 2.0.0
Building in release mode
Retrieving maximum program size .pio\build\m5stack-stamps3\firmware.elf
Checking size .pio\build\m5stack-stamps3\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM: [= ] 14.9% (used 48772 bytes from 327680 bytes)
Flash: [=== ] 31.2% (used 1044409 bytes from 3342336 bytes)
After that, all I have to do is switch my PIO project environment to the other project (the first time I do this it installs some stuff), and then switch the environment back to the M5Dial project. The output then looks like this:
Processing m5stack-stamps3 (platform: espressif32; board: m5stack-stamps3; framework: arduino)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/m5stack-stamps3.html
PLATFORM: Espressif 32 (6.9.0) > M5Stack StampS3
HARDWARE: ESP32S3 240MHz, 320KB RAM, 8MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-builtin, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
- framework-arduinoespressif32 @ 2.0.14
- tool-esptoolpy @ 1.40501.0 (4.5.1)
- toolchain-riscv32-esp @ 8.4.0+2021r2-patch5
- toolchain-xtensa-esp32s3 @ 8.4.0+2021r2-patch5
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 45 compatible libraries
Scanning dependencies...
Dependency Graph
|-- M5Dial @ 1.0.2
|-- M5Unified @ 0.2.2
|-- M5GFX @ 0.2.3
|-- Adafruit SHT31 Library @ 2.2.2
|-- Adafruit VEML7700 Library @ 2.1.6
|-- Adafruit BusIO @ 1.17.0
|-- Uptime Library @ 1.0.0
|-- WiFi @ 2.0.0
|-- OpenFontRender @ 1.2.0
|-- TFT_eSPI @ 2.5.43
|-- LittleFS @ 2.0.0
|-- uTimerLib @ 1.7.2
|-- Preferences @ 2.0.0
|-- SPI @ 2.0.0
Building in release mode
Generating partitions .pio\build\m5stack-stamps3\partitions.bin
Compiling .pio\build\m5stack-stamps3\lib82e\SPI\SPI.cpp.o
Compiling .pio\build\m5stack-stamps3\libe8d\Wire\Wire.cpp.o
Compiling .pio\build\m5stack-stamps3\libdaa\WiFi\WiFi.cpp.o
Archiving .pio\build\m5stack-stamps3\libe8d\libWire.a
Archiving .pio\build\m5stack-stamps3\lib82e\libSPI.a
Compiling .pio\build\m5stack-stamps3\libdaa\WiFi\WiFiAP.cpp.o
Compiling .pio\build\m5stack-stamps3\libdaa\WiFi\WiFiClient.cpp.o
Compiling .pio\build\m5stack-stamps3\libdaa\WiFi\WiFiGeneric.cpp.o
Compiling .pio\build\m5stack-stamps3\libdaa\WiFi\WiFiMulti.cpp.o
Compiling .pio\build\m5stack-stamps3\libdaa\WiFi\WiFiSTA.cpp.o
Compiling .pio\build\m5stack-stamps3\libdaa\WiFi\WiFiScan.cpp.o
Compiling .pio\build\m5stack-stamps3\libdaa\WiFi\WiFiServer.cpp.o
Compiling .pio\build\m5stack-stamps3\libdaa\WiFi\WiFiUdp.cpp.o
Compiling .pio\build\m5stack-stamps3\lib83b\FS\FS.cpp.o
Compiling .pio\build\m5stack-stamps3\lib83b\FS\vfs_api.cpp.o
Compiling .pio\build\m5stack-stamps3\lib678\SPIFFS\SPIFFS.cpp.o
xtensa-esp32s3-elf-g++: error: CreateProcess: No such file or directory
Compiling .pio\build\m5stack-stamps3\lib664\LittleFS\LittleFS.cpp.o
*** [.pio\build\m5stack-stamps3\lib678\SPIFFS\SPIFFS.cpp.o] Error 1
xtensa-esp32s3-elf-g++: error: CreateProcess: No such file or directory
*** [.pio\build\m5stack-stamps3\lib664\LittleFS\LittleFS.cpp.o] Error 1
I can fix the problem by going to the PlatformIO menu and uninstalling the Espressif32 platform. But shouldn’t these two projects be able to coexist?
Edited to add: the directories referenced in the errors when the project won’t compile exist, but have nothing in them. I also tried “Clean” and “Full clean”, neither fixes the issue.
Edit #2: you’ll notice the platformio.ini file for the M5Dial references version 2.0.14 of the arduino-esp32 board package. That is what M5Stack uses in their latest device support package. In the Arduino IDE I was using version 3.0.7 of the arduino-esp32 board package.
If I add
platform_packages = framework-arduinoespressif32@https://github.com/espressif/arduino-esp32/archive/refs/tags/2.0.14.zip
… to platformio.ini in the dev board project, the two projects seem able to coexist. But I’d much rather use a newer support package for the dev board if possible.