geekhack Projects > Making Stuff Together!

TMK USB to USB keyboard converter

(1/186) > >>

hasu:
With this converter you can change keymap and use functions TMK firmware offers on your USB keyboard.

You can support this project by getting TMK USB-USB converter from me.



Troubleshoot
You have trouble or question? Post infos like below when you can ask in this thread.


Debug output
Use hid_listen command to see its debug outputs. Post its outputs.
Try debug firmware for detailed debug log, instead of default firmware.

Keyboard model name
URL of the product page would be helpful to check its specifications and manuals

OS name
Windows/Mac/Linux

USB Descriptor
If your problem is specific to your keyboard,
use TMK USB Descriptor Dumper to get keyboard's USB Descriptor data.
Flash Dumper firmware onto your converter and then plug keyboard. Use hid_listen to get Descritpor data. Post all of outputs on hid_listen.

Also try these.
Cable and Hub
Use short and good-quality USB cable,  or plug the converter into computer directly or externally powered USB Hub.
With longer cable USB power voltage drops more at the converter and keyboard, this can cause problem especially when plug-in the devices or computer is powered up.
https://geekhack.org/index.php?topic=69169.msg3100547#msg3100547


Hardware
You need USB host controller chip MAX3421e and AVR chip ATMega32U4.

1. TMK USB to USB converter
This small board is almost equivalent to USB Host Shield plus Leonardo. This is an assmebled converter and no soldering job is needed.
You can order here to support my project.


MorePCB design files are available.
https://github.com/tmk/USB2USB_Converter

Case design file is available here. Thank you, Gouty@github! 2018-10-27
https://github.com/tmk/USB2USB_Converter/tree/master/3D%20Printed%20Case


2. USB Host Shield 2.0 + Arduino Leonardo
Just plug USB Host Shield onto Arduino Leonardo, they are not small as TMK converter but work well with default firmware.
Morea. USB Host Shield:
https://create.arduino.cc/projecthub/products/arduino-usb-host-shield
https://www.circuitsathome.com/products-page/arduino-shields/usb-host-shield-2-0-for-arduino-assembled/
http://shop.tkjelectronics.dk/product_info.php?products_id=43
https://www.sparkfun.com/products/9947

Clones(or fake) may have compatiblity issues with the library and TMK. Not recommended.
- 74HC125 vs 74AHC125 https://www.printed-droid.com/kb/usb-host-shield-repair/
- People have had problems with clones. https://github.com/felis/USB_Host_Shield_2.0/issues/76#issuecomment-159269359
- Fake doesn't work at all. https://github.com/felis/USB_Host_Shield_2.0/issues/744#issuecomment-1284358537

b. Arduino Leonardo:
https://docs.arduino.cc/hardware/leonardo


3. Mini USB Host Shield 2.0 + Pro Micro
Not supported by me but this should work too. Firmware may require small fix.
https://geekhack.org/index.php?topic=80421.0




Firmware
This converter is part of TMK keyboard firmware project. Source code for the converter firmware is available here.

https://github.com/tmk/tmk_keyboard/tree/master/converter/usb_usb

The firmware depneds heavily on USB Host Shield 2.0 library.

Build
You can compile firmware from source code. See TMK documentation for the detail.

https://github.com/tmk/tmk_keyboard/wiki#build-firmware

More
--- Code: ---$ git clone git://github.com/tmk/tmk_keyboard.git
$ cd tmk_keyboard
$ git submodule init
$ git submodule update
$ cd converter/usb_usb
$ make clean
$ make

--- End code ---

To reduce firmware size you can disable functions you don't use by commenting out following lines. Note that 'make clean' is needed after Makefile is editted.

NKRO is meaningless practically on this converter and it should be disabled always.

--- Code: ---# Build Options
#   comment out to disable the options.
#
MOUSEKEY_ENABLE ?= yes   # Mouse keys
EXTRAKEY_ENABLE ?= yes   # Media control and System control
CONSOLE_ENABLE ?= yes   # Console for debug
#COMMAND_ENABLE ?= yes    # Commands for debug and configuration
#NKRO_ENABLE ?= yes   # USB Nkey Rollover

