Sourced from
docs/hardware/touch-tft.mdin the firmware repo.
Configuration A - Touch TFT (scrModel = tft)
Use this page when you are building or debugging the hand-built Solide S3 configuration: a 2.8" ILI9341 240×320 color TFT with an XPT2046 resistive touch controller. The display and touch controller share the board's SPI3 pads, and touch is the only input. It covers the pinout, the three on-module jumpers the build depends on, touch calibration, and the display and touch diagnostics.
For everything common to both boards - first flash, power, battery sensing, the shared peripherals (SD, LED ring, speaker, mic) - see the hardware reference. This page covers only the touch-TFT build.
Pinout
(Open diagrams/pinout-tft.svg for the full-size drawing.)
Assembly-critical: the three touch-to-display jumpers
The XPT2046 touch header is not wired to three additional ESP32 GPIOs. Solder three short jumpers on the TFT module so touch and display share the same SPI bus:
| Touch pad | Jumper to display pad | Shared ESP32 net |
|---|---|---|
T_CLK | SCK | GPIO 42 - SPI clock |
T_DIN | SDI | GPIO 41 - SPI MOSI |
T_DO | SDO | GPIO 1 - SPI MISO |
These are physical pad-to-pad connections on the module, not three more wires to
the DevKit. Connect T_CS separately to GPIO 48. Leave T_IRQ unconnected;
Nimbus polls the touch controller.
⚠ Construction/debug check: with all power disconnected, use continuity mode
to verify all three pairs above. The ESP32 bus wire may land on either pad in a
pair, but both pads must be electrically common. If the bus wires land on the
touch-side pads, missing bridges can leave the display completely blank. If
they land on the display-side pads, the display may draw while touch is dead and
shared-MISO diagnostics fail. Also verify T_CS→GPIO 48 and confirm that T_IRQ
has not accidentally been connected to GPIO 48.
Wiring
| ESP32 GPIO | Net | Module pins |
|---|---|---|
| 42 | SPI clock | SCK + T_CLK |
| 41 | SPI MOSI | SDI + T_DIN |
| 1 | SPI MISO | SDO + T_DO |
| 40 | display D/C | DC |
| 39 | display reset | RESET |
| 38 | display CS | CS |
| 48 | touch CS | T_CS |
| 2 | backlight (PWM) | LED |
| - | not connected | T_IRQ |
| 3V3 / GND | power | VCC / GND |
The three on-module bridges above make display and touch one SPI bus with two chip selects, which is what fits the whole panel into eight GPIOs: the seven-pin run on J3 (1, 2, 38-42) plus GPIO 48 for touch CS.
⚠ Reachable GPIOs are nearly all consumed. Only the J3 header is reachable on
the carrier, and GPIO 35/36/37 (OCTAL PSRAM) sit in the middle of it - so the longest
usable contiguous run is seven pins (1, 2, 42, 41, 40, 39, 38), all consumed by the
panel. The documented free spares (3/5/6/9) are all on J1, which the carrier does
not break out. On this variant GPIO 47 is the only genuinely free reachable pin.
⚠ The touch controller is slow. XPT2046 tops out near 2 MHz against the panel's 40 MHz, so each device gets its own SPI transaction settings. Getting this wrong does not fail loudly - it returns plausible-looking garbage coordinates.
⚠ The backlight is a continuous draw. It is on a PWM pin so the idle path blanks it rather than drawing a screensaver - on a TFT, drawing a screensaver costs more power than showing nothing.
⚠ panelBacklight is the requested duty, not proof of a lit glass. The
backlight LED is powered from the module's own VCC through an on-module low-side
switch driven by an active-high ~2.6 mA GPIO2 base drive, so the firmware only
ever sets and reads back the requested duty (panelBacklight); it has no pad
readback of the actual LED current. panelBlOk says the PWM attached, not that
the glass is lit. A genuinely lit screen is confirmed only by a human looking at
it or, for "is the controller even there", by the controller readback
(panelResponding / TFTHEALTH?). Likewise the boot line
[tft] colour touch panel up is an init-sent message printed after begin()
returned, not a readback of the live panel - it says the driver started, nothing
about the glass.
⚠ The microSD is not on this SPI bus. It uses dedicated SPI2 GPIOs
CS 10 · MOSI 11 · SCK 12 · MISO 13; TFT + touch use SPI3 above. The two
peripherals share only 3.3 V and ground. A hot SD card is nevertheless relevant
to a dead TFT because a miswired/shorted SD socket can collapse or damage that
common rail. Power down immediately and follow the
hot-card safety check; do not diagnose a hot
card by changing display settings.
Bring-up sketch (panel, colors, backlight, raw touch, decoupled from the firmware):
tftbringup is a bare panel diagnostic - color bars, a backlight fade, and
touch paint. It has no UI, no Wi-Fi, and no setup network. Normal setup never
needs it; flash it only to isolate a wiring or panel fault. To return to
Nimbus afterward, run python3 tools/setup_device.py (saved settings are
preserved). See Flash the firmware.
pio run -e tftbringup -t upload
What it looks like
Captured from the device with GET /api/screenshot - the bytes actually on the
glass (the dirty-gate snapshot, not a re-render), rendered by
python3 tools/tftpreview.py render:
| status (idle) | live sessions | settings | value editor |
|---|---|---|---|
The "live sessions" shot is a real nsn frame, encoded by the broker's own
reference encoder (notify/broker/frame.py in nimbus-notify) and fed through the
same decoder → mapper → attention-router path a broker's Bluetooth frame takes.
Each card carries the session title and harness from the v2 wire fields, and the
status pill takes its tone from statusStyle() - the same roles that color the
LED ring, so the screen and the ring cannot disagree.
That endpoint exists because every other check of this UI is indirect: host
goldens prove the rasterizer agrees with itself, and RENDER? only names the
screen. Neither can catch a panel showing the wrong thing. Three real layout
defects were found this way and fixed - a doubled chevron; a value clipped to
"Battery .."; a title clipped to "Settings .." (a breadcrumb is most specific at
its TAIL, so it is now trimmed head-first and "Brightness" survives); and legacy
text-cursor decorations ("[ 30 ]", "< Back", "< 30 >") leaking onto a panel that
has real buttons instead.
The value editor's [-] and [+] were driven on hardware: 30 -> 35 -> 40 -> 35.
Touch calibration
Every resistive panel reads slightly differently, so the raw-count-to-pixel mapping is measured per unit, not assumed. Until it is set, a wrong guess is indistinguishable from broken touch - taps simply land somewhere else.
First boot calibrates before anything else. A freshly flashed Touch TFT shows the four corner targets first, and they are the only thing the screen responds to until you finish, so uncalibrated taps can never drive the menus. Tap the four corners and it stores the result and continues to normal setup. To skip for now, press and hold anywhere for a few seconds (a short countdown confirms it); a stray tap never skips. You can redo or clear the calibration later using the options below. The all-in-one (Freenove CYD) is capacitive and reports pixel coordinates directly, so it skips this step.
On the device, no computer needed. Open Settings > Display > Calibrate touch and tap the four corner targets as they appear. The device derives the ranges and orientation, applies them right away, and stores them. This is the same measurement the wizard below does, driven from the panel itself. Clearing the calibration (Web: leave the Touch calibration field empty) restores the board's default orientation.
The wizard path, from a computer - press the four corners when prompted and it derives the ranges and the orientation flags, applies them, and then lets you tap around to confirm the pixel matches where you pressed:
python3 tools/tcal_wizard.py --port /dev/cu.usbserial-XXXX
It needs an [env:test]-family build (it drives the TOUCH?/TCAL console) and
takes --dry-run to print the calibration without storing it. Orientation is
measured, never assumed: a panel can be mounted in any of eight orientations, so
which raw axis carries screen X is decided by which one moves when only screen X
changes. tools/test_tcal_wizard.py round-trips all eight.
By hand, if you prefer:
- Run the bring-up sketch (or
TOUCH?on a[env:test]build) and note the raw values at each corner of the panel. - Store them as
minX,maxX,minY,maxY- optionally a fifth flags number (1 swap X/Y, 2 flip X, 4 flip Y; add them together):- Web: Settings → Display → Touch calibration
- Console:
TCAL 200,3900,240,3850,4(bareTCALprints the current value)
⚠ The ranges describe whichever raw axis ends up carrying screen X after the swap - the driver swaps first, then maps, then inverts - so the swap has to be settled before the numbers mean anything.
Both surfaces share one validator, applied immediately and persisted to NVS, so a calibration survives a restart and never needs a rebuild. Blank restores the driver defaults.
The white screen: what was ruled out, and what was not
Symptom: the display shows the UI and then goes blank white (sometimes white from boot) until a restart. The recovery is in place and tested (the watchdog below). The cause is not proven. The tables below record what has been measured so you do not repeat it.
Ruled out by measurement:
| Hypothesis | How it was tested | Result |
|---|---|---|
| Shared-MISO contention (panel SDO not releasing the line, the classic fault on these modules) | TOUCHISO? holds the panel in RESET so it must release MISO, then reads touch | Identical reading - not contention |
| Touch controller dead | TOUCH?'s z is z1-z2+4095, so a dead chip reads exactly 4095; this reads ~12 | Healthy, no-finger reading |
| Touch polling corrupting panel state | 184 hammered TOUCH? reads over 60 s vs a 60 s idle control | 0 heals either way |
| Concurrent SPI + Wi-Fi load | 389 × 150 KB /api/screenshot fetches (~58 MB) while rendering | 0 heals |
| Panel SPI clock / signal integrity | TFTHZ sweeps 64-pixel burst round-trips at 4/10/20/26/40 MHz; TFTFILL? pushes whole RGB frames through the real blit path and reads back the far corners | 0 mismatches at every clock, 40 MHz included - the pixel path is sound |
⚠ The clock test is only meaningful because it writes with writeBytes. An
earlier version looped transfer() per byte, which leaves gaps and never
produces the sustained burst a 153 KB blit does - it reported a clean 40 MHz
while that was precisely the thing under suspicion. Measure the path you ship.
⚠ TFTFILL? proves the panel stores pixels, not that it displays them.
Reading GRAM back is not the same as seeing the glass, and the two diverge in
exactly this fault. A passing fill test does not mean the screen works.
What the diagnostics report during a blank screen. Read them over HTTP: opening the console resets this board and clears the fault.
| Signal | Reads | Means |
|---|---|---|
panelTask | alive | the render task is running |
panelBusy | false | blits COMPLETE, not stalled |
panelResponding | true | the controller answers its RDDST status read and still holds the mode we wrote (healthy()); null on a shared-MISO board that cannot self-check, see below |
panelMeasured | false | the register/pixel probe is off (the shipped default) |
panelOk | null | not measured while the probe is off; a real bool only with it on |
panelBlOk | true | the backlight PWM genuinely attached |
panelBacklight | 100 | requested level (see panelBlOk - alone it can lie) |
panelPaint | climbing | the watchdog is repainting every 5 s |
| framebuffer | correct UI | via GET /api/screenshot |
panelPixOk | null | not measured while the probe is off; a real bool only with it on |
panelPixLost | 0 | times the pixels were ever found to disagree |
⚠ panelResponding is the one live signal that does not need the probe (on a
board that can self-check). It comes from a low-cadence readback of the driver's
RDDST-based healthy() (the same reliable status read TFTHEALTH? reports),
debounced over a ~2 s cadence, and is false when the controller is off the SPI
bus - a disconnected FPC, a
dead module, a collapsed rail - or has silently reset. It is not keyed on the
controller id (RDDID, TFTID?): a healthy Freenove / CYD panel reads RDDID
0x000000 while fully working, so an id-based verdict reported a working panel as
"not responding". RDDST mirrors the MADCTL we wrote and answers reliably across
ILI9341 variants, which is why healthy() reads it and this verdict follows it.
That is a different fault from the white screen this table describes: here the
controller still answers (panelResponding true) while the glass stays blank. A
false is the black-glass case, and the Display health row reports it as
"display not responding" without a serial open (which would reset the board and
erase the fault). panelOk / panelPixOk are null while the
probe is off, never a fabricated true: "not measured" must not read as "healthy".
⚠ On the classic solide_s3 board the live panel-liveness verdict is reported as
unknown, never as a false pass. The board shares its touch MISO with the panel,
and the periodic controller read that would detect a dead panel is the same read
that pins touch (see the next section), so it is switched off on this board and
the verdict is not maintained after boot. On a shared-MISO board panelResponding
reads null (not measured, like panelPixOk while the probe is off), scrok
reads unknown (never a false 1), and the Display (color touch) health
row shows unknown ("bound; cannot self-check on this board, look at the
screen"), not ok. A wrong-variant flash whose panel bind fails is still
caught (InitFailed -> scrok=0), as is a controller that reads as dead. On the
capacitive Freenove / CYD board nothing is shared, so the poll runs and the
verdict is a real true/false. The only thing that settles "unknown" is looking
at the glass.
⚠ The panel's display/power state is not observable. RDDPM (0x0A) reads
0x00 at every dummy width on this panel (it is not implemented), and rearm()
changes nothing in RDDST beyond the scan bit. Sleep, display-off and booster-off
are therefore indistinguishable from healthy, and the only detectable fault is a
full reset (which clears MADCTL).
That is why the watchdog re-arms unconditionally rather than gating on the health check: the fault it most needs to fix is the one it cannot see.
panelPixOk is the strongest of these signals: it reads pixels back out of the
panel's own memory and compares them against the frame that was pushed, so it
observes content rather than configuration. A panel can hold a perfect register
set and still have lost its image, and every other signal reports healthy in that
state.
To validate it, TFTFILL? writes RGB frames straight into GRAM behind the
framebuffer; panelPixLost increments and the watchdog repaints. ⚠ Check the
counter, not the flag: the repaint lands within ~5 s, so panelPixOk reads true
again almost immediately.
During a blank screen, then, the panel holds the correct image, is configured, and has a backlight that is being driven. Every firmware-observable layer is healthy. That leaves the panel module itself (its display/power path) or the physical connection. The cause is left open rather than written up as solved.
Field note (v3.9.0): the field "white screen" was traced to the device's SoftAP beacon - its continuous radio TX from the on-board antenna knocks a jumper-wired panel into sleep. Nimbus now drops the SoftAP once it is online (and runs Notifier mode radio-free), which removes the disturbance. The watchdog below remains the last-resort recovery for any residual panel reset.
Field instrument: TFTHEALTH? reports heals=. If the screen ever goes
white again, a non-zero and rising count says the panel is genuinely losing its
configuration and how often; a count that stays at zero means the fault is
somewhere else entirely. The watchdog bounds the visible symptom to ~5 s either
way, so a recurrence should now look like a brief flicker rather than a dead
screen.
Dead touch on v4.5.x
A distinct fault from the white screen above: on classic (solide_s3) boards flashed with v4.5.0, touch stops responding entirely while the display works. v4.4.6 on the same board is fine.
Mechanism. Tapping four corners plus center, raw reads came back the same on every sample: pressure present, but the X and Y position channels pinned near mid-scale (X ~2100, Y ~2100, z ~4237) no matter where the tap landed, so every touch mapped to screen center and nothing off-center could be hit. That is not a dead controller (a dead XPT2046 reads a flat 4095) and not a calibration error (position is never actually read): it is the shared MISO being held.
On solide_s3 the ILI9341 SDO and the XPT2046 T_DO are bridged onto one line, GPIO 1 (see the jumper table above). A panel register/pixel read drives the panel SDO onto that line; a module whose SDO does not cleanly tri-state afterward then contends the line the XPT2046 drives, and every touch channel settles near mid-scale. This is unit-dependent: a module that releases SDO cleanly reads the panel all day with no effect, so a given unit may never show the fault.
What changed in v4.5.0. v4.5.0 added a panel status read every ~2 s that
runs independently of rendering (pollControllerLiveness), so the shared MISO is
driven far more often than in v4.4.6, including at idle. It was validated on a
Freenove, whose capacitive touch is on a separate I2C bus and shares nothing with
the panel.
Fix. On any board with a resistive touch controller on a shared panel MISO, the firmware switches off that render-independent poll and keeps only the panel reads v4.4.6 already made. The gate is a board capability, so the Freenove / CYD board is unaffected and a future resistive board on a shared MISO is covered automatically.
The wrong-variant / black-glass guardrail on shared-MISO boards reports
"unknown", never a false pass. A wrong-variant flash whose panel bind fails is
caught in both directions: a Freenove image on Solide hardware and a Solide
image on Freenove hardware both fail begin() on the wrong pin map and emit
InitFailed -> scrok=0. What the shared-MISO board cannot detect on its own is
a panel that binds and is then dead, because the liveness poll is switched off to
protect touch. Rather than report a false scrok=1, the firmware reports that
state as unknown: the boot beacon prints PANEL scrok=unknown plus a line asking
you to look at the screen, panelResponding reads null, and the
Display (color touch) health row shows unknown. tools/setup_device.py treats scrok=unknown as a soft
caution ("look at the screen"), not a pass and not a failure, so a correct Solide
install still proceeds. On the capacitive Freenove the verdict is a real
true/false.
Finger-free diagnostics (test / test-cyd console builds only - they reset the
board on a serial open, so use a [env:test]-family image):
| Command | What it does |
|---|---|
TOUCHDIAG? [n] | Reads the XPT2046 single-ended channels that need no touch (TEMP0, TEMP1, VBAT, AUX) n times (default 50) through the same 2 MHz transaction path a touch read uses, and prints per-channel min/max/mean/stddev plus the count of all-zero and all-ones frames. A healthy link gives stable, distinct TEMP0 vs TEMP1; a contended MISO gives every channel pinned near one value, or all-zero / all-ones. |
PROBES ON|OFF|? | A/B the suspect pollers on one image. ON forces the panel liveness read, the content probe and the resistive touch-liveness poll back on (reproduces dead touch on a shared-MISO board); OFF silences them (the fixed baseline); ? reports sharedMiso / panelReadsGated / probe / fix4. |
BUSLOAD ON|OFF | Forces a full repaint every loop so TOUCHDIAG? can be run under worst-case shared-bus traffic. |
To run the A/B over serial on a solide_s3 test image:
- Run
PROBES OFF, thenTOUCHDIAG? 100, and note the channel stats. - Run
PROBES ONand repeat.
On a susceptible unit the channels collapse toward one value with reads on
(and TOUCH? raw X/Y pin near mid-scale), and are stable and distinct with reads
off. If both phases read clean, the panel on this unit releases MISO cleanly and
does not exhibit the fault. On a Freenove test-cyd image the two runs are
identical, since nothing is shared.