The EC controls a whole bunch of devices in your laptop. Why have we not been reprogramming our ECs all this time? That’s a warranted question, too, and I will tell you all about it. In Apple land, you might know them as SMC, but their function is the same. You can find an EC in every x86 computer, including laptops, managing your computer’s lower-level functions like power management, keyboard, touchpad, battery and a slew of other things.
Wait… Microcontroller code? GPIOs? This brings us to the question – what is the EC, really? To start with, it’s just a microcontroller. In a comment section of HackerNews, a Framework representative has speculated that you could add GPIOs to a Framework motherboard through EC firmware hacking. Now, there’s a repository of microcontroller code that you can compile yourself, and flash your Framework laptop’s motherboard with.
The EC that the Framework uses is a MEC1521 chip from Microchip, and earlier this year, they open-sourced the firmware for it. He walks us through adding custom code to your laptop’s EC firmware and integrate it properly into the various routines the EC runs. He shows us how to reuse the Caps Lock LED, instead making it indicate the F1-F12 key layer state – also known as “Fn lock”, AKA, “Does your F1 key currently work as F1, or does it regulate volume”.
Recently, I stumbled upon a cool write-up by, about reprogramming a Framework laptop’s Embedded Controller (EC).