I added my ESP32 board to Arduino, CircuitPython, Zephyr and PlatformIO. Each one found a different bug in my assumptions.

My Waveshare ESP32-S3 AMOLED board wasn’t supported by Arduino, CircuitPython, Zephyr or PlatformIO, so I added it to all four. Each one caught a different wrong assumption, from copied bugs to pins that weren’t really free.

esp32embeddedopensourcearduino

I build Ava, my desk gadget, on a Waveshare ESP32-S3-Touch-AMOLED-1.75C: a round 466x466 AMOLED, 32 MB of flash, 8 MB of octal PSRAM, a touch panel, a PMU, audio codecs and an IMU, all in a little metal puck.

When I went to use it outside my own firmware, I found that none of the big embedded platforms supported it. No Arduino board entry, no CircuitPython build, no Zephyr board, no PlatformIO definition. Its siblings (the 1.8", the 2.06", the 2.41") were all there. Mine wasn't.

So over two weeks I sent it to all four. Arduino and CircuitPython have merged it, Zephyr and PlatformIO are in review, and I found a few other bugs along the way. Every platform caught a different mistake in what I thought I knew about the board.

Arduino: "the pins are in the vendor's code" isn't enough

An Arduino board definition is mostly two things: a boards.txt entry (flash size, PSRAM type, partition menu) and a pins_arduino.h. I took the pins from Waveshare's ESP-IDF BSP and their Arduino examples, checked them against my board with a test sketch, and opened the PR.

The first surprise was that the 1.75 and the 1.75C are not the same board. Same screen, same chip, but different wiring:

1.75 1.75C
LCD reset GPIO39 GPIO1
Touch reset GPIO40 GPIO2
I2S MCLK GPIO42 GPIO16
microSD yes no

Even Waveshare's own 1.75 example lists MCLK as both 16 and 42. So that's two variants, not one.

The second surprise came from the automated reviewer. I'd built my entries by copying the closest existing board, and I copied its bugs too:

That last one changed how I work. Vendor example code tells you what the vendor used. Only the schematic tells you what's actually connected. I downloaded both schematics and picked the SPI defaults from the test pads on the back of the 1.75C, and from the SD slot's SPI wiring on the 1.75, so that SD.begin() works out of the box there.

The bug I found by scanning 400 boards

The custom_partitions mistake bothered me, so I wrote a short script that checked every board in boards.txt for the same pattern: a menu option pointing build.custom_partitions at a CSV that only exists in tools/partitions/.

It found six options on three other boards. I built each one and decoded the partition table baked into the firmware:

Board / option Before After
Geekble Nano "Max APP" two 1.25 MB app slots one 3.9 MB app
M5Stack CoreS3 "4 apps + factory" two 1.25 MB app slots 4 x 3 MB + factory
Waveshare S3-Zero "OTA no FS" two 1.25 MB app slots two 1.9 MB app slots

The IDE showed the bigger maximum size the whole time, so a large sketch would compile fine and then fail to boot. The fix was one word per line, and it was approved in about 20 minutes. Bugs like this are a good thing to look for: you don't need the hardware to prove them, just the build output.

CircuitPython: red instead of green

CircuitPython drives QSPI panels with a generic bus and a per-board init sequence, so the display part was mostly the CO5300's start-up commands. The first test drew a green square on my board, and it came out red.

White stayed white, though, and that was the clue. RGB565 green is 0x07E0. If the two bytes go out in the wrong order, the panel reads 0xE007: mostly red, no green. White (0xFFFF) is the same either way round. The CO5300 wants the high byte first, which is one flag on the display:

false,        // reverse_pixels_in_byte
true,         // reverse_bytes_in_word: the CO5300 takes RGB565 high byte first

CircuitPython also needs a unique USB PID per board. Waveshare had registered PIDs for the 1.75, but not for the 1.75C, so I requested one from Espressif's usb-pids registry. Halfway through, they switched from pull requests to an issue form. A day later, the 1.75C had 0x8413.

Zephyr: the screen was black for an embarrassing reason

Zephyr already had a driver for the CO5300, so I expected the board files to be quick. The display sample ran with no errors, said "Display starts", and the screen stayed black.

The driver's reset sequence looks like this:

gpio_pin_set_dt(&config->reset_gpios, 0);
k_msleep(CO5300_DELAY_MS);
gpio_pin_set_dt(&config->reset_gpios, 1);   /* "pull reset high" */

It treats logical 1 as releasing reset. I'd declared the pin the "normal" way for a reset line, GPIO_ACTIVE_LOW, so logical 1 drove it low, and the driver's last step held the panel in reset forever. The existing Zephyr shield that uses this panel declares it GPIO_ACTIVE_HIGH. One flag, and the screen came up with the right colours.

Then the reviewer asked for things I'd never have thought of, and two of them taught me something about my own board:

That PR is still in review, now on its second round.

What I'd tell someone doing this for their own board

All four PRs are linked from my GitHub profile. If you have an ESP32 board that's missing from one of these platforms, the board files are a very approachable first contribution. The maintainers were quick, specific and kind.

Also published on dev.to (opens in new tab), where you can leave a comment.

Get in touch Message on LinkedIn (opens in new tab)