Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider adding Keychron K* keyboards #7370

Closed
mdreizin opened this issue Nov 15, 2019 · 149 comments
Closed

Consider adding Keychron K* keyboards #7370

mdreizin opened this issue Nov 15, 2019 · 149 comments

Comments

@mdreizin
Copy link

I am a user of Keychron K2 keyboard I only know that it uses ARM M0 MCU. I am not an expert and it would be nice to know if it is possible to create QMK-based firmware for this keyboard or not?

@yanfali
Copy link
Contributor

yanfali commented Nov 15, 2019

@mdreizin someone will need to do some reverse engineering and figure out the vendor and bootloader.

@mdreizin
Copy link
Author

@yanfali Do you know what questions should I ask Keychron (about vendor/hardware/etc)?

I will try to send them directly (or their user group) and they would happy to answer/provide bootloader and other stuff.

@mdreizin
Copy link
Author

@yanfali I am looking forward to getting your reply 😀

@rexkyng
Copy link

rexkyng commented Nov 17, 2019

Communication protocol in Chinese for keychron keyboards, released on the fb group.
Hope this helps.

@jkramarz
Copy link

@yanfali, according to flashing tool in firmware upgrade package, it is using Cortex M0 Sonix SN32F260. On the other side, chips inside (at last in white-LED version) are HFD48KP500 and CYW20730.

Flashing tool and firmware files can be found at https://drive.google.com/file/d/1F49mMZpGny9VWB-MmuwtZYJL-Soxhzc4/view?usp=sharing .

@yanfali
Copy link
Contributor

yanfali commented Nov 18, 2019

So the issue will be this isn't supported by any of the HAL layers we use. Currently ChiBIOS and ATSAM for ARM platforms. Therefore this is going to be a lot of work to add support for. You're going to have to find someone with the hardware willing to do the work of porting and supporting this chip. That's about all the assistance I can offer at this time.

@VirtualValence
Copy link

You're going to have to find someone with the hardware willing to do the work of porting and supporting this chip.

Not knowing anything about ARM programming and the like, would you say it would probably take less effort to desolder the current ARM chip and put in a compatible one vs the reverse engineering of the current one?

@noroadsleft
Copy link
Member

noroadsleft commented Nov 18, 2019

So the issue will be this isn't supported by any of the HAL layers we use. Currently ChiBIOS and ATSAM for ARM platforms. Therefore this is going to be a lot of work to add support for. You're going to have to find someone with the hardware willing to do the work of porting and supporting this chip. That's about all the assistance I can offer at this time.

Actually, some of the CannonKeys boards (among others) run Cortex M0 chips currently, so I'm fairly sure ChibiOS could run this (supporting the chip being the barrier to entry, rather than the architecture).

@zvecr
Copy link
Member

zvecr commented Nov 18, 2019

When it comes to ChibiOS, its less about the M0 part and more if there is a hardware port for it. A quick search for sonix support doesn't show much hope, and I would guess ending up something like qmk/ChibiOS-Contrib/pull/10.

@smplman
Copy link

smplman commented Dec 14, 2019

Not sure if this is off topic, but I’ve been looking into porting ChibiOS to the SN32F248B and it is possible that some of the work will carry over. I’m able to upload firmware and get into recovery mode. I would like to enable SWD on the current firmware to allow me to step through the code. Here is my progress so far.

https://github.com/smp4488/dk63

@xyzz
Copy link
Contributor

xyzz commented Dec 14, 2019

Did you ever get the st-link (clone?) working with it? I see there are configs for rpi and stlink, but I guess only the rpi one ended up working since that's what all the pictures show?

@smplman
Copy link

smplman commented Dec 14, 2019

@xyzz I did, i need to update the readme. I couldn't get the windows st-link to connect, but it did get it working with openocd.

@xyzz
Copy link
Contributor

xyzz commented Dec 14, 2019

Would appreciate it, I have a keyboard with a similar chip and I couldn't get it working with blackmagic, haven't tried openocd though.

@smplman
Copy link

smplman commented Dec 14, 2019

Give OpenOCD a shot with the st-link config in my repo. Should work with Sonix and SMT32 MCUs

@xyzz
Copy link
Contributor

xyzz commented Dec 15, 2019

Thanks, I got it working with both blackmagic and openocd now. Are you able to read memory/flash from gdb?

@smplman
Copy link

smplman commented Dec 15, 2019

