Site Guide

Find your way around the Engineering Club.

Know what you need? Search for a component, concept or project.

Around the site

Start

Labs

TestingExperimental

Build

Club

LearnExperimental

Go a little deeper

Entry points to larger collections. Use Search for individual records.

Learning paths & reference

Inside PiCrawlerExperimental

Inside Inventory

E-Ink Hello World / Stage 2 of 3

Refresh contract

Distinguish layout storage from vendor transport encoding.

Host software model · physical driver still required

Download stage 2 host modelRead code & run steps ↓

What changes now?

Distinguish layout storage from vendor transport encoding.

Expected model result: The model explicitly states that it is not SPI output.

Builds on stage 1: Palette/memory model.

What you need

A computer with VS Code, PlatformIO and a working native C++ toolchain. No display hardware is needed for this model.

Connections / current hardware gate

This stage runs on your computer. Leave display hardware disconnected; the host model does not send data to the physical screen.

Use this complete project

Target: native · Environment: checkpoint2 · Stage branch: DISPLAY_STAGE=2

  1. Open the complete project. Download the stage ZIP, extract it and open the folder containing platformio.ini and src in VS Code. Keep its supporting headers and libraries together.
  2. Build stage 2. Select checkpoint2 in PlatformIO Project Tasks → General → Build, or use a PlatformIO terminal:
    pio run -e checkpoint2
    A successful Build compiles the program; it does not upload it or approve electrical connections.
  3. Run the host model. In Windows PowerShell, from the extracted project folder:
    .\.pio\build\checkpoint2\program.exe

    On Linux/macOS use .pio/build/checkpoint2/program. This needs a working native compiler/toolchain; it is not a microcontroller upload.

Complete source

The viewer starts at src/main.cpp. Use Source file for the board profile, PlatformIO configuration and supporting code. Keep the complete ZIP together.

workspaces/eink-hello-world/src/main.cpp

main.cpp
#include <array>
#include <iostream>
#include <cassert>
enum class Ink:unsigned {black=0,white=1,yellow=2,red=3};
int main(){ // abstract packing model, NOT a vendor transmission encoding
constexpr unsigned width=384,height=184;std::array<unsigned char,width*height/4> packed{};
packed[0]=static_cast<unsigned char>((unsigned(Ink::black)<<6)|(unsigned(Ink::white)<<4)|(unsigned(Ink::yellow)<<2)|unsigned(Ink::red));
assert(packed.size()==17664);assert(packed[0]==0x1b);
std::cout<<"abstract 2-bit palette model: "<<packed.size()<<" bytes; not hardware SPI data\n";
#if DISPLAY_STAGE >= 2
std::cout<<"Full refresh must use the exact 3.5-inch G vendor driver and BUSY contract.\n";
#endif
}
Source integrity · SHA-25689daf5aa3f27890127b1257d0f07721ddfcabcb3294b009a9fb0c2e92627125e

Raw downloads and standalone ZIPs retain the canonical bytes and supporting files. Copy follows the selected Comments setting.

Check the result

The model explicitly states that it is not SPI output.

Compare the program's output with the stated model result. It does not establish physical display behavior.

Original verification checklist
  1. Build the exact selected environment; distinguish dependency resolution from source compilation.
  2. Observe the stated output and record actual behavior; expected result is not an observed transcript.
  3. Test the named failure mode before proceeding.

Troubleshooting

Old image remains

Treat retention as expected physics, not evidence of a successful upload. Verify Serial, power, reset and BUSY with the matching driver.

Ghosting or color mismatch

Confirm exact G-model palette/driver and full-refresh procedure. Do not enable partial refresh based on another panel’s tutorial.

Port fails

Resolve the real vendor source path/version/license and driver-board revision first. Native model success is not an embedded build.

Technical explanation / original guide

Read the complete original stage guide

Original source/research wording is preserved. The stage's dated build evidence above supersedes earlier blanket compile-status wording; no physical results are implied.

Build it

Distinguish layout storage from vendor transport encoding.

Open workspaces/eink-hello-world in VS Code/PlatformIO. Select checkpoint2 and run pio run -e checkpoint2. This is SOFTWARE_MODEL_AUTHORED. Run .pio/build/checkpoint2/program after building; no hardware or upload is required.

Understand it

The authored native checkpoints exercise an abstract two-bit palette and its memory calculation. The byte codes are an original teaching representation, explicitly not the vendor’s transfer format or waveform. No guessed initialization commands, LUT, controller suffix or GxEPD2 constructor are supplied. The direct manufacturer manual fetch was blocked and the attempted legacy vendor header path was not found. The physical stage therefore remains PORT_REQUIRED, with a precise driver/board contract instead of a fake working sketch.

Expected result and verification

The model explicitly states that it is not SPI output.

This is software-only assertion/output evidence; it does not establish physical behavior.

Check the selected source branch and named failure conditions. Record actual build or software output separately from future physical observations.

Likely failures

Old image remains: Treat retention as expected physics, not evidence of a successful upload. Verify Serial, power, reset and BUSY with the matching driver.

Ghosting or color mismatch: Confirm exact G-model palette/driver and full-refresh procedure. Do not enable partial refresh based on another panel’s tutorial.

Port fails: Resolve the real vendor source path/version/license and driver-board revision first. Native model success is not an embedded build.

Build evidence, target and remaining verification

Original status: not applicable host model.

No successful build for this stage is recorded in the dated embedded compile ledger.

No compile was attempted in this pass under the user's testing limit. Upload and physical bench observation remain untested.

native@1.2.1 · native C++