HFD2201KBA - Any details on this microcontroller? - Page 1
Forum section: electronics / general

author: plastygrove
author_rank: Contributor
timestamp: November 08, 2018, 11:37:02 am
content: I boughtthis keyboardfrom 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 foundthis pagewhich has animageof 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?

author: technix
author_rank: Super Contributor
timestamp: November 08, 2018, 01:08:00 pm
content: 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.

author: plastygrove
author_rank: Contributor
timestamp: November 08, 2018, 01:36:46 pm
content: Quote from: technix on November 08, 2018, 01:08:00 pmHmm, 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.

author: technix
author_rank: Super Contributor
timestamp: November 08, 2018, 02:02:26 pm
content: Quote from: plastygrove on November 08, 2018, 01:36:46 pmTechnically you can remove the chip and add in your own board using flying leads.

author: lucazader
author_rank: Regular Contributor
timestamp: November 08, 2018, 06:46:09 pm
content: 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

author: plastygrove
author_rank: Contributor
timestamp: November 09, 2018, 01:07:30 pm
content: Quote from: lucazader on November 08, 2018, 06:46:09 pmThat's very interesting, I am not very familiar with USB standards and this is good information to know. Thanks!

author: SiliconWizard
author_rank: Super Contributor
timestamp: November 09, 2018, 03:40:34 pm
content: I recommend this app note:http://ww1.microchip.com/downloads/en/AppNotes/00001953A.pdf

author: joric
author_rank: Contributor
timestamp: December 14, 2018, 07:34:34 pm
content: Got more macros andof this keyboard... THING. Maybe someone could tell if that HFD2201KBA is pin compatible to STM32. Full albumhttps://imgur.com/a/roEZSB9

author: tsman
author_rank: Frequent Contributor
timestamp: December 14, 2018, 07:40:33 pm
content: Quote from: joric on December 14, 2018, 07:34:34 pmI 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.

author: hwsthl
author_rank: Newbie
timestamp: June 20, 2020, 11:00:15 am
content: 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 pagehttp://www.sonix.com.tw/article-en-998-21395, the datasheethttp://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-2It 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.

author: chunkylover2500
author_rank: Newbie
timestamp: July 31, 2020, 02:31:22 pm
content: 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

author: smileyzn
author_rank: Newbie
timestamp: October 24, 2020, 02:07:43 am
content: 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

author: CalcProgrammer1
author_rank: Newbie
timestamp: March 31, 2021, 08:08:38 pm
content: 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/SonixQMKI have a video on my YouTube channel of the Redragon K552 reacting to Overwatch RGB effects using this custom firmware.