Skip to content
Draft
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions docs/M5Stack_CoreS3.md
Comment thread
ToshihiroMakuuchi marked this conversation as resolved.
Outdated
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# M5Stack CoreS3 Support for WLED

The M5Stack CoreS3 integration combines multiple usermods and CoreS3-specific build support, including the local touch UI, power management, built-in microphone Audio Reactive support, and ESP32-S3 RMT stabilization.

The complete documentation is maintained with the CoreS3 Display usermod:

- **English:** [M5Stack CoreS3 Documentation](../usermods/CoreS3_Display/readme.md)
- **日本語:** [M5Stack CoreS3 日本語ドキュメント](../usermods/CoreS3_Display/readme_jp.md)

## Main Components

- `usermods/CoreS3_Power/`
- `usermods/CoreS3_Display/`
- `usermods/CoreS3_Audio/`
- `usermods/audioreactive/`
- `pio-scripts/cores3_upload_watchdog_reset.py`
- `pio-scripts/cores3_v17_neopixelbus_patch.py`
- `usermods/CoreS3_Display/platformio_override.ini.example`

The CoreS3-specific implementation is kept outside the WLED core as much as practical, with only a minimal integration hook in `wled00/wled.cpp`, to make future upstream synchronization easier.
51 changes: 51 additions & 0 deletions pio-scripts/cores3_upload_watchdog_reset.py
Comment thread
ToshihiroMakuuchi marked this conversation as resolved.
Outdated
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# M5Stack CoreS3 upload reset stabilization
#
# Purpose:
# ESP32-S3 native USB / USB-Serial-JTAG uploads can occasionally remain
# in download mode after PlatformIO's default RTS hard reset.
#
# PlatformIO's ESP32 builder constructs esptool's --after argument from:
# board.get("upload.after_reset", "hard_reset")
#
# Set that board option early, before the platform builder creates
# UPLOADERFLAGS. This changes only the post-upload reset method.
#
# Expected esptool behavior:
# --after watchdog-reset
#
# No firmware source, build flag, partition, PSRAM, flash, or runtime
# behavior is modified by this script.

Import("env")

TARGET_RESET_METHOD = "watchdog-reset"


def configure_upload_reset():
board = env.BoardConfig()
previous = board.get("upload.after_reset", "hard_reset")

if previous == TARGET_RESET_METHOD:
print(
"[CoreS3 Upload] post-upload reset already set to "
f"{TARGET_RESET_METHOD}"
)
return

board.update("upload.after_reset", TARGET_RESET_METHOD)

effective = board.get("upload.after_reset", "")
if effective != TARGET_RESET_METHOD:
raise RuntimeError(
"CoreS3 upload reset configuration failed: "
f"expected {TARGET_RESET_METHOD}, got {effective}"
)

print(
"[CoreS3 Upload] post-upload reset: "
f"{previous} -> {TARGET_RESET_METHOD}"
)


if not env.IsIntegrationDump():
configure_upload_reset()
Loading
Loading