The Issue:
A sketch that previously compiled now fails with this error:
fatal error: rom/miniz.h: No such file or directory
Cause:
This happened after updating the ESP32 board package (used for M5Stack devices) to version 3.2.0. It only seems to affect sketches that use the M5Core2 library (not M5Unified).
Solution (as of now):
Downgrade the M5Stack board package from v3.2.0 to v2.1.4 using the Boards Manager in the Arduino IDE.
- Go to Tools \ Board: “xxxxx” \ Boards Manager…
- Search for M5Stack
- Remove version 3.2.0
- Install version 2.1.4
- Recompile the sketch
Note:
This is a temporary workaround. M5Stack may address this issue in a future release. If you encounter this error again, first check for an updated board package before downgrading.