Donglegon: USB Hexpansion host
Wouldn't it be nice* to plug any of those amazing hexpansions directly into your phone or laptop, perhaps for development or use outside of the field when you haven't got a badge handy?
Welcome to Donglegon. You can do anything with Donglegon. Well. Almost**.
Status: concept. Board designed and partially assembled, but not started on software.
* Insert hexpansions into your high-value devices at your own risk.
** It probably won't work on iOS, and at least this first iteration does not have the GPIO expander and LED driver so may not run all types of hexpansions, nor those relying on direct connection to ESP32 peripherals.
- Donglegon v1 BOM,
v1 MVP 2026-05-22, 1.6mm HASL yellow - donglegon-web (GitHub): beginnings of a library/web interface
- donglegon (GitHub, not yet published): KiCAD projects and (ch32fun) firmware code
Status summary
| Hardware (v1) | One working prototype, hand-assembled and 7 not-quite-working part assembled boards. |
|---|---|
| Firmware | Custom USB device working with WebUSB, can set GPIO pins and scan I2C addresses, but not reliably send or receive I2C data yet. |
| Software | Web interface (chromium only, requires WebUSB) can toggle GPIO pins on the device and detect I2C devices. |
Status updated 13 June 2026
Updates
July, 2026
There is one "working" prototype now! The power supply components arrived but were not that easy to solder (or it's just that USB connector, I'm not sure), so while I have a few more boards they are unfortunately broken in some way. I've not fitted the protection diodes (because it's a tiny package) or the inverting buffer (because I ordered the wrong package version of the part, and it can be bypassed with a jumper and handled in software).
I switched the processor back to the CH32V003, because it has more stable support in rv003usb than the CH32V006. There should just be enough memory even on the smaller chip.
For communication with the host I've settled on defining a custom device class and parsing the raw messages that can be sent and received using WebUSB. I didn't get the Serial/CDC device configuration working, and HID devices are not accessible through WebUSB because the operating system may use its own driver, so this seemed like the path of least resistance.
My communications protocol defines a binary format that can easily be parsed into a C struct, and can be serialised or deserialised in JavaScript with, currently, a lot of boilerplate code. The device puts incoming 8-byte USB messages into a ring buffer and scans that until it finds a preamble sequence of bytes, which is followed by a length field, the (escaped) data, and a CRC trailer. Each packet contains one operation, with an op code (like "i2c scan" or "gpio pin on") and an op-code specific data field (for addresses, pin numbers, etc.). The device uses the same format to respond, so it can overwrite the request data in its limited memory.
I built a small web interface with a few buttons and a status indicator using Vite and Svelte. This should be extendable to support different hexpansions once I've got the base functionality done. At some point it may be worth it to factor out the Donglegon library for others to integrate into their own apps, but for now it'll do. So far I can set the GPIO pin associated with the status LED on the Donglegon board, and detect the addresses of I2C devices on the hexpansion from Chrome on macOS and Android. I'd like to get I2C transfers working next so I can control my Matrix Hexpansion.
I'll be at EMF Camp 2026 and hope to get some feedback on the approach there, and see if there's appetite for a group PCBA order at some point.
June, 2026
The prototype boards arrived, and I've part-assembled a few of them (waiting for another parts delivery to be able to test the power supply -- currently it needs an external 3.3V source). I only had to configure the D+, D-, and DPU pins in a header file to make the rv003usb HID demo work. This only runs in desktop Chrome though as it uses the WebHID API to transfer data by advertising device capabilities. I've not tried the example for a Serial port yet. But perhaps WebHID means it could be a keyboard, mouse or gamepad? There was a suggestion on IRC that the Keebdexpansion should be converted to a USB keyboard.
Assembly by hand takes almost an hour, making PCBA services very appealing, but I'd need to sell maybe 15 of them to recoup the cost. Or I can provide kits/bare boards for the enthusiasts.
May, 2026
The quickly thrown-together board borrows heavily from the 2024 badge. For the first prototype I'm keeping it small and sticking to a single hexpansion connector (three would be nice for a future iteration), and skipping the I2C multiplexer, GPIO expander, and ESD protection diodes. I also don't expect to populate the inverter, current limiting switch for hexpansion power, and maybe not even the 3v3 regulator. There are individual jumpers and test pads to bypass these for initial development and testing.
It turns out the 20 pin CH32V003/006 has just enough pins to do I2C, enough GPIOs for one hexpansion connector, detecting and switching hexpansion power, a debug LED, and USB. The firmware will have to present as a low-speed USB serial port or HID (human interface device) in software (there is no USB peripheral on these low-end chips). It should accept commands from the host to read or write to I2C devices on the hexpansion and control the GPIO pins. It will probably lean heavily on rv003usb and its port of TinyUSB, although I've no experience with low level USB interfaces yet and haven't tried this at all. The MCU is very cheap and should just be powerful enough, but if it can't be made to work it may be easier to just add an ESP32 of some kind.
Ultimately I'd love to see this being connected to a simulator for the rest of the badge (perhaps eventually running in WebAssembly in web browsers). I'm sure that could be hacked to talk to an external API for I2C and GPIO interactions. I also imagine some hexpansion developers might like to make a web page that can communicate with their board without emulating the MicroPython app running on the actual badge.

