From 1bc154da8b3609c8230ecb860c41458192f73cda Mon Sep 17 00:00:00 2001 From: Justin Mitchell Date: Mon, 8 Jun 2026 14:18:08 -0400 Subject: [PATCH] swap SDK submodule from open-x4 to freeink + add m5paper_v11 env Adds driver support for the m5paper via the new freeink sdk --- .gitmodules | 7 ++--- freeink-sdk | 1 + open-x4-sdk | 1 - platformio.ini | 70 +++++++++++++++++++++++++++++++++++++++++--------- 4 files changed, 63 insertions(+), 16 deletions(-) create mode 160000 freeink-sdk delete mode 160000 open-x4-sdk diff --git a/.gitmodules b/.gitmodules index 80308f05..7c0ed75c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,4 @@ -[submodule "open-x4-sdk"] - path = open-x4-sdk - url = https://github.com/crosspoint-reader/community-sdk.git +[submodule "freeink-sdk"] + path = freeink-sdk + url = https://github.com/Free-Ink/freeink-sdk.git + branch = main diff --git a/freeink-sdk b/freeink-sdk new file mode 160000 index 00000000..fe50609e --- /dev/null +++ b/freeink-sdk @@ -0,0 +1 @@ +Subproject commit fe50609efcb6f1ae7743ab2369e1d209456d1d7c diff --git a/open-x4-sdk b/open-x4-sdk deleted file mode 160000 index 26648d64..00000000 --- a/open-x4-sdk +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 26648d643a1c883ab2f71e1869d05fe2a0c9d498 diff --git a/platformio.ini b/platformio.ini index f10b6215..21a63032 100644 --- a/platformio.ini +++ b/platformio.ini @@ -55,47 +55,93 @@ extra_scripts = pre:scripts/patch_jpegdec.py post:scripts/register_unit_tests_target.py -; Libraries +; Libraries — FreeInk SDK (git submodule at ./freeink-sdk). The left-hand names +; are the include paths the firmware already uses (, etc.); FreeInk's +; compat shim preserves them. BoardConfig + PowerManager are FreeInk-only and +; required (device profiles + the SoC-correct deep-sleep wakeup the HAL relies on). lib_deps = - BatteryMonitor=symlink://open-x4-sdk/libs/hardware/BatteryMonitor - InputManager=symlink://open-x4-sdk/libs/hardware/InputManager - EInkDisplay=symlink://open-x4-sdk/libs/display/EInkDisplay - SDCardManager=symlink://open-x4-sdk/libs/hardware/SDCardManager + BatteryMonitor=symlink://freeink-sdk/libs/hardware/BatteryMonitor + InputManager=symlink://freeink-sdk/libs/hardware/InputManager + EInkDisplay=symlink://freeink-sdk/libs/display/FreeInkDisplay + SDCardManager=symlink://freeink-sdk/libs/hardware/SDCardManager + BoardConfig=symlink://freeink-sdk/libs/hardware/BoardConfig + PowerManager=symlink://freeink-sdk/libs/hardware/PowerManager bblanchon/ArduinoJson @ 7.4.2 ricmoo/QRCode @ 0.0.1 bitbank2/PNGdec @ 1.1.6 https://github.com/bitbank2/JPEGDEC.git#86282979224c8a32fd51e091ed5a35b0c699a52b links2004/WebSockets @ 2.7.3 -[env:default] +; ESP32-C3 device set: X3 + X4 compiled into one binary, runtime-selected after +; the I2C fingerprint. FreeInk requires an explicit device selection, so the C3 +; envs extend this instead of [base] directly. (M5Paper is a different MCU family +; and selects its own device below.) +[c3] extends = base build_flags = ${base.build_flags} + -DFREEINK_DEVICE_X3=1 + -DFREEINK_DEVICE_X4=1 + +[env:default] +extends = c3 +build_flags = + ${c3.build_flags} ; CROSSPOINT_VERSION is set by scripts/git_branch.py (includes branch + short SHA) -DENABLE_SERIAL_LOG -DLOG_LEVEL=2 ; Set log level to debug for development builds [env:gh_release] -extends = base +extends = c3 build_flags = - ${base.build_flags} + ${c3.build_flags} -DCROSSPOINT_VERSION=\"${crosspoint.version}\" -DENABLE_SERIAL_LOG -DLOG_LEVEL=1 ; Set log level to info for release builds [env:gh_release_rc] -extends = base +extends = c3 build_flags = - ${base.build_flags} + ${c3.build_flags} -DCROSSPOINT_VERSION=\"${crosspoint.version}-rc+${sysenv.CROSSPOINT_RC_HASH}\" -DENABLE_SERIAL_LOG -DLOG_LEVEL=1 ; Set log level to info for release candidate builds [env:slim] -extends = base +extends = c3 build_flags = - ${base.build_flags} + ${c3.build_flags} -DCROSSPOINT_VERSION=\"${crosspoint.version}-slim\" ; serial output is disabled in slim builds to save space -UENABLE_SERIAL_LOG + +; --- M5Paper v1.1 (classic ESP32-D0WDQ6, 4.7" 540x960 / IT8951E) ------------- +; Different MCU family than the C3 base: override board/mcu/flash, disable the +; C3-only native-USB CDC (logs over UART0), and select the M5Paper device. +; pio run -e m5paper_v11 -t upload --upload-port /dev/tty.usbserial-XXXX +[env:m5paper_v11] +extends = base +board = esp32dev +board_build.mcu = esp32 +board_build.flash_mode = qio +; CP2104 bridge: 460800 is ~4x the 115200 fallback and reliable; drop if a flash +; stalls. (921600 usually works too.) +upload_speed = 460800 +build_flags = + ${base.build_flags} + -UARDUINO_USB_MODE + -UARDUINO_USB_CDC_ON_BOOT + -DBOARD_HAS_PSRAM + -DFREEINK_DEVICE_M5PAPER=1 + ; git_branch.py only injects CROSSPOINT_VERSION for the default env; set it here. + -DCROSSPOINT_VERSION=\"${crosspoint.version}-m5paper_v11\" + -DENABLE_SERIAL_LOG + -DLOG_LEVEL=2 + ; Touch + rotary: no physical button row, so hide on-screen button hints. + -DCROSSPOINT_SHOW_BUTTON_HINTS=0 + ; Archive-order workarounds for the classic-ESP32 link (see freeink-sdk + ; platformio.crosspoint.sample.ini): force Arduino startup + the I2C HAL members. + -Wl,.pio/build/m5paper_v11/FrameworkArduino/main.cpp.o + -Wl,-u,i2cInit + -Wl,-u,i2cSlaveInit