Skip to content

Add M5Stack PaperDIY (K159 / K159-B) board - #462

Merged
bmorcelli merged 1 commit into
bmorcelli:mainfrom
juanmacuevas:add-m5stack-paper-diy
Oct 30, 2026
Merged

bmorcelli merged 1 commit into
bmorcelli:mainfrom
juanmacuevas:add-m5stack-paper-diy

Conversation

@juanmacuevas

@juanmacuevas juanmacuevas commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Adds the m5stack-paper-diy env for the M5Stack PaperDIY (K159 Assembly Kit / K159-B Complete Kit): ESP32-S3-WROOM-1-N16R8 (16 MB flash, 8 MB octal PSRAM), 4.7" 960x540 e-paper, M5PM1 PMIC, no touch, two side buttons.

What's in it

  • boards/m5stack-paper-diy/ (platformio.ini, interface.cpp, connections.md), following NEW_BOARD_GUIDE.md.
  • Based on the PaperS3 env: same M5GFX EPD bus and the same SD pins (CS 47, SCK 39, MISO 40, MOSI 38).
  • Navigation through the shared HAS_2_BUTTONS HAL (BUTTONS_IDF_COMPONENT): BtnA (G4) = Next / hold Sel, BtnB (G3) = Prev / hold Esc. LAUNCHER_GPIO_KEYS = A / B.
  • Battery, charging (CHG_STAT on M5PM1 GPIO3) and power-off through M5Unified's M5PM1 support. Requires M5Unified >= 0.2.28 / M5GFX >= 0.2.35 (first releases with board_M5PaperDIY autodetection).
  • Env added to default_envs (commented, like the others) and enabled in the CI matrix.

Build

pio run -e m5stack-paper-diy: OK, 96.6 % of the 0x180000 launcher partition (PaperS3: 96.4 %). The only warnings are the M5GFX ODR/LTO ones that the m5stack-paper-s3 env shows as well.

Tested on hardware (K159-B)

  • Boot, UI rendering full-screen in portrait
  • SD card mount, SD->USB, browsing
  • Installing an app .bin from SD and booting it
  • Navigation with the two buttons (click / hold)
  • Battery % and charging indicator (see note below)
  • Power off from the menu (M5PM1 cuts power; the e-paper keeps the last image, as expected)
  • WebUI: AP mode, Wi-Fi credentials set from the WebUI, then "my Network" connected

Open points for the maintainer

  • OTA_TAG reuses "paper" (same as PaperS3), so the online installer would list Paper-family firmware; happy to change it if a dedicated tag is preferred.
  • No M5Burner entry in support_files/m5burner_post.py (IDs are assigned on the M5Burner side).

New env m5stack-paper-diy for the M5Stack PaperDIY (ESP32-S3-WROOM-1-N16R8,
4.7" 960x540 e-paper, M5PM1 PMIC, no touch, two side buttons).

- Based on the PaperS3 env: same M5GFX EPD bus and SD pins (CS 47, SCK 39,
  MISO 40, MOSI 38).
- Navigation through the shared HAS_2_BUTTONS HAL (BUTTONS_IDF_COMPONENT):
  BtnA G4 = Next/Sel, BtnB G3 = Prev/Esc; LAUNCHER_GPIO_KEYS A/B.
- Battery, charging (CHG_STAT on M5PM1 GPIO3) and power-off via M5Unified's
  M5PM1 support (M5Unified >= 0.2.28, M5GFX >= 0.2.35).
- Env listed in platformio.ini default_envs (commented) and enabled in the
  CI matrix.
@juanmacuevas

Copy link
Copy Markdown
Contributor Author

Finished the hardware checks on a K159-B: navigation, SD, installing/booting an app from SD, battery/charging indicator, power off and WebUI (AP mode + my Network) all work.

Note on battery: while charging the gauge jumps to 100 %. M5PM1 has no fuel gauge, so M5Unified derives the level from VBAT ((mV - 3300) / (4150 - 3350)) and the charger's ~4.2 V CV phase reads as full. Same behaviour as other voltage-based boards, not specific to this port; it settles back after unplugging.

@bmorcelli
bmorcelli merged commit f3623c0 into bmorcelli:main Oct 30, 2026
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.

2 participants