summaryrefslogtreecommitdiff
path: root/posts/2014-11-23-upgrading-trulyergonomic-firmware.markdown
blob: 25f470c3955b5451c90e1768377e5b69a7070e6e (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
---
title: Upgrading the TEK's firmware on GNU/Linux
date: 2014/11/23
tags: keyboard, virtualbox
---

I'm using the Truly Ergonomic Keyboard (model 209) for most of my
typing, because it's a pretty comfortable keyboard (when it works).
One of the greatest features of this keyboard is that the layout can
be customised and flashed to the hardware with a firmware upgrade.
Unfortunately, the application used to flash the firmware is only
available for Microsoft Windows.

As a GNU/Linux user I find this to be very inconvenient.  I simply
don't have access to a machine running Microsoft Windows (not even at
the office).  Luckily, Microsoft provides
[free virtual machine images](http://modern.ie) of various versions of
their operating system for browser evaluation purposes.  I
occasionally use them to verify that a web page works all right in the
proprietary and often quirky Microsoft browsers.  Although these
images could be used in KVM, converting and tweaking them takes a
little too long and is a bit annoying.  For the quickest results these
images should be imported with Virtual Box instead.

Truly Ergonomic recommends not to use virtualisation software to
update the firmware of the keyboard, but as I was out of other options
I decided to give it a try anyway.  You probably should not be doing
this if you don't feel you would be able to perform a
[manual reset](https://www.trulyergonomic.com/store/troubleshooting--truly-ergonomic-mechanical-keyboard#Reset)
of the controller in case something goes wrong.

## Preparation

- a recent version of Virtual Box
- a virtual machine image of Microsoft Windows
- a user account that is a member of the group *vboxusers*; required
  to access any host USB devices from within a Virtual Box machine.
  If you have just added your account to this group, remember that you
  need to log off and on again before the changes come into effect.
- enable USB 2.0 support, provided by the *Oracle VM VirtualBox
  Extension Pack*.  The extension pack has to be installed through the
  preferences menu in the VirtualBox client.  Note that you may have
  to run the client as root to have sufficient permissions to install
  the extension pack.
- a USB device filter configured to pass host USB devices through to
  the virtual machine

If everything is set up properly you should be able to forward USB
devices from the host system to the virtual machine.  Try setting up a
USB device filter in the USB settings menu of the virtual machine.
You should be able to create a filter for the Truly Ergonomic Keyboard
right there.  If you cannot see a list of USB devices at all at this
point check that your user account is a member of the group
*vboxusers*.


## Performing the upgrade

Inside the Windows machine start the official firmware upgrade tool,
load the firmware you want to flash to the keyboard, and click on
*Upgrade*.  This will result in an error message, but that's okay:
don't panic!  The reason why this error occurs is that the USB
identifier of the keyboard will have changed from something like this:

    ID 0e6a:030c Megawin Technology Co., Ltd Truly Ergonomic Computer Keyboard

to something like this:

    ID 0e6a:030b Megawin Technology Co., Ltd Truly Ergonomic Computer Keyboard (Device Firmware Update mode)

Since the USB identifier has changed, VirtualBox may no longer forward
this device from the host to the virtual machine guest system.  All
you have to do is add a filter for this new USB device in the guest
settings and resume the upgrade by clicking on *Upgrade* again.  This
will again lead to another error, but I found that by that time the
upgrade has already been performed successfully.

Note that while the USB device is being forwarded to the guest system
you cannot use it in the host.  To test if the new firmware works as
expected in your system, disable the USB filters in the guest
settings.


## Next steps

It should also be possible to flash the firmware directly from a
GNU/Linux system.  I suppose one could sniff the USB communication and
build a little tool that performs the upgrade natively on GNU/Linux.