Author Topic: HFD2201KBA - Any details on this microcontroller?  (Read 8907 times)

0 Members and 1 Guest are viewing this topic.

Offline plastygroveTopic starter

  • Contributor
  • Posts: 39
HFD2201KBA - Any details on this microcontroller?
« on: November 08, 2018, 11:37:02 am »
I bought this keyboard from Aliexpress and it turns out that the firmware is absolutely horrendous for anything other than watching youtube and playing video games. I thought I'd take it apart and see if it has a familiar MCU that I can hack into and re-program.

It turns out that it uses a really unfamiliar microcontroller with the model number HFD2201KBA written on top in an LQFP64 form factor.

Googling for it turns up nothing. Baidu search at least found this page which has an image of the same microcontroller. It seems like a standard MCU for many such bluetooth + wired keyboards. Does anyone have an idea if this is programmable or is it some weird proprietary MCU made by an unknown Chinese company?
 

Offline technix

  • Super Contributor
  • ***
  • Posts: 3507
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
Re: HFD2201KBA - Any details on this microcontroller?
« Reply #1 on: November 08, 2018, 01:08:00 pm »
I couldn't find anything on Taobao either, feel like an OTP thing to me.

Bold idea: if the key mechanism and the MCU are on separate boards, you can ditch the USB/Bluetooth board and build your own replacement with something like a STM32F103R8T6. If you have the space you can even bake in an internal USB hub and an onboard ST-Link/V2-1 so you can reprogram the keyboard MCU later without taking it apart.
 

Offline plastygroveTopic starter

  • Contributor
  • Posts: 39
Re: HFD2201KBA - Any details on this microcontroller?
« Reply #2 on: November 08, 2018, 01:36:46 pm »
Bold idea: if the key mechanism and the MCU are on separate boards, you can ditch the USB/Bluetooth board and build your own replacement with something like a STM32F103R8T6. If you have the space you can even bake in an internal USB hub and an onboard ST-Link/V2-1 so you can reprogram the keyboard MCU later without taking it apart.

Hmm, that's a pretty cool idea. I know I have a few stm32F4s lying around somewhere. It's one single board however, might be a good project for tracing and seeing if I can drop in an stm32F4. I don't care about the bluetooth, but the board uses a USB type-c connector and I don't know if the stm32F4 supports that.

Another thing I was wondering was that maybe this chip is a clone of one of the more popular MCUs (AVR, PIC, ST etc). But a search for "2201 microcontroller" doesn't reveal anything.
« Last Edit: November 08, 2018, 01:39:26 pm by plastygrove »
 

Offline technix

  • Super Contributor
  • ***
  • Posts: 3507
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
Re: HFD2201KBA - Any details on this microcontroller?
« Reply #3 on: November 08, 2018, 02:02:26 pm »
Bold idea: if the key mechanism and the MCU are on separate boards, you can ditch the USB/Bluetooth board and build your own replacement with something like a STM32F103R8T6. If you have the space you can even bake in an internal USB hub and an onboard ST-Link/V2-1 so you can reprogram the keyboard MCU later without taking it apart.

Hmm, that's a pretty cool idea. I know I have a few stm32F4s lying around somewhere. It's one single board however, might be a good project for tracing and seeing if I can drop in an stm32F4. I don't care about the bluetooth, but the board uses a USB type-c connector and I don't know if the stm32F4 supports that.

Another thing I was wondering was that maybe this chip is a clone of one of the more popular MCUs (AVR, PIC, ST etc). But a search for "2201 microcontroller" doesn't reveal anything.
Technically you can remove the chip and add in your own board using flying leads.
 

Offline lucazader

  • Regular Contributor
  • *
  • Posts: 221
  • Country: au
Re: HFD2201KBA - Any details on this microcontroller?
« Reply #4 on: November 08, 2018, 06:46:09 pm »
Type-C doesn't change the actual data across the USB port.
You can do either USB FS or HS data throguh Type-C and that is fine.

You even only have to hook up one half of the D+ and D- lines (the type-C connector has two of each to help with the flipability of the connector) The host side is the one that deals with all of this!

As for all the power delivery and things like that for type-C, in this case as you just need standard 500mA usb power, you only need to put a specific pull down resistor on one of the CC lines. then you just need to hook up vbus and ground.
You can leave all of the rest of the pins like the SuperSpeed pins, SBU etc not connected
 

Offline plastygroveTopic starter

  • Contributor
  • Posts: 39