I can read memory past 0xFFF0000 but nothing below that while in debug recovery mode. I have the firmware and I’m trying to find the bits to enable SWD so I can read everything else.

@xyzz
Copy link
Contributor

xyzz commented Dec 15, 2019

I think this is a weird code protection function they use. Check the value of CS at 0x1FFF2000, it's probably going to be 0x5A5A (it was for me). Also, are you on discord? Can you add me, xyz#9668, so that we can iterate on it faster without having to spam the issue tracker.

@ByteWoofer
Copy link

New Keychron K4 RGB user here. Is there any assistance that I could provide to this issue? I am semi competent with hardware hacking and willing to take an Attify badge to the onboard flash and assist in analysis to the best of my abilities.

@smplman
Copy link

smplman commented Jan 29, 2020

Hello @ByteWoofer, thank you for wanting to offer your assistance. With the help of @xyzz we were able to get chibios running with limited USB. I’m working on flushing out GPIO right now. You probably want to identify your chip and start setting up board and config files for your keyboard.

Here are the repos we are currently working out of.

QMK - https://github.com/smp4488/qmk-ChibiOS/tree/dk63?files=1

ChibiOS - https://github.com/smp4488/qmk_firmware/tree/chibios-upgrade?files=1

@StrayChild01
Copy link

Hello @ByteWoofer, thank you for wanting to offer your assistance. With the help of @xyzz we were able to get chibios running with limited USB. I’m working on flushing out GPIO right now. You probably want to identify your chip and start setting up board and config files for your keyboard.

Here are the repos we are currently working out of.

QMK - https://github.com/smp4488/qmk-ChibiOS/tree/dk63?files=1

ChibiOS - https://github.com/smp4488/qmk_firmware/tree/chibios-upgrade?files=1

Hi Guys, another K2 user here. I stumbled on this issue and I remember that in facebook one of the core team members of keychron was actually asking what was needed to get the keyboard working with QMK. Maybe we can ask him to see if he can provide more information about the chips and the instruction set🤔

@kusayuzayushko
Copy link

Hello. Redragon K585 DITI user here. it has a VS11K16A on board.
Also looking for a way to reflash it with QMK or ChibiOS. Any info i can provide?

@fightforlife
Copy link

For someone googling this.
The Womier K66 is also using this chip. And wants to be ported to qmk :)

More info: https://www.reddit.com/r/olkb/comments/eqfa68/womier_k66_qmk_porting_possible_vs11k16avs12l03a/

@xyzz
Copy link
Contributor

xyzz commented Feb 4, 2020

Womier K66 is in fact one of the keyboards being working on in this branch at https://github.com/smp4488/qmk_firmware/tree/chibios-upgrade/keyboards/womier/k66

@ByteWoofer
Copy link

ByteWoofer commented Feb 4, 2020

Hello @ByteWoofer, thank you for wanting to offer your assistance. With the help of @xyzz we were able to get chibios running with limited USB. I’m working on flushing out GPIO right now. You probably want to identify your chip and start setting up board and config files for your keyboard.

Here are the repos we are currently working out of.

QMK - https://github.com/smp4488/qmk-ChibiOS/tree/dk63?files=1

ChibiOS - https://github.com/smp4488/qmk_firmware/tree/chibios-upgrade?files=1

Just finally got a moment away from work to open up the keyboard. The chips inside are as follows:
Chip 1
vlcsnap-2020-02-04-15h15m32s068
Chip 2
vlcsnap-2020-02-04-15h16m12s665
Chip 3
vlcsnap-2020-02-04-15h16m38s965
Chip 4
vlcsnap-2020-02-04-15h20m44s322

Whole board
20200204_152102~2

@smplman
Copy link

smplman commented Feb 5, 2020

@ByteWoofer so I started looking for the HFD2201KBA and came across this interesting tweet https://twitter.com/pmg/status/1119008876240596992?lang=en. Your chip looks to be a rebranded STM32 chip. Mine is rebranded Sonix chip. I would start trying to identify some pins on your MCU and compare to some STM32 variant data sheets to find a match.

You also appear to have a JTAG port on the bottom of the #2 picture. https://blog.senr.io/blog/jtag-explained

@fightforlife
Copy link

Womier K66 is in fact one of the keyboards being working on in this branch at https://github.com/smp4488/qmk_firmware/tree/chibios-upgrade/keyboards/womier/k66

How are you currently talking to the Womier K66? Did you find a way to use the USB Bootloader mentioned in the spec sheet.

@xyzz
Copy link
Contributor

