Open-source e-reader firmware https://crosspointreader.com
  • C 51.8%
  • C++ 41.7%
  • Python 3.9%
  • HTML 2%
  • CMake 0.3%
  • Other 0.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Arthur Tazhitdinov a5340ea61b
chore: compile out the wolfSSL debug trace, save 39Kb (#4213)
## Problem
Arduino-wolfSSL's `user_settings.h` always defines `DEBUG_WOLFSSL`, so
every `WOLFSSL_MSG`/`WOLFSSL_ENTER`/`WOLFSSL_LEAVE` call and its string
is linked into the firmware. The trace only reaches the log when
`SecureClient` calls `wolfSSL_Debugging_ON()`, and it does that only in
`FREEINK_WOLFSSL_DEBUG` builds, which no env sets.

## Fix
`scripts/patch_wolfssl.py` adds to its existing overrides:

```c
#ifndef FREEINK_WOLFSSL_DEBUG
#undef DEBUG_WOLFSSL
#endif
```

A build with `-DFREEINK_WOLFSSL_DEBUG` keeps the trace. The flag must be
a global build flag (env `build_flags` or `PLATFORMIO_BUILD_FLAGS`) so
the wolfSSL sources see it as well as SecureNet.

Runtime behavior is unchanged. The firmware uses only
`wolfSSL_get_error()` codes. The error queue needs `OPENSSL_EXTRA`, the
debug allocator needs `WOLFSSL_ESPIDF` (undefined in `user_settings.h`),
and no struct layout depends on `DEBUG_WOLFSSL`. The patch reaches every
env, because the script runs from `[base]`.

Flash:
- gh_release: -38,896 B (wolfSSL code -13.6 KB, constant data and
strings -25.5 KB)
- sticky-gh_release: -34,448 B
- x4pro-gh_release: -34,896 B

## Testing
- gh_release, sticky-gh_release and x4pro-gh_release build without new
warnings. A gh_release build with
`PLATFORMIO_BUILD_FLAGS=-DFREEINK_WOLFSSL_DEBUG` builds and returns to
the old size.
- Linker map: the `WOLFSSL_ENTER`/`MSG`/`ERROR`/`LEAVE` and
`wolfssl_log` symbols are gone.
- X4 hardware, combined with the Wi-Fi trims (#4212): HTTPS update
check, BookOrbit OPDS feeds and an 814 KB book download, all over TLS
1.3, with no TLS errors.
- Not tested: a `FREEINK_WOLFSSL_DEBUG` build on hardware (it was only
compiled).

## Scope Check

CrossPoint is intentionally narrow. See
[SCOPE.md](../blob/master/SCOPE.md) and
[ROADMAP.md](../blob/master/ROADMAP.md).
Please confirm:

- [x] I have read SCOPE.md and ROADMAP.md.
- [x] This PR is **not** a new built-in theme (themes are temporarily
closed pending the move to SD-loaded themes).
- [x] This PR is **not** a new external network connector (sync engine,
cloud storage, remote file access, etc.).
- [x] This PR is **not** an interactive app, writing tool,
RSS/news/browser, media playback, or PDF feature.
- [x] The stock firmware does not already handle this well, **and** no
other popular CrossPoint fork already does
      (or, if one does, I explain why CrossPoint still needs it below).
- [x] If this PR touches `freeink-sdk/`, `lib/hal/`, the bootloader,
OTA, or recovery code, I have coordinated with
      the relevant maintainer.

---

### AI Usage

While CrossPoint doesn't have restrictions on AI tools in contributing,
please be transparent about their usage as it
helps set the right context for reviewers.

Did you use AI tools to help write this code? _**YES**_
2026-10-27 15:42:40 -04:00
.agents chore: yet more refinment of agents guidelines (#3951) 2026-10-11 13:57:34 +03:00
.githooks chore: git pre-commit hook for format fix (#1730) 2026-04-22 23:20:03 +03:00
.github chore(workflows): run check on push to develop branch (#4143) 2026-10-22 12:08:10 -04:00
bin fix: Add framebuffer release/realloc and improved lazy indexing (#2563) 2026-07-12 13:16:48 -04:00
docs feat: line spacing as a percentage of font size (#4174) 2026-10-28 01:51:04 +09:00
freeink-sdk@44427f8d51 fix: connect before adding plugin request headers (#4167) 2026-10-26 05:44:09 -04:00
lib feat: line spacing as a percentage of font size (#4174) 2026-10-28 01:51:04 +09:00
nix feat: Add packages to nix dev shell required for clang-format-fix and… (#2695) 2026-07-27 01:12:28 +03:00
scripts chore: compile out the wolfSSL debug trace, save 39Kb (#4213) 2026-10-27 15:42:40 -04:00
src feat: line spacing as a percentage of font size (#4174) 2026-10-28 01:51:04 +09:00
test feat: line spacing as a percentage of font size (#4174) 2026-10-28 01:51:04 +09:00
.clang-format Public release 2025-12-03 22:06:45 +11:00
.clangd Move to smart pointers and split out ParsedText class (#6) 2025-12-12 22:13:34 +11:00
.gitignore feat: SD card based plugin system (#3114) 2026-09-30 16:44:53 +00:00
.gitmodules chore: migrate from open-x4-sdk to freeink-sdk (#2449) 2026-06-27 21:22:58 +03:00
AGENTS.md chore: yet more refinment of agents guidelines (#3951) 2026-10-11 13:57:34 +03:00
CLAUDE.md fix: make the project agent guide a real AGENTS.md and relocate skills (#3058) 2026-08-16 00:14:28 +03:00
GOVERNANCE.md chore: Update license (#3578) 2026-09-16 18:05:08 +03:00
LICENSE chore: Update license (#3578) 2026-09-16 18:05:08 +03:00
partitions.csv Public release 2025-12-03 22:06:45 +11:00
partitions_picco.csv feat: Add support for BOOX Picco device (#3947) 2026-10-19 06:46:49 +00:00
platformio.ini perf: disable unused Expat input context (#4118) 2026-10-21 10:07:43 -04:00
README.md chore: Fix README.md missing bolds (#4087) 2026-10-19 20:26:46 +03:00
requirements.txt fix: missing requirement (#1896) 2026-05-09 11:37:09 -05:00
ROADMAP.md docs: make roadmap easier to scan (#3517) 2026-09-13 23:23:40 +03:00
SCOPE.md docs: clarify scope for reusable downstream primitives (#3821) 2026-10-15 09:06:39 +07:00
USER_GUIDE.md feat: line spacing as a percentage of font size (#4174) 2026-10-28 01:51:04 +09:00

CrossPoint Reader

Fund contributors

CrossPoint is open-source e-reader firmware - community-built, fully hackable, free forever. It's maintained by a growing community of developers and readers who believe your device should do what you want - not what a manufacturer decided for you.

Now running on:

  • ESP32C3-based Xteink X4 and X3.
  • ESP32S3-based Xteink X4Pro and X4Classic, Seeed reTerminal Sticky, M5PaperMono, Metalio E-Ink 4, EEGOREAD A4 and Boox Picco.

Check our Devices page for the full list.

CrossPoint Reader running on Xteink device

If you're planning to buy an Xteink device, consider purchasing an X3/X4 Developer Edition through https://crosspointreader.com. CrossPoint receives a small share of each sale, helping fund development costs.

What can CrossPoint do?

  • Reader engine: EPUB 2/3 rendering with embedded-style option, image handling, hyphenation, kerning, adaptive table layouts, native CJK ruby annotations, chapter navigation, footnotes, bookmarks, dictionary lookups (StarDict), go-to-percent, auto page turn, orientation control, focus reading, KOReader progress sync and more.

  • Various formats: native handling for .epub, .xtc/.xtch, .txt, and .bmp.

  • Touch reading: follow EPUB links and look up words in the dictionary on touch-enabled devices.

  • Highlights and clippings: highlight text in EPUBs and save excerpts as clippings. Use the reader menu on button devices, or hold a word and drag the selection handles on touch devices. Look up selected words or phrases in the dictionary. Enable Sync Clippings to sync saved excerpts through a compatible CrossPoint Sync server. See Clippings and Highlights.

  • Screenshots.

  • Custom fonts: install your favorite fonts on the SD card.

  • Tilt page turn (X3 and Sticky).

  • Bluetooth page turners: pair a remote under Settings → Connectivity → Bluetooth Page Turner. Map short and long presses to page turns, chapter navigation, the reader menu, or clipping selection.

  • USB Drive mode (X4Pro): access the SD card as USB mass storage.

  • Library workflow: indexed title/author search, recently-added and alphabetical views, multilingual grouping, folder browser, recent books, and SD-cache management.

  • Wireless workflows:

    • File transfer web UI
    • EPUB Optimizer
    • Web settings UI/API (edit many device settings from browser)
    • WebSocket fast uploads
    • WebDAV handler
    • AP mode (hotspot) and STA mode (join existing Wi-Fi), both with QR helpers
    • Calibre wireless connect flow
    • OPDS browser with saved servers (up to 8), search, pagination, and direct download
    • OTA update checks and installs from GitHub releases
  • Customization: night mode, multiple themes (Classic, Lyra, Lyra Extended, RoundedRaff), sleep screen modes including transparent overlays, front/side button remapping, status bar controls, power-button behavior, refresh cadence, and more.

  • Localization: 34 UI languages and counting, including CJK font fallback and RTL support.

  • SD card plugins: install plugins for book catalogs, downloads, and tools in the device's web interface. Enable Plugins under Settings → Connectivity to show them on Home. On-device plugins use existing firmware screens and operations. JavaScript runs in a browser on your phone or computer, and its page must stay open while it works. Plugins follow CrossPoint's reading-focused scope. See the plugin guide.

Coming soon:

  • More themes.

  • Much more! stay tuned.


USB-locked devices (Xteink Unlocker)

Some Xteink units purchased from third-party stores (e.g. AliExpress) ship with USB flashing locked from the factory. If your device is locked, you will need to use the Xteink Unlocker tool available at https://crosspointreader.com/#unlock-tool before you can flash CrossPoint.

You do not need this tool if you bought your device directly from xteink.com. Those units are not locked.

Not sure if your device is locked? Power it on, connect the USB-C cable, and try flashing via the web flasher first (see Install firmware below). If the browser's serial device picker does not show your device, try a different USB port or browser before assuming the device is locked. Only reach for the unlocker if the device still doesn't appear.

⚠️ WARNING: READ THIS BEFORE USING THE UNLOCKER ⚠️

The only officially supported firmwares in the unlock tool are CrossPoint and CrossInk.

Flashing any other firmware on a USB-locked device may permanently brick the device or leave it permanently stuck on that firmware with no recovery path. Once USB flashing is re-locked, your only way back is via OTA, and if the firmware you flashed doesn't support OTA, there is no way out.

Install firmware

  1. Connect your device to your computer via USB-C and wake/unlock the device
  2. Go to https://crosspointreader.com/#flash-tools, select your device (X3, X4, Xteink X4Pro, Seeed reTerminal Sticky, or M5PaperMono), and choose an official CrossPoint release.

Web installer (specific version)

  1. Connect your device to your computer via USB-C and wake/unlock the device
  2. Download the firmware file for your device from Releases, or compile yourself.
  3. Go to https://crosspointreader.com/#flash-tools, select your device, click "Custom .bin" and upload the firmware file.

Revert to Official Firmware

To revert to the official firmware, you can also flash the latest official firmware using https://crosspointreader.com/#flash-tools.

Command line

  1. Install esptool:
pip install esptool
  1. Download the firmware file for your device from the releases page.
  2. Connect your device via USB-C.
  3. Find the device port. On Linux, run dmesg after connecting. On macOS:
log stream --predicate 'subsystem == "com.apple.iokit"' --info
  1. Flash an X3 or X4:
esptool.py --chip esp32c3 --port /dev/ttyACM0 --baud 921600 write_flash 0x10000 /path/to/firmware.bin

Flash an Xteink X4Pro, Seeed reTerminal Sticky, or M5PaperMono:

esptool.py --chip esp32s3 --port /dev/ttyACM0 --baud 921600 write_flash 0x10000 /path/to/firmware.bin

Manual

See Development quick start below.


Custom SD-card fonts

On devices with external RAM enabled in CrossPoint, copy .ttf, .otf, or .ttc files to the SD card and select them as reader fonts. Put one file in /fonts/ or /.fonts/, or put one family's files in a subfolder. See the SD card font guide for the folder layout and styles.

On other devices, convert the font to .cpfont first. .cpfont files also work on devices with external RAM enabled and have better performance. No firmware reflash is needed to add fonts.

To make .cpfont files:

  1. Go to https://crosspointreader.com/fonts and open the "SD-card font builder" form.
  2. Upload up to four styles (regular, bold, italic, bold-italic), set the family name, point sizes, and Unicode range.
  3. Download the generated .cpfont files.
  4. Copy them to your SD card under /fonts/YourFont/ (or /.fonts/YourFont/ to hide the folder).
  5. Select the font on the device from the font settings.

Conversion runs the firmware repo's lib/EpdFont/scripts/fontconvert_sdcard.py script unmodified, so output matches a local host build.


Documentation


Development quick start

Prerequisites

Setup

git clone --recursive https://github.com/crosspoint-reader/crosspoint-reader
cd crosspoint-reader

# if cloned without --recursive:
git submodule update --init --recursive

Nix/NixOS

Nix/NixOS users can enter the development shell with either nix develop (flakes) or nix-shell:

nix develop -f nix
# or
nix-shell nix

To flash a connected ESP32-C3 device, enable PlatformIO's udev rules in your NixOS configuration:

services.udev.packages = with pkgs; [ platformio-core.udev ];

After rebuilding the system configuration, reconnect the device or reload udev rules.

Build / flash / monitor

pio run --target upload

Contributor pre-PR checks

./bin/clang-format-fix
pio check -e default
pio run -e default

Debugging

After flashing the new features, it’s recommended to capture detailed logs from the serial port.

First, make sure all required Python packages are installed:

python3 -m pip install pyserial colorama matplotlib

After that run the script:

# For Linux
# This was tested on Debian and should work on most Linux systems.
python3 scripts/debugging_monitor.py

# For macOS
python3 scripts/debugging_monitor.py /dev/cu.usbmodem2101

Minor adjustments may be required for Windows.


Internals

CrossPoint Reader is pretty aggressive about caching data down to the SD card to minimise RAM usage. The ESP32-C3 only has ~380KB of usable RAM, so we have to be careful. A lot of the decisions made in the design of the firmware were based on this constraint.

Data caching

The first time chapters of a book are loaded, they are cached to the SD card. Subsequent loads are served from the cache. This cache directory exists at .crosspoint on the SD card. The structure is as follows:

.crosspoint/
├── epub_<hash>/         # one directory per book, named by content hash
│   ├── progress.bin     # reading position (chapter, page, etc.)
│   ├── cover.bmp        # generated cover image
│   ├── book.bin         # metadata: title, author, spine, TOC
│   ├── css_rules.cache  # parsed CSS rule cache
│   ├── img_*            # rendered image cache files
│   └── sections/        # per-chapter layout cache
│       ├── 0.bin
│       ├── 1.bin
│       └── ...
├── settings.json        # device settings
├── state.json           # resume/runtime state
└── recent.json          # recent books list

Removing /.crosspoint clears all cached metadata and forces a full regeneration on next open. Book deletes, overwrites, and moves done through the firmware or web UI clear or re-key matching caches; manual SD-card edits may leave stale cache directories behind.

For more details on the internal file structures, see the file formats document.


Contributing

Contributions are welcome. If you're new to the codebase, start with the contributing docs. For things to work on, check the ideas discussion board — leave a comment before starting so we don't duplicate effort.

Everyone here is a volunteer, so please be respectful and patient. For governance and community expectations, see GOVERNANCE.md.


Community forks

One of the best things about open source is that anyone can take the code in a different direction. If you need something outside CrossPoint's scope, check out the community forks:

  • CrossInk — UX focused with minimal reading stats and broader customizations for the reading experience.

  • papyrix-reader — Adds FB2 and MD format support. Actively maintained with Arabic script support. Custom themes.

  • inx — Completely reimagines the user interface with tabbed navigation.

  • Witch(hunt) Reader — More faithful CSS styling and background work for slightly snappier interaction. Weather information panel. Markdown support.

Note: Many of these features will make their way into CrossPoint over time. Each project chooses its own priorities and tradeoffs.

Want to build your own device? Be sure to check out the Silkscreen project or OnePage Reader.


CrossPoint Reader is not affiliated with Xteink or any device manufacturer.