Skip to content
Skills Library
Programming · Building & coding

m5stack-arduino-cli

/m5stack-arduino-cli

Set up, diagnose, flash, and support development for M5Stack boards with Arduino CLI on Windows. Use when Codex needs to install ESP32 board support, detect the correct COM port, explain why `arduino-cli board list` shows `Unknown`, attach a board/FQBN to a sketch, compile or upload to M5Stack devices such as M5Core2, prepare supporting libraries, add or update sample sketches, or troubleshoot CH9102/CP210x USB-serial behavior.

Licence
MIT
Last repository change
05.05.2026

Assessment and security

93/ 100Class: good
Format20 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene13 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
46
Scripts
8
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 05.05.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What to check before installing
  • 8 scripts in this package. Review them before installing, as Claude may execute them.
  • Paczka skrócona: część plików jest zbyt duża or wykonywalna. Pełny folder jest w repozytorium.

Scripts: docs/.vitepress/config.ts, scripts/common/arduino-cli-common.ps1, scripts/generate_sprite_animation.py, scripts/render_animation_header_apng.py, scripts/setup-m5core2.ps1, scripts/setup/m5core2.ps1, scripts/upload-m5core2.ps1, scripts/upload/sketch.ps1

What it does and when to use it

Set up, diagnose, flash, and support development for M5Stack boards with Arduino CLI on Windows. Use when Codex needs to install ESP32 board support, detect the correct COM port, explain why `arduino-cli board list` shows `Unknown`, attach a board/FQBN to a sketch, compile or upload to M5Stack devices such as M5Core2, prepare supporting libraries, add or update sample sketches, or troubleshoot CH9102/CP210x USB-serial behavior.

Original author description

Set up, diagnose, flash, and support development for M5Stack boards with Arduino CLI on Windows. Use when Codex needs to install ESP32 board support, detect the correct COM port, explain why `arduino-cli board list` shows `Unknown`, attach a board/FQBN to a sketch, compile or upload to M5Stack devices such as M5Core2, prepare supporting libraries, add or update sample sketches, or troubleshoot CH9102/CP210x USB-serial behavior.

How it works

  1. Follow this workflow
  2. Key rules
  3. M5Core2 defaults
  4. Reusable resources
  5. Canonical command examples
  6. Read references as needed
Original SKILL.md headings · 88 lines, 665 words
SKILL.md preview
---
name: m5stack-arduino-cli
description: Set up, diagnose, flash, and support development for M5Stack boards with Arduino CLI on Windows. Use when Codex needs to install ESP32 board support, detect the correct COM port, explain why `arduino-cli board list` shows `Unknown`, attach a board/FQBN to a sketch, compile or upload to M5Stack devices such as M5Core2, prepare supporting libraries, add or update sample sketches, or troubleshoot CH9102/CP210x USB-serial behavior.
---

# M5Stack Arduino CLI

Use this skill to work with M5Stack boards from Arduino CLI on Windows, especially when the board appears as `Unknown` in `arduino-cli board list`.

## Follow this workflow

1. Confirm that Windows sees the device as a serial port.
2. Confirm that `arduino-cli` exists. If it is not on `PATH`, look for the Arduino IDE bundled binary.
3. Ensure the ESP32 package index is configured and `esp32:esp32` is installed.
4. Identify the correct COM port with `arduino-cli board list`, Windows device info, and, if needed, `esptool`.
5. Treat `Unknown` as a board auto-detection limitation unless Windows or `esptool` also fails.
6. Install common M5 libraries when the sketch touches display, input, or device helpers.
7. Attach the intended FQBN and port to the sketch with `arduino-cli board attach`.
8. Compile and upload using the attached settings or explicit `--fqbn` and `-p`.
9. When the user needs a starting point, reuse the sample sketch and PowerShell helpers from this repository.
10. When supporting ongoing development, keep the workflow focused on reproducible CLI commands, attached board metadata, and concrete sketch paths.

## Key rules