--- End code ---
https://github.com/tmk/tmk_keyboard/blob/master/converter/usb_usb/Makefile#L93-L97

No idea? No problem, you can use easy TMK keymap editor instead, see below.


Program
For TMK converter
First, press tiny button on TMK converter to turn it into program mode.
To program converter with your own firmware you can use 'dfu-programmer' tool.
More
--- Code: ---dfu-programmer atmega32u4 erase --force
dfu-programmer atmega32u4 flash <your_firmware.hex>
dfu-programmer atmega32u4 reset

--- End code ---

If you have installed build tools you can just 'make' like this.

--- Code: ---make dfu

--- End code ---

Or you can use 'Atmel FLIP' as well. Refer to this wiki page for other program tools.
https://github.com/tmk/tmk_keyboard/wiki#flash-firmware


For USB Host Shield 2.0 + Arduino Leonardo
MorePush reset button on Leonardo before run this command. Serial port name(COM17) depends your system. On Linux I got /dev/ttyACM0.

--- Code: ---$ DEV=COM17 make program
or
$ avrdude -patmega32u4 -cavr109 -b57600 -Uflash:w:usb_usb.hex -PCOM17

--- End code ---



TMK Keymap Editor
USB to USB converter supports TMK keymap editor now!

You can edit keymapping and get your custom firmware easily with this.



Start here: Default plain layout
Or SpaceFn layout example on Keymap Editor.



Limitation

* Only supports 'HID Boot protocol'(6KRO) mode. Many of NKRO keyboards still can work in 6KRO mode. (Confirmed NKRO keyboards: see 'Compatible Keyboards' list.)
* Media/System control keys on keyboard are not recognized by the converter. Note that you can still send them with TMK firmware by remapping keys.
* 'Fn' key on keyboard is not recognized. In most case keyboards don't spit out scancode for 'Fn' key. You cannot remap the 'Fn' key itself.
* Firmware size. USB to USB converter uses alot of flash space to support USB keyboard. Some combination of TMK features can not fit into MCU flash size(28KB). To reduce firmware size you have to disable some of features you don't use, see 'Firmware' section above.
* No mouse or other pointing devices support. To support all pointing devices is difficult but it is possible to support one specific device if you are willing to write code for that. https://geekhack.org/index.php?topic=69169.msg2193024#msg2193024


Incompatible Keyboards
The converter doesn't work with:

* Varmilo VA87MR
* Sprit's PCB (Auto PS/2-USB mode selection doesn't work)
* GON's NerD
* Kinesis Advantage2 works with the latest fimrware, See this
* FC660C (it works now!)
* Realforce RGB (work around) Fixed now 2018-07-08
* GMK Cardreader Keyboard?(0744:0030)
* Tean Wolf
* Ace Pad
* X-Keys Foot Pedal XF-10-US
* G80-3000 with 2KRO(due to Cherry firmware bug) Patched for the bug. 2018-08-01
* Xiaomi Yuemi MK02S (Descriptor)
* Apple Magic keyboard(model A1644)Workaround Fixed 2023-01-25
* Koolertron/Smartyao SMKD72
* IOGEAR GKB635W Wireless Smart TV Keyboard(Report protocol only. The converter won't support this.)
* PLANCK EZ
* CHERRY MX BOARD 1.0
* iKKEGOL USB Double 2 Foot Switch
* Logitech G810 Orion Spectrum
* MK Fission(04b4:0823 Cypress)(Fixed. 2020-12)
* NuType F1 STALL error(Fixed. 2020-12)
* Rosewill RK-9200BR TOGGLE error(Fixed. 2020-12)
* Razer Huntsman Mini  (Fixed. 2020-12)
* Logitech G213 STALL error(Fixed? 2020-12)
* Unknown Gaming keyboard(04b4:3000 Cypress) TOGGLE error(Fixed. 2020-12)
* Ducky One 2 Mini [DKON2061ST 1.0.8/1.0.9] (2021-06-25) Probably fixed by Ducky. Try with Ducky firmware 1.0.10 or later and report your result.(2022-10) Not fixed(2022-12) Fixed(2023-02)
* Dygma Raise Keyboard This doesn't support 'Boot keybaord protocol'. (The converter won't support unless its fimrware is changed.) (2021-07-12)
* Corsair K65 RGB Mini (2021-09-07)
* Corsair K70 RGB MK.2 Low Profile (Workaround 2021-10-07)
* Anne Pro 2 - Fixed 2022-05-05
* Rapoo 9300M Fixed multiple boot intefaces issue 2023-07
* keymouse.com does not support boot protocol. 2024-02
* Chilkey ND75(2.4GHz wireless dongle) 2024-10
Some of incompatible keyboards listed here may work with the latest firmware probably, please try and report if you have any.
As of 2020-12 the converter firmware received a few bug fixes on its USB stack which improved its keyboard compatibility greatly.
 