Re: HFD2201KBA - Any details on this microcontroller?
« Reply #5 on: November 09, 2018, 01:07:30 pm »
Type-C doesn't change the actual data across the USB port.
You can do either USB FS or HS data throguh Type-C and that is fine.

You even only have to hook up one half of the D+ and D- lines (the type-C connector has two of each to help with the flipability of the connector) The host side is the one that deals with all of this!

As for all the power delivery and things like that for type-C, in this case as you just need standard 500mA usb power, you only need to put a specific pull down resistor on one of the CC lines. then you just need to hook up vbus and ground.
You can leave all of the rest of the pins like the SuperSpeed pins, SBU etc not connected

That's very interesting, I am not very familiar with USB standards and this is good information to know. Thanks!
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14472
  • Country: fr
Re: HFD2201KBA - Any details on this microcontroller?
« Reply #6 on: November 09, 2018, 03:40:34 pm »
 

Offline joric

  • Contributor
  • Posts: 18
  • Country: us
Re: HFD2201KBA - Any details on this microcontroller?
« Reply #7 on: December 14, 2018, 07:34:34 pm »
Got more macros and
of this keyboard... THING. Maybe someone could tell if that HFD2201KBA is pin compatible to STM32. Full album https://imgur.com/a/roEZSB9
 

Offline tsman

  • Frequent Contributor
  • **
  • Posts: 599
  • Country: gb
Re: HFD2201KBA - Any details on this microcontroller?
« Reply #8 on: December 14, 2018, 07:40:33 pm »
Got more macros and
of this keyboard... THING. Maybe someone could tell if that HFD2201KBA is pin compatible to STM32. Full album https://imgur.com/a/roEZSB9
I doubt it will be. You need to work out where the power and ground connections are to that chip and compare against other 64 pin STM32s.
 

Offline hwsthl

  • Newbie
  • Posts: 1
  • Country: us
Re: HFD2201KBA - Any details on this microcontroller?
« Reply #9 on: June 20, 2020, 11:00:15 am »
Who knows if this will be useful to anyone in this thread since it's so old, but I thought it might be useful to other people searching for the same answer that I was. It turns out the HFD2201KBA is actually a SONiX SN32F240, which itself is a rebadged/cloned STM32. Here is a link to the product page http://www.sonix.com.tw/article-en-998-21395, the datasheet http://www.sonix.com.tw/files/13761/0C2069AC8E74BFB7E05012ACA9647FE3, and just for kicks, there is someone who has at least started the process of reverse engineering the firmware for another keyboard using the same chip. Here's a link to the blog post. https://mrexodia.github.io/reversing/2019/10/13/Analyzing-keyboard-firmware-part-2 It certainly appears that this chip is a lot of chinese manufactured keyboards, as I found it in my Keychron K4, and a google search shows maybe a dozen different models from various manufacturers.
 
The following users thanked this post: amyk, chunkylover2500

Offline chunkylover2500

  • Newbie
  • Posts: 1
  • Country: us
Re: HFD2201KBA - Any details on this microcontroller?
« Reply #10 on: July 31, 2020, 02:31:22 pm »
Thank you so much for this info! I have a Magic-Refiner MK11 bluetooth mechanical keyboard with the same HFD2201KBA LQFP64 board. I love the keyboard but one annoyance is when using it in Bluetooth mode, it quickly turns off the LEDs and goes to sleep. I would like to turn that sleep mode off but I think that is how it's programmed and knowing more about the firmware/board is a great first step in modifying it. Thanks again, I really appreciate your help here
 

Offline smileyzn

  • Newbie
  • Posts: 1
  • Country: br
Re: HFD2201KBA - Any details on this microcontroller?
« Reply #11 on: October 24, 2020, 02:07:43 am »
MotoSpeed CK62 is very similiar to TKL61WS but TKL61WS as a lot of better layer than CK62.

Here is the link for TKL61WS  : https://www.velocifiretech.com/product/m2-wireless-mechanical-keyboard/

I hope someone  can help :P
 

Offline CalcProgrammer1

  • Newbie
  • Posts: 5
Re: HFD2201KBA - Any details on this microcontroller?
« Reply #12 on: March 31, 2021, 08:08:38 pm »
Sorry for resurrecting an old thread, but we're working on porting the QMK firmware to these Sonix chips.  They're found in a ton of cheap mechanical keyboards.

https://github.com/SonixQMK

I have a video on my YouTube channel of the Redragon K552 reacting to Overwatch RGB effects using this custom firmware.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf