GP2040 is a gamepad firmware for the Raspberry Pi Pico and other boards based on the RP2040 microcontroller, and provides high performance with a rich feature set across multiple platforms. GP2040 is compatible with PC, MiSTer, Android, Raspberry Pi, Nintendo Switch, PS3 and PS4 (legacy controller support).
Full documentation can be found at https://feralai.github.io/GP2040.
- Selectable input modes (XInput, DirectInput and Nintendo Switch)
- Overclocked polling rate to 1000 Hz (1 ms) in all modes, with less than 1 ms of input latency
- Multiple SOCD cleaning modes - Neutral, Up Priority (a.k.a. Hitbox), Second Input Priority
- Left and Right stick emulation via D-pad inputs
- Per-button RGB LED support
- PWM and RGB player indicator LED support (XInput only)
- Saves options to internal memory
- Support for 128x64 monochrome I2C displays using SSD1306, SH1106 or SH1107 display drivers.
- Built-in configuration app hosted via embedded webserver...no downloading a separate app!
Take a look at the GP2040 Usage page for more details.
Prebuilt uf2
files are available in the Releases section for the following boards and controllers:
- Raspberry Pi Pico and other pin-compatible boards such as the Pimoroni Pico Lipo (wiring diagram)
- Pico Fighting Board
- Crush Counter (formerly the OSFRD)
- DURAL
Several other working example configurations are located in the configs folder.
The instructions will slightly vary based on your device. These instructions are for a Raspberry Pi Pico.
- Download the latest
GP2040.uf2
file from the Releases section for your board (e.g.GP2040-PiPico.uf2
for the Raspberry Pi Pico). - Unplug your Pico.
- Hold the BOOTSEL button on the Pico and plug into your computer. A new removable drive named
RPI-RP2
should appear in your file explorer. - Drag and drop the
GP2040.uf2
file into the removable drive. This will flash the board. - The board is now running the GP2040 firmware and will appear as a controller on your computer.
Input latency is tested using the methodology outlined at WydD's inputlag.science website, using the default 1000 Hz (1 ms) polling rate in the firmware.
Version | Mode | Poll Rate | Min | Max | Avg | Stdev | % on time | %1f skip | %2f skip |
---|---|---|---|---|---|---|---|---|---|
v0.3.1 | All | 1 ms | 0.56 ms | 1.32 ms | 0.85 ms | 0.24 ms | 95.95% | 4.05% | 0% |
Full results can be found in the GP2040 Firmware Latency Test Results Google Sheet.
If you would like to discuss features, issues or anything else related to GP2040 please create an issue or join the OpenStick GP2040 Discord channel.
- Ha Thach's excellent TinyUSB library examples
- fluffymadness's tinyusb-xinput sample
- Kevin Boone's blog post on using RP2040 flash memory as emulated EEPROM
- bitbank2 for the OneBitDisplay and BitBang_I2C libraries, which were ported for use with the Pico SDK