Use this firmware to get detailed debug outputs on hid_listen if your keyboard doesn't work. And post its outputs here.



Compatible Keyboards
If your keyobard works well with BIOS/EFI you can expect the converter handle it reasonably. But it is still not 100% assured, the covnerter can fail to handle the keyobard with some reasons unfortunately while the converter firmiware has been gradually updated to improve compatiblility.


* Realforce (86U, 87U, 91U)
* Realforce R2(R2TLSA-US4, R2TL-US3-IV)
* Realforce RGB followup 2021-07-24
* HHKB Professional(PD-KB300)
* HHKB Professional JP(PD-KB420)
* HHKB Professional 2(PD-KB400) working on USB Hub issue Fixed 2020-11
* HHKB Professional Classic(PD-KB401)
* HHKB Professional HYBRID(PD-KB800)  Had a problem with 2022-05 firmware. Fixed.(2022-10) Confirmed(2023-03)
* LEOPOLD FC660C
* LEOPOLD FC980C
* LEOPOLD FC750R
* Varmilo MA109C
* Lenovo SK-8855(ThinkPad keyboard. TrackPoint is not supported.)
* KBP V60-MTSQ
* Cherry G80-3600
* Filco Majestouch2(Tenkeyless 87-key)
* Ducky One TKL
* Microsoft Sidewinder X4
* Novatouch TKL
* TMK Alps64
* Input Club/Massdrop Infinity 60%
* LinDon Tech 68 key
* Apple aluminium keyboard(A1243)(Fixed rollover error handling 2019-05)
* G80-3000
* HyperX FPS Pro keyboard
* Mionix Wei
* ikbc KD87
* Logitech Unifying Receiver K230 K330, K360, MX Keys, ERGO K860
* DXT28 Bluetooth HID Proxy dongle
* Matias Ergo Pro
* Fujitsu FMV-KB232
* Niz Atom66
* Kinesis Advantage(KB500USB)
* Kinesis Advantage2(KB600)
* ASUS Strix Tactic Pro (Note that its JIS version keyboard seems to have a glitch.)
* DSI Left Handed Keyboard
* Vortex Core
* Vortex Tab 90M
* GMK Uniqey C70
* Logitech K120
* Matias Quiet Pro for Mac
* GK64
* GH60
* Kbpardise v60
* Vortex pok3r
* Filco Majestouch 2 104
* NuType F1(Fixed STALL error. 2020-12)
* Rosewill RK-9200BR(Fixed Toggle error. 2020-12)
* MK Fission(04b4:0823 Cypress)(Fixed 2020-12)
* Unknown Gaming keyboard(04b4:3000 Cypress) (Fixed TOGGLE error. 2020-12)
* Ducky One 2 Skyline TKL
* Logitech G413 Probably. 2023-12 Confirmed.
* Logitech G213 Probably. Fixed STALL error(2020-12)
* Apple A1048
* Keychron K8
* UNICOMP Model M
* compact GMMK
* Logitech G915 with the lightspeed receiver
* EpoMaker EP-84
* Truly Ergonomic
* IQUNIX F96
* Arkoncore AR87
* Apple Keyboard A1243
* Keychron k3 v2
* Unicomp Mini M
* Razer Huntsman Mini (Fixed. Confirmed by  ByteCrash  in Private Mesage. 2020-12)
* Redragon Anivia K614 RGB
* Zopsc-1/Bajeal
* Stoga MK22
* Vimukun/Magic-Refiner MK21
* HyperX Alloy Origins 60
* Redragon Dragonborn K630 RGB
* Womier K61
* GMMK TKL
* Hexgears Impulse, Hexgears Nova
* Tezarre TK61, Punkston TH61
* Anne Pro2 - Fixed 2022-05-05
* Logitech MX Keys Mini with LOGI BOLT USB RECEIVER
* Delux GM903
* LTC NB681
* Delux GM902 (2022-09)
* Wooting two he (2022-09)
* Apple Magic keyboard(A1644/A1843) Supported 2023-01-25
* Ducky One 2 Mini(DKON2061ST / DKME2061ST) 2023-02-01
* COOLER MASTER CK352 2023-02-15
* A4Tech KV-300H
* Rapoo 9300M Fixed issue 2023-07
* Insignia Wireless Ergonomic
* Poker X 2023-12
* Chilkey ND75(USB) 2024-10
Report from users would be really appreciated. Please post your result in this thread.


