I spent two days blaming a booster circuit, two e-paper panels and an adapter board. The cause was a GPIO pin still owned by the JTAG block: esp-idf-hal returned Ok(()) for writes that never reached the pad.
I was trying an e-paper panel as the status display for a small RF device. The alternative was a cramped LED bar with a handful of blinking codes, for a device that has a lot to report. An e-paper panel shows words on the same power budget, and because it is bi-stable, keeping an image up costs nothing.
The panel is a Good Display GDEM0097T61, 0.97”, 184×88, SSD1680 controller, on their DESPI-C02 adapter. The target is an ESP32-C5.
I used Rust from the start, for fast test cycles off-target and predictable performance. It also holds up well under agentic coding, because the type system catches the class of mistake an LLM makes most often. The driver is a no_std crate over embedded-hal traits, with esp-idf-hal on the ESP side.
At first the panel showed nothing. Later it showed a mottled grey image and stayed that way.
I blamed the hardware for two days
In order, I convinced myself the problem was:
- SPI signal integrity. 4 MHz down to 500 kHz. No change.
- DMA. The 2024-byte framebuffer write dwarfs everything else on the bus. Off, then on. No change.
- The controller. A forum thread suggested this panel is a UC8175. I rewrote the driver against that command set. No change.
- The booster. The DESPI-C02 generates the ±18 V rails e-ink needs to move pixels. PREVGH measured 3.3 V on the multimeter, the input voltage, so the booster was not boosting. I took that reading as proof that the adapter was dead.
- The RESE switch. That adapter selects the booster’s feedback resistor: 0.47 Ω for GDEW panels, 2.2 Ω for GDEM. Mine was on 2.2, which is correct, so I concluded the switch contact was faulty.
- The panels. Two GDEMs, both dark. A different panel (GDEW0215T12, UC8151D) worked on the same rig, so I concluded both GDEMs were defective.
All of these were wrong, and I stated several of them with confidence.
The vendor’s own sketch ran on my panel
Good Display ships a dev kit with their own ESP32 board and an Arduino sample. Late in the process, I flashed their unmodified sketch on their MCU, with their adapter and my supposedly dead panel.
It ran the full demo. Logo, fast update, 4-grey image, a partial-refresh clock ticking to 00:05.
So the panel, the adapter, the booster and the switch all worked, and I had a known-good reference on the same wires. The test took ninety seconds.
Next I ran my Rust firmware on their board, with the same panel, adapter and pins. It hung waiting for BUSY to go idle. BUSY stayed high after one reset pulse, after eight, and after holding RES low for a full second.
The last result pointed at the reset line. Holding RES low and releasing it should have changed BUSY. Nothing changed, so the panel was not seeing the reset line move.
gpio_get_level() showed the reset pad stuck low
I stopped relying on the HAL and read the pad levels from the chip:
// gpio_get_level() reads the real pad state, not the value the HAL was asked to write.
let _ = epd.reset_low();
log::info!("RES low -> pad12={} pad13(busy)={}", lv(12), lv(13));
let _ = epd.reset_high();
log::info!("RES high -> pad12={} pad13(busy)={}", lv(12), lv(13));
RES low -> pad12=0 pad13(busy)=1
RES high -> pad12=0 pad13(busy)=1
With the reset pin driven high, the pad still read 0.
PinDriver::output(gpio12) and every set_high() returned Ok(()), but the pad never moved. The panel had been in hardware reset since first boot. That is why BUSY never cleared, why reset pulses did nothing, and why a software reset command was ignored: a chip in reset does not process commands.
On the classic ESP32, GPIO12 is MTDI: part of the JTAG block, and the flash-voltage strapping pin. It boots owned by that peripheral function. Arduino’s pinMode() releases that ownership. esp-idf-hal does not, and reports success anyway.
// Free the pad from JTAG/RTC ownership before PinDriver touches it.
rtc_gpio_deinit(12);
gpio_reset_pin(12);
gpio_set_direction(12, GPIO_MODE_OUTPUT);
After that, BUSY followed the reset line and init succeeded on the first attempt, but the screen stayed blank.
The reset line was not the only one. GPIO14 is MTMS, and the data/command pin was on it. It was also stuck low, so every byte went out as a command and none as pixel data. After the same three calls on GPIO14, the panel drew.
This also explains the multimeter reading. A controller held in reset never runs its charge pump, so PREVGH stayed at 3.3 V: a correct reading of a symptom two steps downstream of the fault. I read it as a dead booster and spent another day on the adapter.
The same fault on the ESP32-C5
Back on the C5, the same panel failed the same way. A comment I had left in the source said the C5’s pins were plain GPIO and needed no unlock.
On the ESP32-C5, GPIO2 is MTMS and GPIO3 is MTDI. The reset line was on GPIO3.
I made the same mistake on a second chip, because I assumed the pins were free instead of measuring them. The same three calls fixed it, and the test patterns cycled.
What I check now
Prove the pad moved. gpio_get_level() reads the pad state and takes a minute to wire up. It would have made the hardware hunt unnecessary.
Measure the control signal before its effects. A logic analyzer on RES, CS and BUSY would have shown a reset line that never toggled, in minutes. I did not have one on the bench, so I used the multimeter. A multimeter on a power rail shows an effect but not its cause. Without an analyzer, gpio_get_level() is a free substitute: it reads the same signal from inside the chip.
A Result reports what the API checks. Here Ok(()) meant that the register write executed. It said nothing about the voltage on the pad.
Know which pins are strapping or JTAG pins before wiring. Classic ESP32: GPIO12–15. C5: GPIO2/3 plus the boot straps. If a control line lands there, budget for an unlock or move the wire.
Cross-check against the vendor stack early. We did the C++ bring-up on the prescribed board late. Doing it first would have cleared the hardware before any measurements.
Good Display’s English documentation has gaps. The datasheet’s reference program is copied from a different 122×250 panel, and its BUSY-polarity note is inverted. Their hardware has been good to work with, and the bug was mine. If you use one of their panels, start from their Arduino sample code; it is more reliable than the datasheet.