Install Firmware and Customize Settings
GP2040-CE is an open source gamepad firmware that's compatible with RetroPie, Mac/PC/Linux, PlayStation 3/4/5, Nintendo Switch/Switch 2, Xbox 360/One/Series, mini consoles, and others. It runs on a number of microcontrollers that use the RP2040/RP2305 chips, such as Pico, KB2040 Kee Boar, and more.
First you'll flash the KB2040 with the drag-and-drop .uf2 file and then customize settings within the web editor.
Download Firmware
From the GP2040-CE Downloads page, click the Download button for the KB2040 firmware.
This will save a file named GP2040-CE_0.7.12_KB2040.uf2 (or later) to your download location.
Firmware Installation
This page gives detailed instructions on installation, but the basic steps are:
- Plug the KB2040 into your computer with a known good data and power USB cable
- While holding the
BOOTSELbutton down, press and release theRESETbutton this puts the board into BOOTSEL/USB drive mode - A new removable drive named
RPI-RP2will appear on your computer - Drag-and-drop the GP2040-CE_0.7.12_KB2040.uf2 (or later) firmware .uf2 file onto the
RPI-RP2drive and wait for it to copy the file and reboot itself
Pin Mapping
The default pin mapping in GP2040-CE for the KB2040 is shown here. This will work well for almost all of the buttons and joystick input, but we want to make a few modifications so we can connect an OLED screen to the STEMMA QT port, NeoPixels to pin 7 (GP07) and a Function button to pin 6 (GP06), as shown below.
To make these changes we'll use the web configurator as shown next.
Button Test
This is a great time to test the controller to make sure basic button presses are working.
Plug the KB2040 into your computer with a known good USB-C data and power cable. Head to this gamepad tester in your browser to see the button presses.
You can now use a jumper wire to short any mapped GPIO pin to ground -- those button presses will register on the controller tester.
Web Configurator
Use a short wire to jumper KB2040 pin SCK/CLK (GP18) to a GND pin (see attached diagram for physical pin locations) and then press and release the RESET button. This puts the KB2040 into configuration mode. After a moment you can un-jumper the GPIO pin from ground.
This action has also caused the KB2040's GP2040-CE firmware to launch a web server you can access from your computer's web browser by visiting http://192.168.7.1
Pin Map
Let's add the Function button assignment to KB2040 GPIO pin 6. The Function button can be configured to help navigate the OLED menu and modify hotkeys.
Click the drop-down menu next to the GP6 pin and pick Function from the list.
Click the Save button at the bottom of the GPIO pin mapping window.
Reboot
Any time you want to leave Web-config mode and test your changes you can reboot the KB2040 into Controller mode.
Click the Reboot button at the upper right of the config page.
In the pop-up window that show up, click Controller to restart in controller mode.
Then, test out your changes. When you're ready to return to web-config, simply re-jumper the SCK/CLK pin to GND and press RESET button on the KB2040.
LED Configuration
Next, we can map the KB2040 pin 7 to be the NeoPixel data pin. Click the Configuration > LED Configuration menu item.
Then, set:
-
Data GPIO Pin to
7 -
LEDs Per Button to
2 -
Max Brightness to
100 -
Brightness Steps to
10
We'll pick the eight 30mm arcade buttons to light up in the RGB LED Button Order section by dragging them from the Available Buttons column to the Assigned Buttons column as shown below. You can reorder them by drag-dropping them vertically as well.
Peripheral Mapping
In order to use the OLED screen on the STEMMA QT port, we will need to set up I2C pin mapping. In GPIO Pin Mapping go to the GP12 and GP13 pins and delete the R3 and L3 assignments respectively by clicking the 'x' next to each, then click Save at the bottom.
Pick Configuration > Peripheral Mapping from the top menu.
Turn on the I2C0 selection switch and then map SDA as pin 12 and SCL as pin 13 as shown here. Then click Save at the bottom.
Notice if you go back to the GPIO Pin Mapping screen, GP12 and GP13 are now listed as "Assigned to addon".
Display Configuration
Now we can set up the OLED display. Click Configuration > Display Configuration.
Set Hardware Options to Enabled.
In Mode Options you can enable a splash screen (and even upload a custom 128x64 .png file if you want!), and turn on a display screen saver.
Hotkeys Settings
To use the Function button for menu navigation on the OLED screen, you'll need to set up some hotkeys. Click on Settings > Hotkey Settings in the main menu.
Add new Hotkeys for:
- Menu Up
- Menu Down
- Menu Left
- Menu Right
- Menu Select
- Menu Back
- Menu Toggle
You can do this by flipping the Fn switch and then picking a button to modify, then choose the action from the dropdown menu.
Hit Save when you're done.
Data Backup and Restoration
From the Configuration > Data Backup and Restoration menu you can save all settings as a .json file and restore settings.
Here is saved settings file for this project:
Page last edited March 04, 2026
Text editor powered by tinymce.