Issues
ConnectPro KVM switch
The converter doesn't work on its DDM port of ConnectPro KVM switch. Workaround is disabling debug console. (2021-10-05)
https://geekhack.org/index.php?topic=69169.msg3085929#msg3085929
https://github.com/tmk/tmk_keyboard/issues/707
Fixed(2021-10-24)

UGREEN's usb 2.0 KVM switch
The covnerter doesn't work on Macbook pro after long sleep when connected through the KVM.
No workaround as of 2021-09.
https://github.com/tmk/tmk_keyboard/issues/703


Update
2024-03 Fix for Unicomp Mini M #773
2023-12 Fix startup for Poker X
2023-12 Add suspend and remote wakeup support(power saving)
2023-02 Ducky One 2 Mini support
2023-01 Apple Magic keyboard(A1644/A1843) support
2022-10 Update description for Ducky One 2 Mini
2022-10 Fix for HHKB Hybrid
2022/05 Fix for Anne Pro2
2021/10 Update firmware
    - Fix for ConnectPro UD-12+ KVM #707
    - UHS2: 500ms delay for bus reset for Matrix Vita
    - UHS2: Improve plugin detection in busprobe()
2020/12 Fix STALL error
2020/11  Fix TAP_KEY
2020/11  Add Mechanical Locking Key support
2020/11  Fix TOGGLE error and HUBPRE bit.
2019/05  Fix startup stuck problem
2019/05  Fix Rollover error handling
2018/11  Update firmware(Use fixed LUFA stack and update USB_Host_Shield_2.0)
2018/11  Add Filco Majestouch2 87 and ikbc KD87 to compatibility list
2018/07  Update  firmware to fix startup issue. see this commit.
2018/10  Add design file for enclosure
2018/02  Update "Reported keyboards" section
2017/05  Fix startup code for FC660C
2016/09  New keymap editor(unimap) is available
2016/01  Add Keymap editor
2015/12  Add Firmware size to limitations, and recommendation for genuine host shield
2015/11  Add keymap for JIS and ISO
2015/07  Bug fix for keyboard sending ErrorRollOver report
2015/07  Add Locking key indicator support
2015/06  Updated Limitation and TODO
2015/02  TMK USB to USB converter Rev.A
2014/12  Added Hub support(confirmed with HHKB pro2)

TheSoulhunter:
Nice! Interested in getting one...

SpAmRaY:
Hasu, any chance you would build some of these to sell?

metalliqaz:
This is really great. I wanted to build one of these a while ago but I just couldn't find the time to follow through.  Looks fantastic!

hasu:
I have spare PCBs and have a plan to get some of them assembled once I confirm it works well in the field after some daily usage.

Today, I found a bug :D

Navigation

[0] Message Index

[#] Next page

Go to full version