- Do not assume `Unknown` means a missing driver.
- Prefer proving device health with Windows device status and `esptool` before changing drivers.
- For M5Core2 on Windows, expect the device to appear as a generic USB-serial bridge such as `CH9102` or `CP210x`.
- Explain the difference between port detection and board identification: Arduino CLI may know the COM port while still not knowing the exact board model.
- If upload already works, do not recommend random driver reinstalls.
- If a sketch folder does not exist, create a minimal one and attach the board there.
- Prefer using the bundled sample scripts before rewriting the same PowerShell every time.
- Prefer updating or cloning the included example sketch before inventing a brand-new starter from scratch.

## M5Core2 defaults

- FQBN: `esp32:esp32:m5stack_core2`
- Common USB bridge names:
  - `USB-Enhanced-SERIAL CH9102`
  - `Silicon Labs CP210x USB to UART Bridge`
- Common supporting libraries:
  - `M5GFX`
  - `M5Unified`

## Reusable resources

- Use [scripts/setup-m5core2.ps1](./scripts/setup-m5core2.ps1) to locate Arduino CLI, ensure ESP32 support is configured, install common libraries, and optionally attach a sketch to a board/port.
- Use [scripts/upload-m5core2.ps1](./scripts/upload-m5core2.ps1) to compile and upload a sketch with attached settings or an explicit board and port.
- Use [examples/m5core2/hello/hello.ino](./examples/m5core2/hello/hello.ino) as the default sample sketch for setup checks and first-flash validation.
- Use [scripts/generate_sprite_animation.py](./scripts/generate_sprite_animation.py) when a user wants to turn a transparent animated WebP into RGB565 frames and preview artifacts for M5Core2.
- Add future examples under `examples/<board>/<sample>/` and future board setup flows under `scripts/setup/`.

## Canonical command examples

Use these command shapes when writing guidance for users:

```powershell
$cli = "C:\Users\<User>\AppData\Local\Programs\Arduino IDE\resources\app\lib\backend\resources\arduino-cli.exe"

& $cli board attach -p COM11 -b esp32:esp32:m5stack_core2 .\examples\m5core2\hello
& $cli compile .\examples\m5core2\hello
& $cli upload -p COM11 .\examples\m5core2\hello
```

When you need explicit board selection on each command:

```powershell
& $cli compile --fqbn esp32:esp32:m5stack_core2 .\examples\m5core2\hello
& $cli upload -p COM11 --fqbn esp32:esp32:m5stack_core2 .\examples\m5core2\hello
```

When you want to show the helper-script path as well:

```powershell
.\scripts\setup-m5core2.ps1 -SketchPath .\examples\m5core2\hello -Port COM11
.\scripts\upload-m5core2.ps1 -SketchPath .\examples\m5core2\hello -Port COM11
```

When the user wants to build a cat or pet animation from an external animated WebP:

```powershell
uv run .\scripts\generate_sprite_animation.py --input 'D:\path\to\cat.webp' --output .\examples\m5core2\pixel_pet\generated_cat_animation.h --preview .\docs\public\examples\pixel_pet\generated_cat_animation_preview.png --sheet .\docs\public\examples\pixel_pet\generated_cat_animation_sheet.png --size 112 --frame-step 4 --sheet-columns 8 --loop-blend-frames 3
.\scripts\upload-m5core2.ps1 -SketchPath .\examples\m5core2\pixel_pet -Port COM11
```

Prefer this flow when the user already has rendered or background-removed animation frames and wants to keep the original motion instead of redrawing a hand-made sprite. The default loop blend makes the wrap from the last frame back to the first less abrupt.

## Read references as needed

