E-paper display firmware for Nordic nRF52 microcontrollers with Bluetooth Low Energy (BLE) support. This firmware enables wireless image transfer, OTA updates, and flexible configuration for e-paper displays.
This project is part of the OpenDisplay ecosystem, providing open-source firmware and protocol standards for e-paper displays.
This is a fork of tsl0922/EPD-nRF5 for compatibility with the OpenDisplay protocol standard.
- Low Power Operation: Optimized for minimal power consumption with deep sleep support
- BLE Communication: Bluetooth Low Energy for wireless updates and configuration
- Config-driven displays: panels are driven from drive packets in the config (UC81xx and SSD16xx families)
- Direct Write Mode: Bufferless image transfer for efficient memory usage
- OTA Updates: Over-the-air firmware updates via BLE DFU
- Button Support: Interrupt-based button handling with press counting
- LED Control: RGB LED support with configurable flash patterns
- Battery Monitoring: Built-in battery voltage reading via ADC
- NFC: an I2C NFC tag chip (NXP NTAG I2C plus or TNB132M) set up by the config; NDEF read and write over BLE, field detect in the advertisement and as a wake source
- nRF52811 (primary target)
Firmware 3.0 has no built-in panel drivers. A panel is driven by the drive packets in its config
(0xB1 panel, 0xAE refresh mode), run by the shared OpenDisplay drive chain in od/.
The presets for this target live in Firmware_Unified, not here:
panels/nrf52811/presets.yamlis the source (drive steps, notes, 0xB0 palette units);panels/generated/drive_presets_nrf52811.jsonis generated from it bypanels/tools/gen_nrf52811.py, and every Firmware_Unified release carries it asdrive_presets_nrf52811.json;panels/nrf52811/README.mdsays what the presets are and how to add one.
Only presets checked on a real panel ship (status glass). Their ids are provisional
(0xE0xx / 0xE1xx).
host/tests/run.sh KEY checks that a preset's bus traffic on this firmware matches its replay.
It reads the presets from a Firmware_Unified checkout: set OD_UNIFIED=<checkout> (default: a
Firmware_Unified folder next to this repo) or OD_PRESETS=<file>.
- ARM GCC toolchain (arm-none-eabi-gcc)
- nRF Command Line Tools (for flashing and hex merging)
- nrfutil (for OTA package generation, optional)
See build-nrf52/README.md for detailed installation and build instructions.
cd build-nrf52
makeThis generates _build/EPD-nRF52.hex which can be flashed to the device.
To build a complete firmware package including bootloader and softdevice:
cd build-nrf52
make GENERATE_OTA=1This generates:
_build/EPD-nRF52-full.hex- Complete firmware_build/EPD-nRF52-ota.zip- Signed OTA package (only withGENERATE_OTA=1; needs nrfutil)_build/EPD-nRF52-settings.hex- Bootloader settings
The DFU signing key defaults to tools/priv.pem; KEY_FILE=/absolute/path overrides it. It must match the
bootloader's public key.
# Flash complete firmware
nrfjprog --eraseall
nrfjprog --program build-nrf52/_build/EPD-nRF52-full.hex
nrfjprog --resetThe firmware uses a TLV (Type-Length-Value) based configuration system that supports:
- System configuration (device name, manufacturer data)
- Display configuration (pin mapping, panel type, color scheme)
- LED configuration (pin mapping, flash patterns)
- Button configuration (pin mapping, debounce settings)
- Sensor configuration
- Data bus configuration
- NFC configuration (0x2A, on an I2C data bus)
- External flash (0x2B): the first enabled FlashConfig's MOSI/SCK/CS; the flash is sent the deep power-down command (0xB9) at boot, after every config write and before System OFF, and CS is held high
- Power options
Configuration can be written via BLE using the OpenDisplay protocol. See the OpenDisplay documentation for protocol details.
The firmware implements the OpenDisplay BLE protocol standard. Key commands include:
0x0040- Read configuration0x0041- Write configuration0x0042- Write configuration chunk0x0070- Direct write start0x0071- Direct write data0x0072- Direct write end0x0073- LED activate0x0043- Firmware version0x000F- Reboot0x0083- NFC endpoint: read or write the NDEF record (single or chunked)
0x0053 DEEP_SLEEP enters System OFF. Every configured button (0x25) wakes the tag at its pressed level, and so does the NFC field-detect pin. After such a wake:
- the boot screen is drawn, as after any start;
- the button that woke the tag (from the GPIO LATCH register, or still held) is advertised as its first press, so the host sees which button woke the tag.
glue/od_nrf_nfc.c, built unless make OD_CAP_NFC=0 (about 4 KB of flash).
- The first NFC config (0x2A) with flags bit0 set is used. Its
bus_instancenames an I2C data bus (0x24):pin_1SCL,pin_2SDA, andpin_3the chip's power pin whenpower_pinis 0xFF. Pins are GPIO numbers. nfc_ic_type0 (auto) probes an NXP NTAG I2C plus at address 0x55, and otherwise uses the TNB132M flow. 1 forces TNB132M, and 3 forces NTAG I2C plus (target-local value, not yet in the protocol header).- The chip is powered only for a session, waiting
power_on_delay_ms(default 40 ms). A session runs at boot, on every config write, and for each 0x0083 request. - On an NTAG, the NDEF TLV goes in user blocks 0x01 to 0x37, with block 1 written last. Block 0 (I2C address, lock and capability bytes) and the configuration and lock blocks are never written.
0x0083has the same sub-commands, statuses, NACK codes and check order as the other 3.0 targets. A read returns at most 218 bytes; a chunked write takes up to 512.- Field detect:
field_detect_mode1 polls the pin and 2 adds a pin interrupt. Each active edge increments a 7-bit counter, anddynamicreturndata[adv_button_byte_index]= state | counter << 1 is advertised at once.- The pull follows the active level: pull-up when active low.
- Before System OFF the pin is armed as a wake source.
- A phone switches its field on and off many times while it reads;
field_detect_debounce_ms255 counts about one tap per touch. A change held back by the debounce is taken on a later pass, not lost.
See the OpenDisplay protocol documentation for complete protocol specifications.
The firmware is optimized for low power operation:
- Idle current: ~35 µA (with EPD powered down)
- Active current: ~100 µA (during BLE operations)
- Display update: ~5-10 mA (during refresh)
EPD GPIO is automatically powered down when not in use to minimize idle consumption.
RTT logging is disabled by default to reduce code size and power consumption. To enable:
cd build-nrf52
make ENABLE_RTT=1The version is set once, in build-nrf52/Makefile (MAJOR_VERSION, MINOR_VERSION, PATCH_VERSION), and the
git short SHA of the tree is detected at build time (with -dirty for uncommitted changes). Both go into the
generated _build/od_nrf_build_id.h, which FIRMWARE_VERSION (0x0043) and the boot screen ("FW:N 3.0.0") read.
They can be overridden:
cd build-nrf52
make MAJOR_VERSION=3 MINOR_VERSION=1 PATCH_VERSION=2 SHA=abc1234This project is licensed under the GPL-3.0 license. See LICENSE for details.