Latest posts by Jonathon Hall (see all)

Librem-EC 1.11 for the Librem 14 laptop includes several improvements targeting device stability and reliability.  As with our previous posts on the EC, it has been quite an adventure investigating corner cases!  Update to this release with our update instructions, and as always the source code is available.

Battery Power Limits

Despite several EC releases addressing sudden shutoffs, we still received reports of devices shutting off suddenly with relatively high battery charge – over 40%.  We’ve tracked this down to a transient power limit that was too high for some devices.

Intel CPUs provide multiple configurable power limits, called PL1 through PL4.

PL1 is the “long term” average power limit.  The CPU can briefly spike above PL1, but over time, the average power draw will not exceed PL1.  This is essentially the cooling limit of the system.  Short spikes are fine for thermals, but exceeding the cooling limits for a long time will cause the processor to overheat.

PL4 is the preemptive power limit.  The CPU will never exceed this limit, even momentarily.  (PL2 and PL3 are in between, they allow spikes of longer or shorter durations at different limits.)  PL4 is essentially the power delivery limit of the system.  Put simply, if the total draw on the system exceeds its capacity, the system will shut off.  The total draw includes all parts of the system and any devices plugged in, not just the CPU.

Intel documents these power limits in their datasheets:

Graph displaying system power over time with respect to PL1 through PL4, with momentary spikes reaching PL4 but averaging to PL1
Power limits over time, from Intel’s datasheet

The Librem 14 sets PL4 differently depending on whether the AC adapter is present and the battery state of charge.  A fully charged battery can handle larger power spikes than a partly discharged battery.

Since PL4 limits momentary spikes, it mainly affects responsiveness for light tasks, and the new limit of 25W is still very responsive.  The difference generally should not be noticeable, but it will ensure that the system does not shut off by exceeding the battery’s current limit.

Watchdog Timer

The EC is a critical component of the system.  It sets power limits like PL4, configures battery charging characteristics, and controls the power rails to the CPU.  If the EC program would ever freeze, the system cannot power on, and it might even damage the system.  The only way to manually reset the EC is to remove the bottom shell and physically disconnect the main battery.

Watchdog timers are a common microcontroller feature to guard against this failure mode.  This requires the EC firmware to periodically “check in” and indicate that it’s still running by resetting the timer.  If it does not check in within the timeout, the EC hardware resets.

Graph of EC program watchdog interval. EC program checkpoints periodically, resetting watchdog interval. If the EC program freezes, the watchdog interval triggers a reset.
The watchdog timer triggers a reset if a checkpoint is missed

We’ve worked hard to ensure that the EC program will not freeze, but we should never assume that our code is perfect.  The watchdog timer provides added robustness by automatically recovering from an EC freeze.

CPU Hard Reset

Every once in a while, Librem 14 might have required two tries to power it on.  While this was rare, and it is easy to work around, we want your Librem hardware to work the first time, every time.

This happened whenever the firmware had to re-run memory training.  DDR4 memory runs at such high speeds that the system must measure electrical characteristics of the combined CPU, mainboard, and memory to provide a reliable connection.  Memory training usually takes about 20 seconds, so the firmware stores the result for later boots.  Training occurs if the firmware has been upgraded, the memory has been changed, or if the RTC has reset.  When that happens, the next boot will show a black screen for about 20 seconds before resuming normal boot.

On Librem 14, whenever training occurred, the system wasn’t resuming the normal boot automatically.  Instead it would shut off, and you’d have to press the power button a second time.

After memory training, the firmware resets the system to start a normal boot.  This “hard reset” is different from the “soft reset” that happens during reboot.  In this state, the CPU goes to the “soft off” state (S5) just like it has shut down.  Then, the Platform Controller Hub wakes it up again after a few seconds.

Librem 14 was shutting off in this state though, because Librem-EC interpreted the “soft off” state as a system shutdown and turned off the CPU entirely.

Graph of power states over time during memory training boot. Librem-EC 1.10 transitions to "off" (Deep S5) when entering "soft off" (S5), so boot cannot resume. Librem-EC 1.11 waits in "soft off" for boot to resume.
Memory training boots resume after reaching S5 for a few seconds in EC 1.11

Librem-EC waits a few seconds before shutting off the system any time the CPU reaches “soft off” (S5).  During a normal shutdown, this just delays the transition to the “off” state for a few seconds.

Graph of system power states during normal shutdown. EC 1.11 waits a few seconds longer before transitioning to "off" (Deep S5) from "soft off" (S5).
Shutdown waits briefly in S5 before reaching “Deep S5” in EC 1.11

Reliability for Your Digital Life

The Librem 14 laptop is designed to respect your privacy, security, and freedom.  Librem-EC 1.11 brings more robustness to our open source embedded controller firmware, so your Librem 14 is always ready to go.

Purism Products and Availability Chart

 ModelStatusLead Time 
Most Secure PC Purism Librem Mini
Librem MiniIn Stock10 days
Most Secure Server Purism Librem ServersLibrem ServersOut of Stock--
USB Security Token Purism Librem KeyLibrem KeyIn Stock10 days
Most Secure Laptop Purism Librem 14Librem 14In Stock10 days
Made in USA Phone Purism Librem 5 USALibrem 5 USAIn Stock10 days
Librem 5Currently shipping backlogs52 weeks
The current product and shipping chart of Purism Librem products, updated on September 2, 2022

Recent Posts

Related Content