- Read [references/windows-setup-and-diagnosis.md](./references/windows-setup-and-diagnosis.md) for the Windows and Arduino CLI workflow, command checklist, and explanation of `Unknown`.
- Read [references/m5-board-notes.md](./references/m5-board-notes.md) when you need board mappings, M5-specific package/library guidance, or a concise explanation of why M5 boards often stay `Unknown` in `board list`.
- Read [references/development-and-examples.md](./references/development-and-examples.md) when you need setup, flash, and development examples you can adapt quickly.
Files in this package (46)
  • .gitignore 1 KB
  • .markdownlint.json 1 KB
  • .markdownlintignore 1 KB
  • .yamllint.yml 1 KB
  • LICENSE 1 KB
  • README.ja.md 8 KB
  • README.md 11 KB
  • SKILL.md 6 KB
  • assets/m5stack-arduino-cli-icon.svg 1 KB
  • assets/release-notes-v0.1.0-header.svg 4 KB
  • docs/index.md 2 KB
  • docs/package-lock.json 86 KB
  • docs/package.json 1 KB
  • docs/.vitepress/config.ts 3 KB
  • docs/guide/development.md 5 KB
  • docs/guide/diagnosis.md 2 KB
  • docs/guide/quickstart.md 3 KB
  • docs/guide/structure.md 1 KB
  • docs/ja/index.md 2 KB
  • docs/ja/guide/development.md 5 KB
  • docs/ja/guide/diagnosis.md 2 KB
  • docs/ja/guide/quickstart.md 3 KB
  • docs/ja/guide/structure.md 1 KB
  • docs/public/icon.svg 1 KB
  • docs/public/examples/pixel_pet/generated_cat_animation_preview.png 84 KB
  • docs/public/examples/pixel_pet/generated_cat_animation_sheet.png 281 KB
  • docs/public/examples/pixel_pet/generated_happy_animation_preview.png 82 KB
  • docs/public/examples/pixel_pet/generated_happy_animation_sheet.png 368 KB
  • docs/public/examples/pixel_pet/generated_running_animation_preview.png 82 KB
  • docs/public/examples/pixel_pet/generated_running_animation_sheet.png 311 KB
  • examples/m5core2/hello/hello.ino 1 KB
  • examples/m5core2/hello/sketch.yaml 1 KB
  • examples/m5core2/pixel_pet/pixel_pet.ino 6 KB
  • examples/m5core2/pixel_pet/sketch.yaml 1 KB
  • examples/m5core2/sd_text_write/sd_text_write.ino 4 KB
  • examples/m5core2/sd_text_write/sketch.yaml 1 KB
  • references/development-and-examples.md 4 KB
  • references/m5-board-notes.md 1 KB
  • references/windows-setup-and-diagnosis.md 3 KB
  • scripts/generate_sprite_animation.py 7 KB
  • scripts/render_animation_header_apng.py 4 KB
  • scripts/setup-m5core2.ps1 1 KB
  • scripts/upload-m5core2.ps1 1 KB
  • scripts/common/arduino-cli-common.ps1 1 KB
  • scripts/setup/m5core2.ps1 1 KB
  • scripts/upload/sketch.ps1 1 KB

Omitted from the package: 5 (too large or executable); available in the repository.

Versions

The database has no other skills named m5stack-arduino-cli.

Database snapshot: 13.11.2026 · package version a68e9e7456cb (SHA-256 digest of the entire package)

Downloads in the last 30 days: 4 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100arduino-cli-skill
    Use when users need Arduino CLI commands for board discovery, library installation, compilation, upload, or serial-port troubleshooting on Windows, macOS, or Linux. Use it as the CLI branch of a broader workflow when the project also involves Arduino IDE, PlatformIO, vendor…
  • 100arduino-developer
    Implement or fix Arduino sketches and libraries using the project-declared board, Arduino Core, version, and tooling. Use for Arduino IDE/CLI or configured PlatformIO work when invoking arduino-developer.
  • 90arduino-workflow-router
    Route Arduino and embedded-system requests across Arduino IDE, Arduino CLI, PlatformIO, and vendor-specific tools. Use when a request combines firmware, board constraints, electronics, power, networking, calibration, enclosure, upload, debugging, OTA, or maintenance, or when the…
  • 100esp32s3-bringup
    Use when an ESP32-S3 board (DevKitC-1, N16R8 modules, any S3 dev board) is plugged in over USB and the user wants to find it, check whether it works, read its boot log, watch its serial output or Wi-Fi state, or flash a merged .bin (Arduino or ESP-IDF). Also read when esptool…
  • 90platformio
    Use when working in a PlatformIO project (platformio.ini present) or when asked to build, flash, monitor, test, or debug firmware for ESP32, Arduino, STM32, RP2040, or any board PlatformIO supports. Drives the platformio MCP tools in the right order and reads their results correctly.
  • 95deploy
    Build, test and deploy the robot software - flash the Arduino firmware and/or build the ROS 2 Humble workspace and bring up simulation or hardware. Use when the user asks to deploy, flash, upload, build the workspace, or run the robot.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.