Skip to content

feat: add M5StackChan CoreS3 web flashing - #554

Merged
meganetaaan merged 6 commits into
developfrom
feat/m5stackchan-cores3-web-flash
Jul 14, 2026
Merged

feat: add M5StackChan CoreS3 web flashing#554
meganetaaan merged 6 commits into
developfrom
feat/m5stackchan-cores3-web-flash

Conversation

@meganetaaan

@meganetaaan meganetaaan commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add M5StackChan CoreS3 as a release firmware bundle target and expose it in Web Flash
  • subset the 24px splash font to Stack-chan[・_・], and remove the EOL M5Stack Fire from active bundle/Web targets
  • validate every bundled ESP32 image against its factory partition and verify the CoreS3 artifact in GitHub Actions
  • preseed the CoreS3 ESP-IDF dependency manifest so Moddable 8.3.1 cannot race while adding the camera and audio-codec components

Why

The standard mcbundle only covers registered devices and cannot include the repository's custom M5StackChan CoreS3 subplatform. The full 24px Japanese font also made the generic M5Stack image exceed its app partition. The new bundle orchestration builds the custom target explicitly, produces release images, and prevents oversized or missing artifacts from being deployed.

M5StackChan CoreS3 requires both espressif/esp32-camera and espressif/esp_audio_codec. Moddable 8.3.1 launches multiple idf.py add-dependency commands concurrently, allowing one generated-manifest update to overwrite the other on a clean runner. The repository-local preparation step writes both dependencies before mcconfig and is covered by an idempotence test.

User impact

The github.io Web Flash page can install the M5StackChan CoreS3-specific host. Existing supported M5Stack targets remain available, while the EOL Fire target is removed from the active selector.

Release impact

minor

Release note

Web Flash now supports installing the M5StackChan CoreS3 host. The EOL M5Stack Fire target has been removed from the active firmware bundle and Web Flash selector.

Validation

  • npm run bundle from clean generated output (all four active images fit their factory partitions)
  • npm run build:m5stackchan_cores3 from clean generated output
  • npm test in firmware (164 tests)
  • npm run check:architecture (56 tests)
  • npx biome ci . --error-on-warnings in firmware (415 files)
  • npm test in web (90 tests)
  • flashed the m5stackchan_cores3 release bundle to a physical device via /dev/ttyACM0, erased a pre-existing MOD partition, and confirmed device operation

Notes

The generic M5Stack release image has 38,752 bytes (about 1%) remaining in its factory partition.

Summary by CodeRabbit

  • New Features
    • Added “M5StackChan CoreS3” as a selectable target in the web flashing interface and included its dedicated firmware manifest.
    • Introduced enhanced CoreS3 firmware bundling/build validation and improved CLI handling for debug/instrument/release.
  • Documentation
    • Updated English and Japanese flashing guides to instruct selecting “M5StackChan CoreS3” and removed “M5Stack Fire” guidance.
  • Bug Fixes
    • Removed the outdated “M5Stack Fire” option from the web UI.
  • Tests
    • Added/expanded automated checks for CoreS3 bundling artifacts, dependency preparation, and the flash UI.

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Adds M5StackChan CoreS3 support across dependency preparation, firmware bundling and validation, web flashing, tests, CI checks, and flashing documentation.

Changes

M5StackChan CoreS3 firmware flow

