Infrastructure for examining and patching Thinkpad embedded controller firmware
Perl Makefile Assembly Shell
Switch branches/tags
Nothing to show
Clone or download
Failed to load latest commit information.
asm Fix right-win and right-menu key definitions Jan 25, 2017
docs Fix t430s download link to point to the ISO version, not the EXE Aug 7, 2018
mec-tools @ 07a1b14 Update mec-tools to get a couple of fixes May 28, 2016
radare Fix x220 ec firmware image file in radare project file Jun 24, 2017
scripts Skip over deps lines with tagging errors - but warn about it Aug 7, 2018
t430.G1HT34WW.img.d Disable battery_validate.patch for all supported models to match docs Jun 16, 2017
t430.G1HT35WW.img.d Mark t430 battery patch as known working Sep 15, 2016
t430s.G7HT39WW.img.d BUG: remove extra line from patch file Jun 11, 2016
w530.G4HT39WW.img.d After testing by MarzEz, mark the T530 battery patch as working. Mar 9, 2017
x230.G2HT35WW.img.d Merge pull request #50 from bwachter/x230-ctrl-caps-swap Oct 9, 2017
x230t.GCHT25WW.img.d Merge pull request #51 from bwachter/x230t-ctrl-caps-swap Oct 9, 2017
.gitignore Ignore the FL1 files that we now sometimes generate Sep 5, 2017
.gitmodules Add x230 image and infrastructure Apr 19, 2016
.travis.yml Ensure needed packages are installed by travis May 28, 2018
Descriptions.txt Update t430s to latest BIOS release - no EC version changes Aug 7, 2018
LICENSE Add License details Apr 23, 2016
Makefile Ensure needed packages are installed by travis May 28, 2018
README Update notes on flashing issues. May 28, 2018
autoexec.bat.template Remove most of the variables from the autoexec.bat template Jul 3, 2017
t530.G4HT39WW.img.d Add t530 support - this appears to share the EC firmware with the w530 Apr 27, 2016


The main purpose of this software is to patch the EC on xx30 series thinkpads
to make the classic 7-row keyboards work.  There are also patches included (but
disabled by default) to disable the authentic battery validation check.

With the patches included here, you can install the classic keyboard
hardware on many xx30 series laptops and make almost every key work properly.
The only keys that are not working are Fn+F3 (Battery) and Fn+F12 (Hibernate)

Unfortunately, there are a small number of thinkpads with a model number
from the "xx30" series that are using a completely different EC CPU and
a different BIOS update strategy.  Thus they are not currently able to
be patched.  This is known to be the case for at least the L430, L530
and E330.

* A full writeup of the hardware modifications needed can be found at:

* More information for hacking on this can be found in the docs/HACKING.txt

* A video presenting how these thinkpad laptops were hacked is online:

Step-by-step instructions:

This software expects to be run under Linux.  For best results, ensure you
have updated your BIOS to a recent version before starting.  If there is too
large a difference between the BIOS and EC versions then the flash process
will not complete.

1. Ensure you have installed the prerequisite packages
   On debian, this can be done with:

    sudo apt-get install build-essential git mtools libssl-dev

2. Clone a copy of this repo on to your computer:

    git clone

3. Change to the directory created by the clone:

    cd thinkpad-ec

4. Show the list of laptops and USB image file names:

    make list_laptops

5. Choose your laptop model name from the list shown.
   E.G. "patched.x230.img" for a x230 laptop.

6. Using the name chosen in the previous step, make the fully
   patched image for this laptop (this will download the original
   file from Lenovo and patch it):

    make patched.x230.img

7. Insert your USB stick and determine what device name it has.
   (Note: chose a USB stick with nothing important on it, it will
   be erased in the next step) This command should help you find the
   right device:

    lsblk -d -o NAME,SIZE,LABEL

8. Write the bootable patched image onto the USB stick device (replace
   the "sdx" in this command with the correct name for your usb stick)

   WARNING: if you do not have the right device name, you might overwrite
   your hard drive!

   sudo dd if=patched.x230.img of=/dev/sdx

Your USB stick is now ready to boot and install the patched firmware.


* You can also create a bootable CDROM image for burning to a disk
  by asking for a ".iso" file instead of the ".img" in step 6 above.
  Then you can use your normal CDROM burning tools to put this image on
  a blank cd and boot it up, skipping steps 7 and 8.

* To include the battery validation patch or to make a build that
  reverts any EC changes, read the docs/CONFIG.txt and follow
  the configuration instructions in it before running step 6.

Booting the stick and flashing the firmware:

While flashing the firmware is as simple as booting the USB stick
created above, there are a couple of steps that can help the process.
This is more a list of issues that the community has discovered as the
patch was applied in different circumstances than a hard and fast set
of requirements.

* For best results, ensure you have the power charger plugged in during
  the flashing process.

* The firmware flash process generally requires you to have a charged
  battery plugged in to the laptop before it will complete.  It may be
  possible to bypass the requirement for a charged battery if you unplug
  the battery completely.  Alternatively, it might be simply looking for
  any battery /and/ the power charger plugged in.  Yes, this is
  contradictory, but it is worth trying both options.

* An ultrabay battery is not considered by the update mechanism to be
  a suitable source of power - when trying different battery options,
  ensure you are trying batteries in the main battery slot.

* Ensure your BIOS has been configured to boot from "Legacy" and not
  "UEFI" before trying to boot.

* If you do normally use UEFI boot, there has been at least one case where
  the EC does not get flashed until the BIOS is switched back into UEFI
  mode - after which the EC was automatically flashed on the next reboot.

* When you boot the stick, you will be shown information about the patch,
  including which laptop type it was built for.  It pauses at this point
  for you to confirm that you wish to proceed.  It will then automatically
  flash the patched firmware.