-
-
Notifications
You must be signed in to change notification settings - Fork 77
Description
Is your feature request related to a problem? Please describe.
The M5Stack PaperS3 is a neat target as it's an all-in-one, readily usable device (with built-in battery, sensors, etc.).
Unfortunately supporting it isn't straightforward. Please see details below.
Describe the solution you'd like
Adding support for the PaperS3. I've already began working on this on a private fork. This ticket is for tracking that progress.
Additional context
This device isn't straightforward to support, for a handful of reasons:
- No existing
esp_lcdcompatible driver. There's EPDiy and FastEPD, both of which support the e-ink display of the PaperS3, but they're not API compatible with theesp_lcdapproach thus a custom driver is needed. - LVGL will require custom configuration for e-ink targets (including custom themes to properly display elements), as well as a way to issue manual display update commands instead of relying on automatic refresh
- The hardware is mostly the same as the M5Stack CoreS3, so the same target, with some minor changes, should have the base system up and running (peripherals not included).
Hardware support status:
| Component name | Component model | Support status | Support |
|---|---|---|---|
| Display | EPD_ED047TC1 | ❌ | TBD through FastEPD or EPDiy |
| I2C Port 1 | Internal | ✅ | SCL: GPIO42 SDA: GPIO41 |
| I2C Port 2 | External | ✅ | SCL: GPIO1 SDA: GPIO2 |
| SPI | microSD | ✅ | MOSI: GPIO38 MISO: GPIO40 CLK: GPIO39 CS: GPIO47 |
| RTC (I2C1) | BM8563 | ✅ | ESPP or ESP-IDF-LIB support |
| IMU (I2C1) | Bosch BMI270 | ✅ | ESPP (other libraries exist but they're not as well maintained) |
| Touch (I2C1) | GT911 | ✅ | esp_lcd_touch and ESPP support, INT: GPIO48 |
| BMS | 🔶 | No component support needed, battery and charger status are connected to ADC pins | |
| Status LED | GPIO | ✅ | GPIO0 |
| Speaker | Buzzer | 🔶 | The PaperS3 has a very basic buzzer built in. |
Curiosities:
- The PaperS3 utilises an OTP 8bit MCU for managing power state. This sadly moves away the primary button handling from the ESP32 core (meaning there are no buttons exposed to the ESP32!). This MCU, a PMS150G, handles IRQ wake-ups from the IMU, the RTC, and the ESP32 ULP too, powering the rest of the system1
- The e-ink display is hooked up directly to the ESP32, instead of relying on a separate chip to handle waveform generation (e.g. over I2C or SPI). This is in stark contrast with the original M5Paper, which handled the e-ink display through an IT8951 SPI controller. The LVGL driver component will have to take these specifics into account
- The secondary I2C port is exposed on the back, but covered by the back sticker. Any user who wants to hook up I2C sensors, will need to expose the Grove port (the sticker is perforated but I do recommend using a scalpel or hobby knife)
- The PaperS3 supports forced power off via GPIO44 - this will completely shut down the ESP32 core (not deep or light sleep!), and will require user interaction with the power button to turn on the device again.
1 It is possible to make the side button a universal on-off button by adding an NVRAM flag named shouldBoot. Upon a successful system boot, this is to be set to false (0). Upon a reset (by pressing the power button), before any hardware is initialised, this flag should be checked, and if false, flip it to true (1), then commence the system shutdown via GPIO44. The next time the button is pressed, the system boots up, sees the boot flag as true, and continues the boot process as normal, flipping the value back to false. This functionality will, however, interfere with the button double-click power-off approach, but I believe this can be alleviated by also checking the reset reason of the MCU.