Firmware for the FlexGPIO — a custom I2C GPIO expander built on a dedicated RP2040 microcontroller. FlexGPIO is designed to dramatically expand the I/O capabilities of CNC motion control boards (such as the FlexiHAL 2350) far beyond what traditional fixed-function GPIO expander ICs can offer.
Status: Pre-release / active development. See Releases for the latest pre-built firmware.
Traditional GPIO expander ICs (e.g. MCP23017) provide a fixed set of general-purpose digital I/O pins over I2C. FlexGPIO takes a different approach: by running firmware on a full RP2040 MCU, each "expanded" I/O point can be reconfigured in software to serve almost any function — standard digital I/O, PWM, analog output, NeoPixel data, or even additional step/direction stepper outputs.
FlexGPIO communicates with the host board (e.g. the FlexiHAL 2350's RP2350 main processor) over I2C and serves as a satellite co-processor for auxiliary I/O.
- I2C peripheral interface — communicates with the host motion controller over a standard I2C bus
- Software-defined I/O — each pin's function is determined by firmware, not fixed silicon
- Extensible architecture — the codebase is designed to be extended with new I/O modes:
- Additional digital inputs and outputs
- Analog / PWM outputs
- NeoPixel / addressable LED outputs
- Additional step/direction stepper motor outputs
- UF2 bootloader support — firmware updates are as simple as copying a
.uf2file to a USB drive; no programmer required - PlatformIO-based build — straightforward to compile and customise using the Arduino framework and the Earle Philhower RP2040 core
- grblHAL integration — works alongside the plugin_FlexGPIO grblHAL plugin for seamless CNC I/O expansion
FlexGPIO targets a generic RP2040 board and is primarily intended for use as the secondary MCU on the FlexiHAL 2350 CNC controller. On that board, an RP2040 sits alongside the main RP2350 processor solely to provide the expanded I/O subsystem.
The firmware is compiled for the RP2040 using the Arduino framework via PlatformIO.
- PlatformIO (CLI or the VS Code extension)
# Clone the repository
git clone https://github.com/Expatria-Technologies/FlexGPIO.git
cd FlexGPIO
# Build
pio run
# Build and upload via SWD/CMSIS-DAP
pio run --target uploadThe compiled .uf2 artifact will be found in .pio/build/pico/.
FlexGPIO supports the RP2040's built-in UF2 bootloader, making firmware updates easy without any special tools:
- Enter bootloader mode by holding the BOOT button on the FlexGPIO RP2040 while powering up the board, or while pulsing the RUN button.
- The board will enumerate as a USB mass-storage device named
RPI-RP2. - Copy the
.uf2firmware file to theRPI-RP2drive. - The board will automatically install the firmware and reboot.
Note: Some operating systems may show an error when the copy completes because the "disk" disappears without being ejected. This is expected behaviour and can be safely ignored.
| Repository | Description |
|---|---|
| FlexiHAL 2350 | The CNC controller board that hosts the FlexGPIO expander |
| plugin_FlexGPIO | grblHAL plugin that communicates with FlexGPIO over I2C |
Contributions are welcome! If you'd like to add a new I/O mode, fix a bug, or improve documentation, please open an issue or pull request.
The best way to support Expatria's open-source hardware designs is through the Expatria web shop.
FlexGPIO is released under the MIT License.
Canadian-designed open source hardware — for everyone.