Layer / File(s) Summary
CoreS3 IDF dependency preparation
firmware/scripts/lib/idf-dependencies.mjs, firmware/scripts/lib/idf-dependencies.test.mjs, firmware/scripts/firmware.mjs, firmware/package.json
Prepares ESP component dependencies, resolves build modes for CoreS3 commands, and tests idempotency and mode-specific paths.
Validated firmware bundling
firmware/scripts/bundle.mjs, firmware/host/app/manifest.json, firmware/host/app/bundle-manifest.architecture.ts, firmware/package.json, .github/workflows/bundle.yml
Builds CoreS3 artifacts, validates required binaries and factory partition size, creates the bundle archive, and verifies configuration and outputs.
Web flashing target and guidance
web/flash/index.html, web/flash/manifest_esp32_m5stackchan_cores3.json, web/web-ui.test.mjs, firmware/docs/flashing-firmware-web.md, firmware/docs/flashing-firmware-web_ja.md
Adds the CoreS3 flashing target and manifest, validates UI wiring and offsets, and updates English and Japanese instructions.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant FirmwareWrapper
  participant DependencyPreparer
  participant BundleScript
  participant ModdableBuild
  participant WebFlashTool
  FirmwareWrapper->>DependencyPreparer: Prepare CoreS3 IDF dependencies
  DependencyPreparer-->>FirmwareWrapper: Return manifest path
  BundleScript->>ModdableBuild: Run mcbundle and mcconfig
  ModdableBuild-->>BundleScript: Produce firmware binaries
  BundleScript->>BundleScript: Validate binaries and factory partition capacity
  WebFlashTool->>BundleScript: Use CoreS3 firmware manifest and binaries
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and accurately highlights the main user-facing change: adding M5StackChan CoreS3 web flashing.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/m5stackchan-cores3-web-flash

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@meganetaaan
meganetaaan marked this pull request as ready for review July 14, 2026 17:35

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@firmware/package.json`:
- Line 37: Add a release note or changeset describing the user-visible firmware
and web changes, including the new M5StackChan CoreS3 target and removed M5Stack
Fire target, and classify the appropriate release impact such as minor. If the
repository does not require one for these changes, document the reason instead.

In `@firmware/scripts/firmware.mjs`:
- Around line 43-51: Update the prepareM5StackChanCoreS3IdfDependencies call in
the firmware build flow to derive mode from the active CLI/build configuration
instead of always using 'debug'. Map release and instrumented invocations to
their corresponding dependency directories while preserving debug as the default
when no mode is specified.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: cf3f74cd-ccf1-4c85-b006-825028974699

📥 Commits

Reviewing files that changed from the base of the PR and between 33630c3 and 52ca5b8.

📒 Files selected for processing (13)
  • .github/workflows/bundle.yml
  • firmware/docs/flashing-firmware-web.md
  • firmware/docs/flashing-firmware-web_ja.md
  • firmware/host/app/bundle-manifest.architecture.ts
  • firmware/host/app/manifest.json
  • firmware/package.json
  • firmware/scripts/bundle.mjs
  • firmware/scripts/firmware.mjs
  • firmware/scripts/lib/idf-dependencies.mjs
  • firmware/scripts/lib/idf-dependencies.test.mjs
  • web/flash/index.html
  • web/flash/manifest_esp32_m5stackchan_cores3.json
  • web/web-ui.test.mjs

Comment thread firmware/package.json
Comment thread firmware/scripts/firmware.mjs

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@firmware/scripts/firmware.mjs`:
- Around line 38-42: The requested release-impact classification, verification
details, and changeset/release note are PR metadata rather than code changes;
update the PR description to classify the impact as none, patch, minor, or
major, document tested targets, hardware-specific behavior, and reproduction or
verification steps, and add the repository’s required changeset or release note
for the firmware behavior affected by readOption, dryRun, or
readBuildConfiguration.
- Around line 126-128: Update the mode-handling logic around the mode resolution
and debug argument construction to preserve an explicitly supplied specific
debug flag such as -dx, -dn, or -dl when mode is debug. Reuse that command-line
flag when present instead of always returning args: ['-d']; fall back to -d only
when no specific debug flag was provided.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8f1e56f0-05cc-4d23-8a2e-c08fd1e072bb

📥 Commits

Reviewing files that changed from the base of the PR and between 52ca5b8 and ef95695.

📒 Files selected for processing (4)
  • firmware/scripts/bundle.mjs
  • firmware/scripts/firmware.mjs
  • firmware/scripts/lib/idf-dependencies.mjs
  • firmware/scripts/lib/idf-dependencies.test.mjs
🚧 Files skipped from review as they are similar to previous changes (3)
  • firmware/scripts/lib/idf-dependencies.mjs
  • firmware/scripts/lib/idf-dependencies.test.mjs
  • firmware/scripts/bundle.mjs

Comment thread firmware/scripts/firmware.mjs
Comment thread firmware/scripts/firmware.mjs Outdated
@meganetaaan

Copy link
Copy Markdown
Collaborator Author

@coderabbitai run pre-merge checks

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Running Pre-merge checks. Results will be posted in the summary comment once complete.

@meganetaaan

Copy link
Copy Markdown
Collaborator Author

@coderabbitai run pre-merge checks

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Running Pre-merge checks. Results will be posted in the summary comment once complete.

@meganetaaan

Copy link
Copy Markdown
Collaborator Author

@coderabbitai ignore pre-merge checks

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor
ℹ️ Actions performed

Pre-merge checks override executed successfully.

Overridden by @meganetaaan via command on 2026-07-14T18:11:40.022Z.

Approval outcome: Approval skipped: request-changes workflow disabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant