Guessed Pins, Black Screen: Bringing Up the Whisplay HAT
Our first driver guessed the display wiring and produced a black screen. The fix came from the vendor's own runtime, and the bring-up exposed three more traps: a GPIO library that fails on newer kernels, a different audio codec than documented, and a test that silently ran old code.

Key Architectural Takeaways
- Read the vendor's runtime for the real pinout instead of guessing; our guessed pins left the display black.
- Package the working tree when testing uncommitted changes: git archive only includes what is committed.
- Confirm the audio codec on the actual unit; ours was not the one the documentation assumed.
The challenge
The Whisplay HAT gives a Pi Zero a small colour screen, a speaker, microphones, an RGB LED and a button. We wrote the first version of the driver from memory and a quick read of the pinout. The first deploy produced a black screen.
What broke
The pins were wrong. Our assumed display wiring (data/command on one pin, reset and backlight on two others) did not match the board. The vendor ships a runtime that drives the HAT, so we read its source for the real map, verified against the hardware:
- Display data/command: GPIO 27. Reset: GPIO 4.
- Backlight: GPIO 22, active low.
- RGB LED channels: GPIO 25, 24 and 23, also active low.
- Button: GPIO 17 with an external pull-down, so it reads high while pressed.
- The panel is an ST7789 on SPI0 chip-select 0, 240 x 280, with inversion on and a 20-row offset.
An active-low backlight is a good example of why guessing fails: the screen was not dead, we were just driving the backlight the wrong way round.
The GPIO library stopped working. The common RPi.GPIO 0.7.1 fails edge detection on the 6.12 kernel for every user. The drop-in rpi-lgpio package fixes it. The button only worked after we swapped it in.
The audio codec was not the documented one. The docs and the vendor driver both mention a WM8960. Reading the unit's I2C bus showed an ES8389 at address 0x10. The vendor's own sound-card driver handles it and gives an ALSA card named whisplaysound. Before running the installer as root we read the whole script and reviewed it, noted that it edits config.txt and replaces the ALSA config, took a backup, and kept the vendor's uninstall script as the rollback path. Playback and 16 kHz capture were checked after a reboot.
The test that ran old code. To test uncommitted changes we shipped a git archive HEAD to the device. That archive contains only committed files, so the "new" driver was the old one. We only noticed because gpioinfo showed the old pins claimed. When you test a work in progress, package the working tree, or commit first.
One more quirk: the GPIO pins release when the process exits, so the backlight floats off the moment a test script ends. Ad-hoc test scripts have to hold the screen open.
Verification
Display and button were verified on the device. The button idles low, goes high while pressed, and registered three taps and a 3.4 second hold in the log.
Takeaway
For small boards, the vendor's runtime source is the datasheet. Read it, verify on the hardware, and treat every "it works the same as the other one" assumption, from the codec to the library to the test package, as unverified.
Some of what's described here is a design that hasn't been fully tested yet; those parts say so in the text.