xyzz commented Feb 9, 2020

For flashing we're using the built-in bootloader which isn't ideal but works well enough. Getting into the bootloader is possible by shorting the boot pin to ground or sending a special hid command to the stock firmware.

@alxsch
Copy link

alxsch commented May 5, 2021

Here is some extra info if this helps the issue.
I have an EP-84 watching dmesg i get:
... [ 97.724425] usb 1-1: new full-speed USB device number 5 using xhci_hcd [ 97.873934] usb 1-1: New USB device found, idVendor=05ac, idProduct=024f, bcdDevice= 1.00 [ 97.873944] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [ 97.873946] usb 1-1: Product: KEYCOOL Keyboard [ 97.873948] usb 1-1: Manufacturer: Keychron K1 [ 98.857574] usbcore: registered new device driver apple-mfi-fastcharge ...USB HID v1.11 Keyboard [Keychron K1 KEYCOOL Keyboard]...
I don't know if this is pertinent but they have a google drive link. Looks like its actually for the wireless one.

Also just found out they are building a qmk keyboard. Might that firmware trickle down to the older models?

@leifniem
Copy link

leifniem commented Jun 27, 2021

Sorry if i am misusing this thread for this question, but is there a major difference between the K6 RGB and white backlight version? I cannot even seem to find the pins needed to get the thing into bootloader mode. I do not even see a P3 block on the back of my PCB.

Picture for reference:

IMG_20210627_163808~2.jpg

@raqbit
Copy link

raqbit commented Jun 29, 2021

Sorry if i am misusing this thread for this question, but is there a major difference between the K6 RGB and white backlight version? I cannot even seem to find the pins needed to get the thing into bootloader mode. I do not even see a P3 block on the back of my PCB.

Picture for reference:

IMG_20210627_163808~2.jpg

