16bit.io

Projects and notes

Flashing the Embedded Controller to use a "Classic" keyboard

Having used a T420s as my primary laptop prior to upgrading to the T430s, I grew quite accustomed to the much loved (and missed) classic 7-row keyboard. For the unaware, it was during this period that Lenovo switched their laptop keyboards over to a new chicklit design and re-arranged the function keys. Both keyboards appeared physically similar, so I wondered if they could easily be swapped.

Thankfully, the classic keyboard only requires minor modification to mount inside the housing of a T430s palm rest. The nubs only need to be filed down to fit, however a better option would be to just purchase a T420s palmrest to avoid damaging the keyboard. The connector itself is identical and electronically compatible, however many of the function keys reported their codes incorrectly due to the EC expecting different signals from the other keyboard. This is what we are going to fix with the EC modification.

The classic keyboard I was using was pretty worn and I wanted to replace it with something in better condition. I researched the manufacturers of each FRU number listed as compatible for the X220 and T420s (As they both accept the same classic keyboard) to find the model with the best quality switches. The common keyboard manufacturers are listed below:

I was able to salvage the keyboards from many retired T420s laptops from my work, most of which were in mint condition as they were usually used while docked. Most of the keyboards were ALPS, but they were mushy and cheap feeling. I found an NMB keyboard in pristine condition and the improvement over ALPS is well worth the hunt. It’s much stiffer, which I prefer, and has a more tactile click. The Chicony keyboards are very similar in quality and feel to the NMB branded ones.

Thankfully the author of this article figured out a way to flash an altered firmware to the Embedded Controller. The primary goal was to enable to use of non-Lenovo signed batteries, since this was the first series to enforce a cryptographic check on the battery. This “enhancement” unfortunately prevents the use of the near identical T420s battery, of which I have plenty. The side effect of this project was the ability to remap the interpreted key presses so that the classic keyboard sends the proper signals to the OS. Both of these have been possible thanks to the work of Hamishcoleman, who built an automated patching tool that has been open sourced here. I also found the links listed in the references section to be helpful for building the firmware.

The most important, and often overlooked requirement, is that you must change your BIOS to boot in Legacy mode and not UEFI to run the flashing tool, otherwise the BIOS will not enter the proper flash mode. Be sure you are also running the latest official BIOS and EC before flashing the custom version!

Once the EC was flashed I tested all of the keys and everything worked great! The display brightness and ThinkLight keys were also all remapped properly. I switched my aging T430s 81+ battery out for a new 61+ battery from a T420s and didn’t receive the error at boot, nor did I have any issues with communication to the battery from the OS for capacity information.

References