GMMK Pro + QMK + VIA + Custom RGB = Resolving STM32 DFU Device has NO DRIVER?
Posted: Reading Time:GMMK Background & Desired Features
I recently hurt my wrist, and needed to angle my keyboard to use it comfortably. I thought about purchasing the UHK v2, an ergonomic keyboard, but ultimately decided against it because I already paid a lot of money for the GMMK Pro.
While I was researching the UHK v2 though, I saw that it had a feature to use a virtual mouse by using a keys-as-a-mouse feature. You can enter a different “layer”, or configuring all your keys to do something different, to get to these keys. While in this layer, you could hit the “I” key and your mouse cursor would move up 5 pixels, and holding it down would continue to move it up until you let it go again. Same thing for “j”; hold it and the mouse goes to the left. Subsequently hitting “l” would make it go right, and “k” would make it go down. Sort of akin to what WASD is for video games, you could use IJKL for your mouse. Also hitting left shift acts as a left quick, while right shift acts as right click.
This really interested me because I am always looking for ways to make myself more efficient with my keyboard. I hate using the mouse as it interrupts my flow. Moving my right hand back and forth is annoying, but I also need to re-orient my right hand on the home row of the keyboard, which takes a second. Using this keys-as-a-mouse feature seemed like a game changer.
Here is where I ended up!
My fork for QMK can be found on my Github here! I left instructions on Github for how to flash a custom keymap.c file.
Bonus! I leverage an app called "Hyperkey", which turns my Capslock key into a "find on screen" search bar, where I can type anything in, it will search the screen, and then select it for me. This makes it easy to keep my hands on the keyboard and stay away from the mouse.
Glorious Core Software and it's shortcomings
Glorious has their own software you can use to manage lighting, performance, and keybinding. However their keybinding software doesn’t have the ability to use your mouse as the UHK Agent does, so that option was kind of out. No shade on Glorious, but the software is also kind of hard to use.
Enter QMK - Quantum Mechanical Keyboard
The Glorious Pro keyboard is fully compatible with QMK, or Quantum Mechanical Keyboard. An open-source suite for managing your mechanical keyboard. QMK allows this mouse movement, as well as a whole suite of other things like macros, functions, etc. This means that if you routinely use your keyboard on more than one computer, those features move with you through the keyboard’s firmware. You won’t need to install a text expander on every machine to get that benefit.
So you bricked your keyboard
Somehow in this process, I managed to brick my keyboard. I flashed it, which erased the original Glorious Core firmware, and left me with an unusable keyboard. I noticed I got this error when trying to revert back to the original Glorious Core software so I could at least use it again:
STM32 DFU device has NO DRIVER assigned but should be WinUSB. Flashing may not succeed
After some digging, I was able to reinstall the lost driver on my keyboard by following these steps:
- Download and install the Zadig utility from https://zadig.akeo.ie/
- Connect the STM32 device to your computer and put it into DFU (Device Firmware Upgrade) mode. This is usually done by pressing a specific button combination or connecting the device in a certain way while powering it on. Refer to the device's documentation for the exact method.
- Open Zadig and in the options menu, select "List All Devices".
- In the device list, find your STM32 device. It was listed as "STM32 Bootloader".
- With the device selected, choose "WinUSB" from the driver selection dropdown menu in Zadig.
- Click the "Reinstall Driver" or "Replace Driver" button to install the WinUSB driver for your STM32 device.
- If prompted, allow Zadig to install the driver. You may need to confirm through Windows security prompts
Flashing the GMMK Pro with your own Keymap
Now that your keyboard is in working order after you turned it into a brick, you can now flash it with your own QMK Keymap. There are a couple of important notes in here. If you plan on using Via or Vial, you need to flash your GMMK with QMK first. You can do this online using the configurator, however your board will not be picked up because you need to be able to set VIA_ENABLE = yes
and as far as I can tell, you can’t do this online.
Instead, you’ll need to set up your own QMK environment. The qmk_firmware official github repo has instructions for how to do that here. I recommend forking your own repo and connecting to that when running qmk setup
. If you attempt to run qmk setup
before you clone it down locally, the CLI will ask if you want it to do it for you. This is how up set it up on my machine:
Once this is successful, you can proceed to compile your own firmware. Before you do this though, let’s make sure that Via is enabled and can connect to the board.
Open gmmk/pro/rev1/ansi/default
in your text editor and add VIA_ENABLE = yes
. It’s important to note that it is VIA_ENABLE
and not VIA_ENABLED
, because I definitely didn’t burn 20 minutes running into that mistake.
Once that is all set, you are good to run qmk compile -kb gmmk/pro/rev1/ansi -km default
. This will compile the firmware that we’ll flash onto the board. Once that is done, it will output your firmware in the root directory of your repo that you cloned down.
Configuring Light Indicators
Now that you have QMK flashed on your GMMK Pro, and you have your own keymap set up, you may want to do some custom RGB lighting. For me, I wanted to change the lighting to show what layer I was in. To do this, we need to write our own `keymap.c file`.
Open up your `ansi/keymaps/default/keymap.c` file from your own repo. Add the following code to the bottom of the file:
You can of course customize this to do whatever you'd like! You can customize the loop to only affect certain keys, or only change an individual key.
My fork for QMK can be found on my Github here! I left instructions on Github for how to flash a custom keymap.c file.
Summary
All in all, I ran into a few different issues when trying to get my GMMK Pro set up with QMK and Via, but it was an overall rewarding experience, and I’m glad I did it. I learned a lot about firmware, flashing, keyboard layers, etc. I think it helps justify the price of what I originally spent on the GMMK Pro ($~300 or so). If you landed on this page from search looking for answers to the obscure issues I also ran into, I hope this was helpful. I am by no means an expert on this, but if you have any questions on anything that wasn’t covered in here, feel free to reach out!