This guide will walk you through on installing QMK on a Keychron K6 RGB keyboard. Even though repos exist for C1, K4 and K8, this guide will only cover the K6 RGB model with a SN32F24x MCU.
There is a small chance that you may brick your keyboard in the flashing process, continue at your own risk. Use an appropriate cable, make sure you won’t lose power during flashing and follow the steps carefully.
This guide doesn’t cover bluetooth connectivity, following this guide will disable your keyboards bluetooth mode.
You’ll probably need an electronics screwdriver kit at this step. Disconnect your keyboard and keep it in “Cable” mode.
Refer to the official instructions for disassembly.
Note: You don’t need to remove all the keycaps, removing ESC, 1, 7, 8, Backspace, Light Key, CTRL, WIN , Space, Down Arrow, Right arrow keys will be enough to access the screws.
You can turn the keyboard over a soft surface to let the pcb drop or hold it with your hand as it detaches from the case.
The MCU is the chip with the red spot, read the serial numbers and google it to check it’s model, these steps are valid only if you have a SN32F24x MCU.
In our case, the serial number is HFD2201KBA.
If you have trouble finding the model of your MCU, you could skip to step 5 and follow until step 6.2 to see the model in Sonix Flasher.
2.1. Download the latest release (QMK_MSYS.exe) from this repo.
You can hit the windows key and type “QMK MSYS” to find the program
git clone https://github.com/SonixQMK/qmk_firmware.git
cd qmk_firmware
make git-submodule
util/qmk_install.sh
Note: You might need to run this twice if the QMK MSYS terminal is closed in the process.
Depending on your keyboard layout:
make keychron/k6:ansi
or
make keychron/k6:iso
%USERPROFILE%\qmk_firmware
Depending on your layout, copy “keychron_k6_ansi.bin” or “keychron_k6_iso.bin” file to a convenient place such as your desktop.
Note: If you experience random disconnections after using the WSL method, please try the QMK Msys method.
Hit the windows key and type "Microsoft Store", the app will show up.
You can hit the windows key and type Ubuntu to find the app.
You will be prompted to input a username and password when you run Ubuntu, input a username of your choice and a password when prompted. Don’t worry when the password you input doesn’t show on the line, just enter the password and hit enter.
Run the following command:
sudo apt update
Input your password when prompted.
sudo apt install make
git clone https://github.com/SonixQMK/qmk_firmware.git
cd qmk_firmware
make git-submodule
util/qmk_install.sh
Copy the following lines, step by step and then right click on Ubuntu terminal.
cd ~
pt install gcc-10 g++-10
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 --slave /usr/bin/g++ g++ /usr/bin/g++-10 --slave /usr/bin/gcov gcov /usr/bin/gcov-10
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 90 --slave /usr/bin/g++ g++ /usr/bin/g++-9 --slave /usr/bin/gcov gcov /usr/bin/gcov-9
sudo apt remove gcc-arm-none-eabi
wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/10-2020q4/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2
sudo tar xjf ./gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2 -C /usr/share/
sudo ln -sf /usr/share/gcc-arm-none-eabi-10-2020-q4-major/bin/arm-none-eabi-gcc /usr/bin/arm-none-eabi-gcc
sudo ln -sf /usr/share/gcc-arm-none-eabi-10-2020-q4-major/bin/arm-none-eabi-g++ /usr/bin/arm-none-eabi-g++
sudo ln -sf /usr/share/gcc-arm-none-eabi-10-2020-q4-major/bin/arm-none-eabi-gdb /usr/bin/arm-none-eabi-gdb
sudo ln -sf /usr/share/gcc-arm-none-eabi-10-2020-q4-major/bin/arm-none-eabi-size /usr/bin/arm-none-eabi-size
Change directory to qmk_firmware:
cd ~/qmk_firmware
Depending on your keyboard layout:
make keychron/k6:ansi
or
make keychron/k6:iso
\\wsl$\Ubuntu-20.04\home\<username>\qmk_firmware
The username field should be the ubuntu username you defined.
Depending on your layout, copy "keychron_k6_ansi.bin" or "keychron_k6_iso.bin" file to a convenient place such as your desktop.
See Step 1 for instructions.
Pull the connector gently to remove the cables attaching the battery to the board.
Using a conductor, such as a control pen or a tweezer, touch the two pins in the image below. While shorting the pins, plug in the keyboard.
6.2. If you have shorted the pins correctly, you will see your device in (bootloader) mode in the program.
6.4. This is the point of no return, click “Flash QMK…” and choose the .bin file you created. It will flash as soon as you choose the file.
QMK MSYS:
%USERPROFILE%\qmk_firmware\keyboards\keychron\k6\keymaps
WSL:
\\wsl$\Ubuntu-20.04\home\<username>\qmk_firmware\keyboards\keychron\k6\keymaps
7.3. Refer to this guide for instructions on how to edit the files inside here.
In Ubuntu, run the following commands in qmk_firmware directory:
git checkout -b sn32_openrgb_new
git pull origin sn32_openrgb_new
Download the latest stable version from the website. Unzip the archive.
"QMKOpenRGBDevices": {
"devices": [
{
"name": "Massdrop CTRL",
"usb_pid": "EED2",
"usb_vid": "04D8"
},
{
"name": "Massdrop ALT",
"usb_pid": "EED3",
"usb_vid": "04D8"
},
{
"name": "SonixQMK 0C45:5004",
"usb_pid": "5004",
"usb_vid": "0C45"
},
{
"name": "SonixQMK 0C45:5104",
"usb_pid": "5104",
"usb_vid": "0C45"
},
{
"name": "SonixQMK 05AC:024F",
"usb_pid": "024F",
"usb_vid": "05AC"
},
{
"name": "KBDFans K67 MKII RGB",
"usb_pid": "1225",
"usb_vid": "4B42"
}
]
},
In order to have OpenRGB run on startup with a selected profile, follow these instructions on the Official OpenRGB Wiki.
For disabling the breathing effect on system sleep, which may become persistent after wake, navigate to:
%USERPROFILE%\qmk_firmware\keyboards\keychron\k6
and edit the "rules.mk" file to have the following line:
SLEEP_LED_ENABLE = no
Since K6 doesn’t have a Caps Lock indicator, it might be useful to change the color of the key when it’s activated, as it is on the original firmware. Following steps will show you how to achieve such an effect.
Alternatively, you could clone this fork and switch to the sn32_openrgb_new branch, then examine the related files and make adjustments accordingly.
keyboards/keychron/k6/led_matrix.c
Find the following line:
LED_TYPE led_state[LED_MATRIX_ROWS * LED_MATRIX_COLS];
Add the following line after that:
LED_TYPE new_led_state[LED_MATRIX_ROWS * LED_MATRIX_COLS];
Find:
static void flush(void) {}
Replace with:
static void flush(void) {
for (int i = 0; i < LED_MATRIX_ROWS * LED_MATRIX_COLS; i++)
led_state[i] = new_led_state[i];
}
Find:
void set_color(int index, uint8_t r, uint8_t g, uint8_t b) {
int corrected_index = led_pos[index];
led_state[corrected_index].r = r;
led_state[corrected_index].g = g;
led_state[corrected_index].b = b;
}
Replace with:
void set_color(int index, uint8_t r, uint8_t g, uint8_t b) {
int corrected_index = led_pos[index];
new_led_state[corrected_index].r = r;
new_led_state[corrected_index].g = g;
new_led_state[corrected_index].b = b;
}
Open the following file in your qmk_firmware directory depending on your layout (ansi/iso):
keyboards/keychron/k6/keymaps/ansi/keymap.c
Add the following lines after the keymap array:
bool caps = false;
bool led_update_user(led_t led_state) {
caps = led_state.caps_lock;
return false;
}
void rgb_matrix_indicators_user(void) {
if (caps) {
// (Pin, R, G, B), check config_led.c for the pin number
rgb_matrix_set_color(30, 255, 0, 0);
}
}