Yes, most (all?) of the white-LED Keychron keyboards use a different chip and a PCB which doesn't have pads for the boot pin like the RGB models.
Please therefore do not try to install the firmware for the RGB version, as it won't work and you might even accidentally delete the chip's boot loader, in which case you will brick your keyboard. (Which can technically be fixed with SWD, but that's another can of worms)

@leifniem
Copy link

leifniem commented Jul 4, 2021

Sorry if i am misusing this thread for this question, but is there a major difference between the K6 RGB and white backlight version? I cannot even seem to find the pins needed to get the thing into bootloader mode. I do not even see a P3 block on the back of my PCB.
Picture for reference:
IMG_20210627_163808~2.jpg

Yes, most (all?) of the white-LED Keychron keyboards use a different chip and a PCB which doesn't have pads for the boot pin like the RGB models.
Please therefore do not try to install the firmware for the RGB version, as it won't work and you might even accidentally delete the chip's boot loader, in which case you will brick your keyboard. (Which can technically be fixed with SWD, but that's another can of worms)

Thanks for the info, i'd thought as much. Guess i'll sell that damn board one day when i finally have my KBD67 lite.

@bilogic
Copy link

bilogic commented Jul 10, 2021

Hi all,

Just curious

  1. I have a RK84 and KC84 and would love to be able to natively remap the keys
  2. Does wireless still work after using QMK?
  3. I have a proof of concept for Logitech's wireless protocol here at https://github.com/bilogic/logitech-unifying-device but it uses the NRF24, any idea if it can work here?

@dezdem
Copy link

dezdem commented Sep 30, 2021

Is it possible to improve scan rate of Keychron keyboard with custom firmware? Currently it's 125Hz, while cheap membrane keyboards have 1000Hz.

@carlosperezc
Copy link

Hi, does anyone knows how to put the K2 into bootloader mode? i only see 4 pins on the p3 port

976D5AF8-99AE-4033-A2AE-FA4C46703792

@dexter93
Copy link
Contributor

dexter93 commented Oct 5, 2021

Hi, does anyone knows how to put the K2 into bootloader mode? i only see 4 pins on the p3 port

976D5AF8-99AE-4033-A2AE-FA4C46703792

which k2 is this?

@carlosperezc
Copy link

Is the rgb version 1

@CalcProgrammer1
Copy link

image

Third pin from the dot in the corner.

@carlosperezc
Copy link

Must be connected to ground. right?

@carlosperezc
Copy link

worked like a charm. thanks.

@zelestis
Copy link

zelestis commented Oct 8, 2021

Is there a difference between the k4 v1's firmware and k4 v2's? Or can I just flash the QMK that was mentioned before

@carlosperezc
Copy link

I have the v1 and worked withourvproblem. I think it should work

@dexter93
Copy link
Contributor

dexter93 commented Oct 8, 2021

Is there a difference between the k4 v1's firmware and k4 v2's? Or can I just flash the QMK that was mentioned before

We have merged support for both K4v1 and v2 RGB here. The differences are minor, you can crossflash and only lose status indicators(caps and num lock led)

@RobertusIT
Copy link

I have a K6, can I remap keys?

@genebean
Copy link

Looks like a K2 Pro with qmk support is coming: https://twitter.com/keychronmk/status/1473213814896476165?s=21

@dexter93
Copy link
Contributor

Looks like a K2 Pro with qmk support is coming: https://twitter.com/keychronmk/status/1473213814896476165?s=21

The Pro series is probably stm32. However, we might be able to use some of that implementation for BT support.

As a status update on this topic, SonixQMK now has support for most K* RGB boards ( excluding the K1 and K10, someone would have to give us a hand there with their wiring) and recently added a bunch of White boards, as well as the C* lineup. Optical switches support is in and working, as is VIA. Bluetooth support is next on the todo list

@lwbt
Copy link

lwbt commented Dec 21, 2021

@dexter93 Sounds good but I'm not sure how to interpret that. I have a K3 RGB rev 1 (two of them actually). Decent electronics and soldering knowledge I could try to improve, if it's not a huge time sink. If there is any way I can help then please let me know.

@dexter93
Copy link
Contributor

@dexter93 Sounds good but I'm not sure how to interpret that. I have a K3 RGB rev 1 (two of them actually). Decent electronics and soldering knowledge I could try to improve, if it's not a huge time sink. If there is any way I can help then please let me know.

Feel free to join up the SonixQMK discord for further discussion on the project status.

@tzarc tzarc closed this as not planned Won't fix, can't repro, duplicate, stale Aug 29, 2022
@WillsterJohnson
Copy link

I feel like this should be reopened as while there may be QMK versions of the ANSI layout K* series keyboards, there is still no QMK support on the ISO layouts.

It seemed that by the end of 2021 some folks were getting pretty close to a usable implementation, and then this entire thread got dropped, seemingly because of a new keyboard release?
Not everyone uses ANSI, and certainly far fewer people can afford to drop a few hundred on a new keyboard exclusively for RGB customisation.

@martin-braun
Copy link

martin-braun commented Aug 13, 2023

I was considering to get the K3 Pro ISO, this issue is a bummer, I can't go with the default layout and I don't like software solutions, tbh.

@casuanoob
Copy link
Contributor

I was considering to get the K3 Pro ISO, this issue is a bummer, I can't go with the default layout and I don't like software solutions, tbh.

@martin-braun Keychron maintain support for the K3 Pro including the ISO variant in their own fork of QMK

@martin-braun
Copy link

martin-braun commented Sep 15, 2023

@casuanoob Thanks I'm good, I went with the K7 eventually and managed to configure it properly in VIA, because Keychron provides a layout file to import for it.

I really appreciate you for trying to help me. :)

@miguelgargallo
Copy link

I feel like this should be reopened as while there may be QMK versions of the ANSI layout K* series keyboards, there is still no QMK support on the ISO layouts.

It seemed that by the end of 2021 some folks were getting pretty close to a usable implementation, and then this entire thread got dropped, seemingly because of a new keyboard release? Not everyone uses ANSI, and certainly far fewer people can afford to drop a few hundred on a new keyboard exclusively for RGB customisation.

Hey do you achieve it?

@PeterMortensen
Copy link

I feel like this should be reopened as while there may be QMK versions of the ANSI layout K* series keyboards, there is still no QMK support on the ISO layouts.
It seemed that by the end of 2021 some folks were getting pretty close to a usable implementation, and then this entire thread got dropped, seemingly because of a new keyboard release? Not everyone uses ANSI, and certainly far fewer people can afford to drop a few hundred on a new keyboard exclusively for RGB customisation.

Hey do you achieve it?

It could be usual confusion between the K series and the K Pro series (two different things).

Was the K series actually reverse engineered and QMK support added? That seems unlikely.

@tzarc
Copy link
Member

tzarc commented Jan 12, 2024

Locking due to blurring of lines with old Sonix-based and current STM32-based boards, especially given that they're mainly implemented on the Keychron fork.

@qmk qmk locked as off-topic and limited conversation to collaborators Jan 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests